Windows 10 WSL now can run Linux commands on startup

Microsoft now allows users of the Windows Subsystem for Linux (WSL) to run commands automatically on WSL distribution startup.

WSL is a compatibility layer designed by Microsoft to makes it possible for Windows 10 to run Linux binaries in ELF format natively on  Windows computers.

Insiders in the Dev channel who want to upgrade to Windows 10 Build 21286  to gain access to this new feature can do so by going into Windows Update and checking for new updates.

“We have added an option that allows you to run any specified Linux command on startup of a WSL distribution,” Windows Insider Program senior program manager Brandon LeBlanc said.

“You can accomplish this by editing the /etc/wsl.conf file in your distribution and adding an option titled command under a section titled boot.”

For example, as shown in the screenshot below, users can use this new WSL feature to log the time and date their WSL distros were started up.

WSL startup commands
Image: Microsoft

Once added to the WSL distribution’s /etc/wsl.conf file, the Linux commands will automatically be run when the distro is started.

“WSL distributions will remain running for a few minutes even after the last Linux process inside of them is closed,” LeBlanc added.

“You can view if your WSL distro is running using wsl --list --verbose and you can manually shut down all WSL distributions using wsl --shutdown.”

Other new features, fixes, and improvements

Microsoft has also modernized Storage Spaces settings in this Windows 10 Dev build which now allows creating and managing Storage Spaces using the Settings app.

The new settings page dedicated to the Storage Spaces feature allows creating storage pools and storage spaces, as well as adding, and removing disks, and optimizing pools.

This build also comes with a simplified version of the Windows File Recovery tool and a new Google Discover-like Windows 10 feature called ‘News and Interests’ that displays recommended news stories, sports scores, and weather information using a taskbar flyout.

Changes and Improvements:

  • Based on feedback, (GitHub issue #1495) we’re adding an option to disable automatic controller-to-virtual-key mapping for UWP apps. If you have a need to do this, add the following registry key, with a DWORD value of Enabled set to 0: HKLMSoftwareMicrosoftInputSettingsControllerProcessorControllerToVKMapping.

Fixes:

  • We fixed and issue causing some Insiders to see a popup that says “Your PC ran into a problem and restart in 1 min” after logging in to Windows with either an Azure Active Directory or Active Directory account on Build 21277.
  • We fixed an issue where no drives appeared under Settings > System > Storage > Manage Disks and Volumes.
  • We fixed an issue resulting in some printers getting stuck on connecting when added from Settings.
  • We fixed an issue that could result in sometimes unexpectedly being signed out of apps and websites after rebooting your PC.
  • We fixed an issue where the Windows Security icon would sometimes be unexpectedly large in the context menu when shift-right-clicking taskbar icons.
  • We fixed an issue that could result in MediaTranscoder hanging when transcoding certain files.
  • We fixed an issue where audio playing from UWP apps wasn’t ducking after pressing the microphone icon to start Cortana listening.
  • We fixed an issue that could result in VPN entries in the network flyout getting stuck at Action Needed until you pressed Cancel and Connect again.
  • We fixed an issue impacting touch targeting when resizing windows using touch.
  • We’ve made some fixes to our emoji keyword search results based on feedback, including adding a new keyword so that typing “lgbtq” will now return the rainbow flag emoji. Please continue sharing feedback with us in the Feedback Hub under Input and Language > Emoji Panel.
  • We fixed an issue that could result in the Read Aloud options in Magnifier being unexpectedly greyed out.
  • We fixed an issue where the “Help make Narrator better” toggle in Narrator Settings was disabled for Insiders.
  • We fixed an issue so that Narrator will now read Excel cell contents when verbosity is set to 2.
  • We fixed an issue where Narrator might not announce whether a combo box was in expanded or collapsed state.
  • We fixed an issue impacting Narrator’s ability to read the names of certain hyperlinks on websites in Microsoft Edge.
  • We fixed an issue impacting Narrator’s ability to read code windows in Visual Studio.
  • We fixed an issue for high contrast users that could result in Settings crashing when going to Ease of Access.