Score:0

WSL2 doesn't recognize XServer and runs desktop environments on its own

ec flag

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?

Bodo avatar
pt flag
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](https://gist.github.com/Ta180m/e1471413f62e3ed94e72001d42e77e22/revisions). 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.
Score:0
vn flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.