In 2017 Microsoft made it possible to run different Linux distribution on Windows 10, using a feature called the “Windows Subsystem for Linux“. With the latest official Semi-Annual Channel Windows Server release called Windows Server, version 1709 Microsoft also allowed to run the Windows Subsystem for Linux (WSL) on Windows Server. With the next release of Windows Server called Windows Server, version 1803, Microsoft will also add some improvements to the Windows Subsystem on Linux, which also apply to Windows 10 as well as Windows Server. This blog post shows you how you can do this.
First, you have a Windows Server, version 1709 running. After that enable the Microsoft Windows Subsystem for Linux feature, running the following command (This will need a reboot)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
You can download the appx packages for your favorite Linux distribution; this can be today:
- Ubuntu
- OpenSUSE
- Suse Linux Enterprise Server
If you are running on Windows Server Core (which is highly likely), you can use the following command to download the Linux distributions.
# For Ubuntu 16.04 Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.zip -UseBasicParsing # For Ubuntu 18.04 Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu1804.zip -UseBasicParsing # For OpenSUSE 42 Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/OpenSUSE.zip -UseBasicParsing # For SLES 12 Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.zip -UseBasicParsing
You can then unpack the file:
Expand-Archive ~/Ubuntu.zip C:\Distros\Ubuntu
Now you can open that folder and run the installer, for example ubuntu.exe. The first time this will do the setup where you also define the UNIX username and password as well as the root password.
After that, you can run updates for your distro, and you can start using Linux.
If you want to know more about the WSL, check out the Microsoft Documentation: Windows Subsystem for Linux Documentation and have a look at my WSL post in for Windows 10: Crazy times – You can now run Linux on Windows 10 from the Windows Store
You can also find the other Linux distro packages here: WSL distro packages.
Tags: Linux, Microsoft, openSUSE, PowerShell, SLES, Ubuntu, Ubuntu on Windows Server, Ubuntu.exe, Windows, Windows 10, Windows Server, Windows Server 1709, Windows Subsystem for Linux, WSL Last modified: June 20, 2019
Thanks for this guide,
one question though: how do you figure out the URLs for the distros?
I would prefer installing debian.
Hi
I just added a link to the distro page of Microsoft. There you can find all the information and links for the available distros.
Thanks for this guide. Where will the files take up space for anything I install on Linux? I have a SSD for my C: and HDD for storage. I have installed on the HDD (E: drive), so I have the ubuntu.exe folder in here. Will this mean anything I do on Ubuntu remain on this folder? Like any app I get from apt?
I am running insider version of Windows Server 19008 and I get
PS C:\Windows\system32> wsl -l -v
NAME STATE VERSION
* Ubuntu-18.04 Running 1
Not version 2 like I was wanting. I’ve done the “wsl –set-default-version 2” but still shows 1.
Please let Invoke-WebRequest be history and use Start-BitsTransfer for file download, its 1000% faster
Bits only works on Windows, we try to avoid commands which are not working crossplatform.
Invoke-WebRequest : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
At line:1 char:1
+ Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubun …