, , , ,

Install Windows Subsystem for Linux on Windows Server

1–2 minutes
7 comments on Install Windows Subsystem for Linux on Windows Server
Ubuntu on Windows Server using WSL

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.

WSL on Windows Server

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.

7 responses

  1. nolange Avatar
    nolange

    Thanks for this guide,

    one question though: how do you figure out the URLs for the distros?
    I would prefer installing debian.

    1. Thomas Maurer Avatar

      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.

  2. Sebas Avatar

    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?

  3. Tim Avatar

    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.

  4. Karel Avatar

    Please let Invoke-WebRequest be history and use Start-BitsTransfer for file download, its 1000% faster

    1. Thomas Maurer Avatar

      Bits only works on Windows, we try to avoid commands which are not working crossplatform.

  5. mujahid Avatar
    mujahid

    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 …

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.