Displaying Linux apps in Windows with Ubuntu Running Linux GUI's in Windows requires WSL and either WSLg (Included with the latest release of WSL2) or a third-party X server (such as VcXsrv). Using WSLg Step 1. Install WSL either from the Microsoft Store or by running the following command in PowerShell: wsl --install If you installed from the MS store, make sure to run wsl --update then wsl --shutdown afterwards Step 2. Enable WSL: - Open Control Panel:
- Press the Windows key + R to open the Run dialog.
- Type
control panel and press Enter. - Navigate to Programs and Features:
- In the Control Panel, click on Programs and then Turn Windows features on or off.
- Enable WSL and Virtual Machine Platform:
- In the list of Windows features, check the boxes for:
- Windows Subsystem for Linux .
- Virtual Machine Platform .
- Apply Changes:
- Click the OK button.
- The system will search for required files and apply the changes.
- Restart Your Computer:
- Restart your computer as prompted.
- Install a Linux Distribution:
- Once restarted, you can install your preferred Linux distribution (e.g., Ubuntu) from the Microsoft Store.
- Verify Installation (Optional):
- Open a command prompt or PowerShell and type
wsl to see if WSL is installed and running. Step 3. Confirm WSL version 2 is running - Open PowerShell and type the following commands:
- Check the version
wsl --status - If needed, update version
wsl --set-default-version 2 - Check the distribution is using the correct version
wsl -l -v - If needed, update the distribution (replace Ubuntu with whatever distro you are using)
wsl --set-version Ubuntu 2 Step 4. Run your application. See Opening Linux apps stored in Windows via Ubuntu. Using a third-party X server After installing and launching the server, you will need to set the DISPLAY environment within Ubuntu to generate any GUI elements: For completeness, I'll also cover WSL1, even though WSL2 is the standard for modern Windows. WSL2 WSL1 - For both Windows 10 and 11:
Under WSL1, Ubuntu itself is running under the same network as Windows, so in that case, you'll use: export DISPLAY=:0 Note that you will need a third-party X server with WSL1, regardless of whether you are running Windows 10 or 11. WSLg is only supported under WSL2. Opening Linux apps stored in Windows via Ubuntu You must traverse the directory to the Windows drive in Ubuntu before opening any files contained therein. Use the following command from your home folder: cd /mnt/< windows drive letter> |