This guide will help you set up Ubuntu 24.04 on your Windows PC using Windows Subsystem for Linux 2 (WSL2). This setup allows you to run a Linux distribution natively on your Windows machine.
Before starting, ensure that your Windows version supports WSL2. You need Windows 10, version 2004, Build 19041 or higher, or Windows 11.
-
Download Ubuntu 24.04
Download Ubuntu 24.04 from the Microsoft Store.
-
Enable WSL2
Open PowerShell as an Administrator and enable WSL2 with the following commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
wsl --set-default-version 2
Reboot your computer and open the Ubuntu 24.04 app before following the Ubuntu instructions below.
To make PM2 restart after a reboot, you can set up a startup script:
- Open the Run dialog by pressing
Win + R
, typeshell:startup
, and press Enter. - Copy the
windows_pm2_restart.bat
file from your GitHub repository folder into your Windows startup folder.
This script ensures that PM2 restarts automatically after a system reboot. For further details, refer to the video walkthroughs linked below.
For a more detailed walkthrough, consider watching the following video tutorials:
By following these steps, you should have a fully functional Ubuntu 24.04 environment running on WSL2, allowing you to take advantage of Linux tools and workflows directly from your Windows PC.