Linux for Windows
Why run Linux on Windows?
Most high performance computing environments run a version of Linux. Microsoft has created a way to run Linux on top of Windows 10 that enables you to take advantage of powerful Linux software and develop tools locally that will work in cluster computing environments. Microsoft has called this feature Windows Subsystem for Linux (WSL).
Windows Subsystem for Linux
Windows Subsystem for Linux 2 can be installed on all versions of Windows 10.
Run Windows Powershell as Administrator. You can search your computer for "Powershell" from the Windows menu. Right click on "Windows Powershell" and select "Run as Administrator."
Inside Windows Powershell, enter the following commands, each followed by hitting
Enter
:dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer
Download and install: WSL Update
Restart your computer
Run Windows Powershell as Administrator, then enter the following command:
wsl --set-default-version 2
, followed byEnter
Open the Microsoft Store. Download and install Debian. You will need to login with your Microsoft Account (or create one).
Open Debian. The first time you use Debian, you will be prompted to create a username and password for the guest operating system.
Troubleshooting
If you get an error related to "permissions", close PowerShell, and reopen by selecting "Run as Administrator."
If you get the error
Invalid command line option: --set-default-version
when attempting to set default WSL version (step 5 above), then your version of Windows may need updating. Run Windows Update and go back to step 4.If you are running Windows as a virtual machine and receive the error:
Error: 0x80370102 The virtual machine could not be started because a required feature is not installed
when attempting to open Debian, then your virtual machine hypervisor does not have nested virtualization enabled (e.g. for Paralells).Complete WSL installation documenation from Microsoft is available here.