Linux loves Windows
Year of the Linux desktop (on Windows)
Running graphical applications is impressive, so the next step is to try and run a complete desktop. What are you waiting for?
G etting an actual Linux desktop running on WSL 2.0 on Windows 11 proved a little tricky. In fairness, WSL was built to run applications, not to act like a conventional virtual machine. It’s not really surprising that Gnome and KDE won’t work.
They rely on all sorts of daemons and services running in the background holding all the components together. Brave souls have managed to get the Xfce desktop working nicely on Windows 10 with Ubuntu 18.04, but this didn’t work for us on Windows 11 with Ubuntu 20.04. If you’re running Windows 10, then you’d be well advised to try out running Xfce via the X410 server. It should be a matter of
$ sudo apt install xfce4
and then setting the DISPLAY environment variable correctly. A major change in WSL 2 is that 127.0.0.1 in WSL doesn’t refer to the real loopback interface in Windows (where the X410 server would be listening). So we need to figure out the WSL address and update DISPLAY accordingly. Per the instructions at https:// x410.dev/cookbook/wsl/using-x410-with-wsl2this can be gleaned from /etc/resolv.conf on WSL, and then all that’s left is to tell X410 to allow “Public” connections. You’ll probably want to use Windows Defender Firewall to restrict this (if your machine isn’t otherwise firewalled). Then run xfce4-session within WSL.