How to run Linux commands when starting Windows Subsystem for Linux on Windows 10
The latest beta version of Windows 10 allows users to automatically run Linux commands when Windows Subsystem for Linux starts.
Microsoft has just added a new feature for Windows Subsystem for Linux (WSL) on Windows 10. Specifically, WSL users on the latest beta version of Windows can set up Linux commands to automatically run when WSL starts. .
WSL is a compatibility layer designed by Microsoft to help Windows 10 run Linux binaries in native ELF format on Windows computers. In other words, users can run Linux commands right on Windows 10 without having to parallel install and switch between Linux and Windows.
How to run Linux commands when starting Windows Subsystem for Linux on Windows 10
Condition:
- Update the latest Windows 10 beta, Build 21286
- Install WSL
Doing:
- Edit /etc/wsl.conf and add an option titled command below the section titled boot
- Once added to the /etc/wsl.conf file , Linux commands will automatically run when the WSL distributions are started.
- WSL distributions will still run for a few minutes even after the Linux process inside them is closed
- You can check the distributions that are running using the command
wsl --list --verboseand manually turn off all WSL distributions with the command.wsl --shutdown
If the testing goes well, this feature will soon be released by Microsoft in Windows 10 official release. Expected in 2021, Microsoft will have many updates and upgrades worthwhile for Windows 10 in terms of both interface and features.
Good luck.
You've just finished reading the article "How to run Linux commands when starting Windows Subsystem for Linux on Windows 10" edited by the TipsMake team. You can save how-to-run-linux-commands-when-starting-windows-subsystem-for-linux-on-windows-10.pdf to your computer here to read later or print it out. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.
- How to install Windows Subsystem for Linux 2 on Windows 10
- How to run Linux desktop using Windows Subsystem for Linux
- How to Enable the Windows Subsystem for Linux
- You Don't Need Microsoft Windows Subsystem for Linux (WSL): Here's Why!
- How to Install Arch Linux in Windows Subsystem for Linux
- How to activate Windows Subsystem for Linux on Windows
- Windows Subsystem for Linux is about to appear on Windows Server
- How to unregister and reset Windows Subsystem for Linux (WSL) distros on Windows 10
- 6 Reasons You Should Try Windows Subsystem for Linux (WSL)
- Install CentOS on Windows 10 WSL
- Microsoft released a tool to run any version of Linux on Windows 10
- Running Linux on Windows 10 does not require a virtual machine, here are 18 things you should know
- The Linux subsystem on Windows 10 allows malware to hide without being detected
- 5 Linux commands every sysadmin needs to know