0

I've been messing around with WSL2 for a while, and I wanted to make the most profit out of it by running an X server instead of running Ubuntu on demanding Virtual Machines, so I've been following a guide on how to install gnome in wsl and run it on an X server. (https://gist.github.com/Ta180m/e1471413f62e3ed94e72001d42e77e22)

WSL Version: 1.1.3.0
Kernel Version: 5.15.90.1
WSLg Version: 1.0.49
MSRDC Version: 1.2.3770
Direct3D Version: 1.608.2-61064218
DXCore Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows Version: 10.0.19045.2604
Ubuntu Version: 22.04.1 LTS

The problem is that after configuring everything, installing gnome, and editing my bashrc file, the desktop environment ran on a different window instead of the X server that was already running, and obviously, dropped a massive white screen with an error popup. I've tried the same thing with xfce, but it still ran on a different window.

Any solutions?

  • There are several comments to the linked guide mentioning various problems. Note that the latest version is from May 16, 2021 and contains the note "I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore." See the revison history. In addition to providing the link to the instructions, I suggest to copy&paste all configuration changes you did and all commands you ran on your system including the output. Did you get any errors? [Edit] your question to provide more details. – Bodo Mar 03 '23 at 11:40

1 Answers1

0

That's going to be tough, on several levels, for several reasons.

First, as @Bodo mentioned in the comments, that guide is way out of date. WSL now includes two things that weren't available when the guide was originally written:

  • Systemd support (without the use of a third-party script)
  • WSLg, which allows you to run X/Wayland applications without the use of a third-party X server like VcXsrv.

But even with those two things, running Gnome ain't easy. There are several reasons for this under WSL:

  • Gnome expects a lot of "hardware" to be in place, and the Systemd services to manage them. WSL is running in a container (not a VM, at least not directly) which doesn't have direct access to hardware, either physical or virtual.

  • WSL runs GUI applications in a Wayland/XWayland/Weston session exposed to Windows through RDP/Rails. This makes running a separate window manager difficult, as the windows-manager is integrated into Weston, and it can't be replaced, only nested.

  • Some other nuances of how WSLg sets up the displays for both Xwayland and Wayland.

There's an answer there in the question I linked above as to how to do it, but the results still aren't, IMHO, "production-ready". I've tried twice now to post my own answer that is either easier or improves on the existing one, but I've had to delete them both times due to various issues that I've run into even after I thought they were working.

I highly recommend, for the time-being at least, continuing to run Ubuntu Desktop in a virtual machine, rather than WSL.

NotTheDr01ds
  • 17,888