I am going to use Hyper as terminal on Windows to execute the operations described below but you can use whatever terminal you want, like PowerShell or the classic cmd.exe — as long as you run it with administrator permissions.
Chocolatey is a package manager for Windows — like brew for macOS and pacman for ArchLinux.
We'll use this package manager to install LxRunOffline: the utility which permits to install GNU/Linux distros on external disks or partitions.
In order to install the package manager, go to the official site and follow the instructions for the installation.
After the installation is over, check everything is ok by running a simple command:
I introduce you to LxRunOffline:
A full-featured utility for Windows Subsystem for Linux (WSL).
as its GitHub repo states; it offers a lot of cool features but the one we're interested right now is the one which allows us to choose external disks and partitions as destination for our distros filesystems.
It's time to use our new favourite package manager:
choco install lxrunoffline
After the installation is over, try to run LxRunOffline:
If the command is not recognized by Windows, update the PATH and re-open the terminal (with administrator permissions, don't forget it):
Check out this link for the list of distros you can install using LxRunOffline and necessary post-installation steps for each one.
I'll go for Ubuntu since it's officially supported by WSL and I like it.
Here you can find the image tarball for your machine architecture. Download it.
After the download is over, open the terminal (with administrator permissions) and proceed to the installation.
We're going to use the
install command which have the following structure:
lxrunoffline install -n DISTRO_NAME -d DESTINATION_FOLDER -f INSTALLATION_FILE
- DISTRO_NAME: is the name you use to access the distribution after the installation.
- DESTINATION_FOLDER: is the absolute path to the folder where the filesystem will be stored.
- INSTALLATION_FILE: is our tarball file which contains the distribution image.
Let see the command I ran to install Ubuntu on my system:
lxrunoffline install -n bionic -d D:\WSL -f D:\ChromeDownloads\ubuntu-bionic-core-cloudimg-amd64-root.tar.gz
LxRunOffline has a command to access a distribution.
lxrunoffline run -n DISTRO_NAME
Thanks to LxRunOffline, you are able to install distributions on external disks and partitions. It offers other cool features like distro duplication and offline distro installation — check out the GitHub repo to learn more about what you can use it for.
At the time of writing, there is no official solution for installing distros on a
disk other than
C:\ and LxRunOffline is the one who does the trick.