Set up X window manager on RHEL under WSL
I'm running RHEL 8 under WSL in Windows 10, and want to use X11 GUI. I can't upgrade to Windows 11, so I can't take advantage of the Win 11 solution to GUI for WSL.
I have set up an X server (vcxsrv, running in "one large window" mode) on Windows and can run apps like xterm and they display as expected.
I can run a window manager like metacity or kwin, and it will decorate the xterm with a title bar etc., but there is no background menu on the X desktop. I've searched a lot but can't seem to find how to set up a window manager from nothing. I have used X a lot in the past, and it's always a bit different for every new context, and I don't remember the details.
I installed metacity and kwin using sudo yum install metacity kwin
. Hopefully there's a simple way to set up a new basic user enviroment but I can't find the proper incantations. Everything I find is for setting up Linux with a monitor or some other context that doesn't apply (and usually has things implicitly installed that is not the case for me.)
I tried metacity and kwin because they're supported according to RHEL docs: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/s2-x-clients-winmanagers .
The man page for metacity says "Metacity configuration can be found under Preferences->Windows (etc) on the menu-panel." Yes, if there was a menu-panel, but there isn't.
I'd just like a basic setup with a few default apps (like xterm) and that I can tailor to my purposes. I'd also like multiple virtual screens, one visible at a time.
The background isn't provided by the window manager; it's provided by the X server. Specifically, the background in X is usually called the "root window", and you're currently running vcxsrv in "rootless" mode – rootless is what most people running X on Windows expect.
I installed VcXsrv and it seems to have an "XLaunch" launcher like Xming, asking you to choose the operating mode. In this dialog, "Multiple windows" enables rootless mode – instead; you want to choose one of the other three.
The menu panel is also not provided by the window manager in this case. It is with some window managers (such as GNOME Shell or Enlightenment), but not with Metacity – remember that Metacity was the window manager for GNOME 2, in which the panel was a separate app literally called gnome-panel
. If you have MATE installed for the "traditional GNOME look and feel" it will have mate-panel
, and similarly Xfce4 has xfce4-panel
.
Same goes for desktop icons, which are drawn by xfdesktop4
in Xfce4, by Nautilus in GNOME 2 (aka Caja in MATE), and so on. The equivalent for KDE Plasma is probably the plasmashell
which handles both the taskbar and the desktop in a unified way. (On the other hand, Enlightenment has it all as a built-in part of the WM.)
Probably the reason you don't "automatically" have panels and icons is because Metacity was not meant to be used as a standalone window manager – it was always a component of the GNOME desktop, which would be launched through a "session manager" that knows about all necessary components that need to be started.
That is, normally you would run mate-session
or startplasma
or xfce4-session
and that would launch the window manager, the desktop, the panel, the panel applets, the user-defined custom startup applications, etc. (Another task of the session manager is telling apps to prepare for an imminent logout/shutdown.)
There are window managers more suitable for standalone usage; e.g. Openbox adds a right-click menu to the desktop for launching applications so you can survive without menu panels, although it works nicely with gnome-panel as well. Usually those window managers do have their own "startup" command list and don't use a separate session manager, but it remains up to you to assemble the entire kit.