You can (1) download the installers from the Windows Store or (2) download a distribution file and install it using tools such as lxRunOffline or WSL Distrolauncher.
- You can install Ubuntu 18 or many other distributions using the second option.
Downloading the installer from the Windows Store
You can download the installers from the Windows Store using Powershell. For instance, you can download the Ubuntu 16 version using the following command
PS> Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing
In the above command, the output file is Ubuntu.appx
. It must be named in that way. You can run that application to install the Ubuntu.
PS> Ubuntu.appx
Using LxRunOffline
First, you must download some distribution file. There are many distribution files available in the lxRunOffline wiki.
For instance, to install the same Ubuntu 16 from the Microsoft Windows Store, you can download the file at
https://lxrunoffline.apphb.com/download/UbuntuFromMS/16
Then, you can install the linux distribution using lxRunOffline
# lxrunoffline install -n <name> -d <folder> -f <distribution file>
C:\wsl> lxrunoffline install -n copy -d c:\wsl\copy -f 16.04.2-server-cloudimg-amd64-root.tar.gz
To run the distribution, you may use the same lxRunOffline
C:\wsl> lxrunoffline run -n copy -w
Using a DistroLauncher
You can use some DistroLauncher. There are many versions based on the Microsoft example to create custom linux distributions for WSL. For instance, you can use the Yuk7 version.
You must download a distribution file and the launcher.exe
. To use the same distribution file mentioned above, you must rename the distribution file to rootfs.tar.gz
and the launcher to the distribution name you want. Later you must run the launcher as an Administrator (I got errors running it as a normal user)
PS> ren launcher.exe mydistro.exe
PS> ren .\16.04.2-server-cloudimg-amd64-root.tar.gz rootfs.tar.gz
PS> .\mydistro
The first time you run the launcher, it installs and run the distribution. The next time, it runs the linux distribution.
After installing, you can manage the distributions using the wslconfig
or the lxrunoffline
commands.
NOTE: In addition to the distribution files mentioned above, you can create a new file based on other linux distributions. You may try the instructions included in the WSLInstall project. You may need additional steps after the installation to start the new linux correctly.
3If you're getting the error
0x80070005
, you need to run the exe file as administrator. – March Ho – 2018-11-12T20:25:10.030Do you happen to know if it is possible to install these for all users at once? – Andrew Savinykh – 2018-12-06T08:21:43.773
@AndrewSavinykh Since it is installed into whatever Path you like (e.g.
C:
), providing access (and links) for all users should not be a problem. However, I do not know how to create links for multiple users. Something alongNew-Item -ItemType SymbolicLink -Path "<USER_DIR>" -Name "<DISTRO>" -Value "<DISTRO_EXE_PATH>"
should work. – flolilo – 2018-12-06T10:31:56.1702Top instructions. Thanks. FYI: If you are like me, and unzipped the distro in a silly location the first time... You will find
wslconfig /list
andwslconfig /unregister
are your friends... – spechter – 2019-02-07T05:11:26.4471
I believe that the distribution should be extracted onto your system drive, as mentioned here: https://docs.microsoft.com/en-us/windows/wsl/install-win10#troubleshooting
– Matt Wenham – 2019-04-23T10:19:41.5131
Note: the
– Bewc – 2019-10-29T17:50:37.1770x80070005
errors pops for a lot of reasons. If you want to look for workarounds, look here: https://github.com/microsoft/WSL/issues/3020