Windows 10
Windows 11
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).
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:
control panel and press Enter. wsl to see if WSL is installed and running.Step 3. Confirm WSL version 2 is running
wsl --statuswsl --set-default-version 2wsl -l -vwsl --set-version Ubuntu 2Step 4. Run your application. See Opening Linux apps stored in Windows via Ubuntu.
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.
export DISPLAY=:0.0
# or export DISPLAY=:0
export DISPLAY=$(hostname).local:0This uses mDNS to obtain the correct address.
DISPLAY setting: export DISPLAY=:0Note that this is set for you automatically in your Ubuntu/WSL2 session by the WSL
/init, so there shouldn't be any reason to set it manually except in some special circumstances.export DISPLAY=:0Note 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.
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>