Windows Subsystem for Linux (WSL) is a compatibility layer that allows you to run Linux distributions on Windows. By installing a WSL distribution on your physical drive, you can take advantage of the benefits of both operating systems. In this step-by-step guide, we will walk you through the process of installing a WSL distribution on your physical drive.
Step 1: Enable WSL
The first step is to enable the Windows Subsystem for Linux feature on your Windows system. Here's how you can do it:
- Open the Start menu and search for "Turn Windows features on or off".
- Click on the search result to open the Windows Features dialog.
- Scroll down and find "Windows Subsystem for Linux".
- Check the box next to it and click "OK".
- Restart your computer when prompted.
Step 2: Choose a WSL Distribution
There are several Linux distributions available for WSL, such as Ubuntu, Debian, and Fedora. You can choose the one that suits your needs the best. In this guide, we will use Ubuntu as an example.
Step 3: Download and Install Ubuntu
To download and install Ubuntu, follow these steps:
- Open the Microsoft Store on your Windows system.
- Search for "Ubuntu" in the store.
- Click on the "Ubuntu" search result.
- Click the "Install" button to start the installation process.
- Wait for the installation to complete.
Step 4: Launch Ubuntu
Once the installation is complete, you can launch Ubuntu by following these steps:
- Open the Start menu and search for "Ubuntu".
- Click on the "Ubuntu" search result to launch the Ubuntu terminal.
- Wait for the initial setup to complete. This may take a few minutes.
- Create a new username and password for your Ubuntu installation when prompted.
Step 5: Set Up Ubuntu on Physical Drive
By default, Ubuntu is installed on the system drive. If you want to install it on a different physical drive, you can follow these steps:
- Open the Ubuntu terminal.
- Run the following command to navigate to the root directory:
cd / - Run the following command to create a new directory for your Ubuntu installation:
sudo mkdir /mnt/d/ubuntu - Replace "d" with the drive letter of your choice. For example, if you want to install Ubuntu on drive E, use "/mnt/e/ubuntu".
- Run the following command to move your Ubuntu installation to the new directory:
sudo mv -v /rootfs/* /mnt/d/ubuntu - Run the following command to update the root file system configuration:
sudo nano /etc/wsl.conf - Add the following lines to the file:
[automount]
root = /mnt/d/ubuntu
options = "metadata" - Press Ctrl+X, then Y, and Enter to save and exit the file.
- Restart your computer to apply the changes.
Congratulations! You have successfully installed Ubuntu on a physical drive using WSL. Now you can enjoy the benefits of both Windows and Linux on your system.
Conclusion
Installing a WSL distribution on a physical drive allows you to take advantage of the features and capabilities of both Windows and Linux. By following the step-by-step guide provided in this article, even entry-level users can easily install a WSL distribution on their physical drive. Enjoy the best of both worlds!
References
| Number | Reference |
|---|---|
| 1 | Windows Subsystem for Linux Installation Guide |
| 2 | Ubuntu on WSL |