Installing Two WSL Instances (Non-C Drive Point Instance) - Tech Support
In this article, we will cover the process of installing and configuring two WSL (Windows Subsystem for Linux) instances on your Windows machine, specifically focusing on non-C drive point installations. By following these detailed steps, you will have Ubuntu 22.04 and Ubuntu 20.04 up and running in no time.
What is WSL?
The Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. It allows developers, system administrators, and users to run a genuine GNU/Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine.
Installing WSL on Windows
To begin with, enable WSL on your Windows machine by following these steps:
- Press Windows + X and open the PowerShell (Admin) or Command Prompt (Admin).
- Run the following command:
wsl --install - Restart your PC once the installation is complete.
Installing Ubuntu 22.04 and Ubuntu 20.04
Now that we have WSL enabled let's install Ubuntu 22.04 and Ubuntu 20.04:
- Open the Microsoft Store and search for Ubuntu 22.04 and Ubuntu 20.04.
- Click Get next to each, and let the installation finish. This may take a few minutes.
You will find the installed Linux distributions for WSL in the Windows Start Menu.
Configuring Non-C Drive Point Instances
By default, WSL installs to the C drive. However, if you prefer to install it on a different drive:
- Close any running WSL instances.
- Open the terminal with the Linux distribution you would like to customize (e.g., Ubuntu 22.04).
- Stop the WSL service using:
wsl --shutdown - Create a new folder on your desired drive:
mkdir D:\wsl-installs\ubuntu-22-04 - Create the default WSL file system:
wsl --import Ubuntu-22-04 D:\wsl-installs\ubuntu-22-04\ \path\to\installation\file.tar --vfs-caching automatic - Set the newly created system as the default:
wsl --set-default Ubuntu-22-04 - Restart the WSL service:
wsl --start Ubuntu-22-04
Accessing WSL Instances
To access your WSL instances, just search for the Linux distribution on the Windows Start Menu and click on the icon to open it.
- We enabled WSL and installed Ubuntu 22.04 and Ubuntu 20.04 on Windows.
- We demonstrated configuring non-C drive point instances of the two WSL instances.
- You learned how to access your installed WSL instances.
References
- Pro Linux System Administration. Mantei, J. (2021). https://www.amazon.com/Pro-Linux-System-Administration-Essentials/dp/111962169X
- "Get Started with Windows Subsystem for Linux (WSL)". Microsoft Docs, https://docs.microsoft.com/en-us/windows/wsl/install-win10
- "Windows Subsystem for Linux (WSL) Documentation". GitHub, https://github.com/microsoft/wsl