Testing software on multiple platforms is important for programmers. However, managing multiple virtual machines is time consuming and inefficient. Fortunately, if you are using Windows and need to run a Linux distribution, the Windows Subsystem (WSL) for Linux provides a streamlined solution. WSL allows developers to run Linux or GNU environments directly on Windows and provide Bash terminals without the need for a full virtual machine or dual boot setup. This makes it a lightweight, resource-efficient option.
Read more: How to install PHP 8.4.3 on Windows 11?
Installing WSL and running Linux on Windows 11
Below is a step-by-step guide to installing WSL and running Linux on Windows 11.
Step 1: Open the Windows port
- In the taskbar[スタート]Right-click on the button and[Windowsターミナル(Admin)]Select .
- Alternatively, click the search icon and enter Windows Terminal. From the menu on the right, select Run as Administrator.
- You can also use PowerShell to install. Search for “PowerShell” and select “Run as Administrator.”
Step 2: Install WSL
In a terminal or PowerShell, enter the following command to install WSL:
wsl --install
Once the installation is complete, Windows will ask you to restart your computer.
Step 3: Reboot your PC
[スタート]Click the button to turn it on and select Restart. Alternatively, press Alt + F4 and select Reboot from the options.
Step 4: Install the Linux distribution
After restarting, restart the terminal or PowerShell. Now you can run it to install the Linux distribution.
wsl --install -d
for example:
- To install Kali Linux, type:
wsl --install -d kali-linux
wsl --install -d Debian
Step 5: View available Linux distributions
To view a list of all available Linux distributions, run one of the following commands:
wsl --list --online
or
wsl-l-o
Step 6: Set up your Linux distribution
When the distribution finishes downloading, a new window will open. You will be prompted to create a username and password. Once you enter these details, you are ready to use Linux on Windows.
Step 7: Update your system
It is highly recommended to run and update the system after installing the selected distribution.
sudo apt-get update
This will ensure your installation is up to date and available.
The Windows Subsystem for Linux (WSL) is a powerful tool for developers who need to run Linux environments on Windows without the overhead of virtual machines or dual boot setups. Follow the steps above to easily install WSL, set up your preferred Linux distribution, and start using Linux directly on Windows 11. Development and testing. Once installed, don’t forget to update your Linux distribution to ensure optimal performance and security. WSL allows you to enjoy the best of both Windows and Linux on a single machine.