Importing Previously Exported WSL Distro: Installing Ubuntu on Windows 10/11
Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10 and 11. WSL allows developers, students, and system administrators to run a genuine Linux environment directly on Windows, without the need for a virtual machine.
Prerequisites
Before installing Ubuntu on WSL, ensure that your Windows 10/11 system meets the following prerequisites:
- 64-bit Windows 10/11 version 2004 or higher
- Minimum 4GB RAM
- Virtual Machine Platform optional component enabled
Installing Ubuntu on WSL
To install Ubuntu on WSL, follow these steps:
- Open PowerShell as Administrator and run the following command:
wsl --installThis command will enable the optional component, download the latest Linux kernel, set WSL 2 as your default, and download a new Linux distribution from the Microsoft Store.
- Restart your computer when prompted.
- After the restart, open the Microsoft Store and search for "Ubuntu".
- Click "Get" to download and install Ubuntu on your Windows 10/11 system.
Importing Previously Exported WSL Distro
If you have previously exported a WSL distro, you can import it back to your Windows 10/11 system using the following steps:
- Create a new directory to store the exported WSL distro:
mkdir %USERPROFILE%\wsl\<distro>Replace <distro> with the name of the exported WSL distro.
- Copy the exported WSL distro to the new directory:
copy <exported-distro>.tar.gz %USERPROFILE%\wsl\<distro>Replace <exported-distro> with the name of the exported WSL distro.
- Open PowerShell as Administrator and run the following command:
wsl --import <distro> %USERPROFILE%\wsl\<distro> <exported-distro>.tar.gzReplace <distro> with the name of the new WSL distro, and <exported-distro> with the name of the exported WSL distro.
Launching Ubuntu on WSL
To launch Ubuntu on WSL, open the Start menu and search for "Ubuntu". Click on the Ubuntu app to launch it. The first time you launch Ubuntu, it will take some time to initialize the file system and create the user account.
In this article, we have covered the steps to install Ubuntu on Windows 10/11 using WSL. We have also covered the steps to import a previously exported WSL distro. By following these steps, you can have a fully functional Linux environment running directly on your Windows 10/11 system.