Monday, August 29, 2022

Runing Ubuntu with full GUI on Windows 10 WSL

 While I did not find the way to run a full-blown ubuntu-desktop I ended up with a nice lightweight LXDE Ubuntu GUI.


If Ubuntu app is not already installed on your computer download it from Microsoft Store.

Run the app and type in the terminal:

sudo apt update

sudo apt upgrade -y

sudo apt install lxde


Now you have to install X server for Windows to make it work. Install VcXsrv freeware.

Set DISPLAY and LIBGL_ALWAYS_INDIRECT values in your Ubuntu terminal. You can later add them both to ~/.bashrc to make this change permanent:

export DISPLAY="$(grep nameserver /etc/resolv.conf | sed 's/nameserver //'):0"

export LIBGL_ALWAYS_INDIRECT=1


DISPLAY=:0 is not enough! (here is some more info) Ubuntu app and Windows have different IP addresses so we have to specify the correct IP for the X-server.


Run X-server on Windows: VcSrv installs as XLaunch. Select "One Large Window" and "Display": 0.


Keep the default "No client"


IMPORTANT: Select "Disable access control" checkbox


Click Next and then Finish buttons. You should get a blank window. Now in your Ubuntu terminal run:

startlxde &


You will get a "No session" dialog. It is fine, just hit "OK" button. And voila! - the full desktop appears



You can now run a terminal, Firefox, and install any Ubuntu app you want.