Skip to content
Alistair Young edited this page Oct 16, 2021 · 2 revisions

There are certain issues that should be born in mind if one intends to run genie and WSLg together.

multi-user.target

The default target for systemd in your distro may attempt to start up various GUI/X11-related units, if they are installed. This is a concern for you, for the most part, because many X apps (GNOME apps in particular, although that may be an artifact of what is reported to me) will drag in a lot of these units in dependencies when you install them, and many of these will not work because they quite reasonably expect that your Wayland/X11 server is running in the same distribution the rest of your system is.

It isn't. (See lengthy description of WSLg architecture here for details.)

You will thus save yourself ever so much trouble if you make sure that systemd's default target is set to multi-user.target (i.e., a multi-user system without a GUI desktop) rather than graphical.target (the GUI desktop) before you do anything else. If you need specific services/units, you can then enable them manually without being blindsided by a configuration designed for the kind of Linux GUI desktop that WSLg isn't designed to be and probably never will be.

You can do this with the command, from inside the bottle:

systemctl set-default multi-user.target

Dependencies

Many graphical applications for Linux include dependencies on the GUI-implementing packages they need, most typically xwayland and pulseaudio. Since you are using WSL and WSLg, you don't need these installed in your user distro. In fact, you don't want them installed in your user distro, since at best they're just wasting disk space, and at worst, they're installing things - such as configuration files, systemd units, and so forth - that may actually interfere with WSLg's proper functioning.

Fire up equivs, as this tutorial describes, and make some dummy packages which provide pulseaudio and xwayland respectively (and, obviously, whatever other packages you find troublesome). By installing these, the dependencies will be satisfied, and you can use the applications which demand these dependencies without having to install your own useless copy of the services when you already have a perfectly working one being supplied to you by WSLg.

Source, such as it is, for my version of the dummy packages is here -- and, of course, if you just want things to work and apt is your package manager of choice, you can install pulseaudio-dummy and xwayland-dummy straight from my WSL-Transdebian repo.