1
  • WSL Version: 1.0.3.0
  • Ubuntu Version: 22.04.1 LTS

Vcxsrv is still black.

I added export DISPLAY=:172.X.XXX.X:0.0 in my .bashrc file.

When I run the command, sudo startxfce4, I have this message:

(xfwm4:4818): xfwm4-WARNING **: 15:06:25.234: Could not find a screen to manage, exiting

(xfsettingsd:4826): libupower-glib-WARNING **: 15:06:25.308: Couldn’t connect to proxy: Could not connect: No such file or directory xfsettingsd: Another clipboard manager is already running.

(xfsettingsd:4826): xfsettingsd-WARNING **: 15:06:25.656: Failed to get the _NET_NUMBER_OF_DESKTOPS property.

NotTheDr01ds
  • 17,888
zelou
  • 11

1 Answers1

2

A few problems to solve:

  • First, you are attempting to run startxfce4 using sudo. This is a problem because (a) you really don't want to run your desktop as root, and (b) sudo by default doesn't pass environment variables from your user to the sudo session, so there's no DISPLAY set.

  • Second, even if you run as your normal user, Xfce4 will see the WAYLAND_DISPLAY variable that WSLg provides and will refuse to run since Wayland on WSL is provided by Weston, which provides its own window manager (see this answer for details).

I was able to get Xfce4 running with a full-screen VcXsrv session using the following:

  • Run Xlaunch with "One window without titlebar", "Start no client", and "Disable access control".

  • In Ubuntu:

    export DISPLAY=$(hostname).local:0
    export WAYLAND_DISPLAY=
    startxfce4
    

    The export DISPLAY form that I use there works regardless of the IP address of WSL, the WSL2 network switch, or Windows itself. It does require that you use the built-in WSL2 resolver, however.

  • This will probably also require a firewall rule. Typically, Windows Defender will generate a dialog box asking you to approve or deny the connection the first time it is used. If you've made a connection in the past, then this rule may have been created for you. However, if you missed the dialog box (it sometimes pops up behind other windows), then a "deny" rule may have been put into place that you'll need to fix.

NotTheDr01ds
  • 17,888