The Windows Subsystem for Linux (WSL) is installed using the "Turn on or off Windows features" wizard. After turning this feature on, when invoking Bash For Windows for the first time, it claims to be downloading software from Microsoft Store. Is it possible to create some bundle containing all necessary files for WSL installation and make Windows install WSL using these files in an environment with no internet connection? If so, How?
Linux – Is it possible to install WSL with no internet connection
windows 10windows-subsystem-for-linux
Best Answer
Installing a Linux Distribution without internet connection
You can (1) download the installer from the Windows Store or (2) download a distribution file and install it using tools such as lxRunOffline. If you have the distribution file you can make the installation copying the files using a USB drive or something else.
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
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.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
Then, you can install the linux distribution using lxRunOffline
To run the distribution, you may use the same lxRunOffline
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
. You must rename the distribution file torootfs.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)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 thelxrunoffline
commands.