Run KDE instead of Gnome in appvm

Is it possible to configure the Fedora templates to run KDE as their desktop instead of Gnome?

The primary reason I need this is that I want to run KDE Connect in an appvm, and the minor reason is that since I’ve changed dom0 to kde and the dialog boxes (file chooser, etc) look wrong because they are rendered by Gnome.

Hello.
The default desktop environment in Qubes is Xfce and it runs in dom0. There are other options supported by the community:
KDE - https://www.qubes-os.org/doc/kde/
awesome - https://www.qubes-os.org/doc/awesome/
i3 - https://www.qubes-os.org/doc/i3/
but I guess the latter are (tilling) window managers directed at experience users. I never tried KDE, but it can be installed in dom0

Either way, you can instal a “native-KDE” app in the template (or gnome app) independently for main (dom0) desktop manager.

There are other options: You can install a standalone VM from some distribuition ISO, just like any other OS instalation on a physical PC, but then you lose features like file copy and clipboard copy/paste between VMs - and that is in most use cases, very inconvenient.

Hope this helps

What I was hoping for is somebody who knows about the internal details of how the fedora templates are configured.

There must be a script somewhere that tells the vm to start the Gnome desktop. If I knew where it was I could try modifying it to make it start KDE instead to see what happens.

It would also help to know the names of the agent daemons that are running for clipboard, usb sharing, file copy, etc. Do those agents strictly require Gnome to be running or will the work in a KDE environment?

The desktop environment in run in dom0. You can install it by typing:

$ sudo qubes-dom0-update @kde-desktop-qubes

in dom0 terminal.

But, probably for what you want, you can use regular Xfce, and go to System Tools --> Session an startup --> Advanced and select Launch KDE services on startup. Hope it helps.

Yes, I already have dom0 configured how I want. That’s not the issue.

I know that Gnome is running inside the appvms because when I run applications, even Qt-based applications, I get Gnome-style widgets.

Also gnome-tweaks works in the appvm so there absolutely is a Gnome DE running inside the virtual machine that is independent of the DE running on dom0.

This is not strictly true. There is actually a layering of desktop
environments in Qubes. If one is to use KDE in dom0, then it also makes
sense to switch templates to KDE as well, if consistent appearance is
important.

In debian-10, which is what I normally use, the ‘tasksel’ program makes
it pretty easy to switch a template to KDE. But be aware that it doesn’t
uninstall the Gnome/Xfce stuff so you’ll have to do that manually if you
want to save the disk space.

Once KDE is installed and you stop the template then start appvms based
on it, you can run the ‘systemsetting5’ control panel to change things
like color palette.

1 Like

It’s good to know this is possible for the Debian templates.

I wish the way in which Qubes modifies stock Fedora environment was documented somewhere so that I can do the same for the that template.

Having correct color pallets would be great, but the biggest pain point I have right now is that even KDE-native apps like KDevelop are stuck with the awful Gnome-style file dialogs.

Not being allowed to type a filename / path in a file open dialog is such a enormous loss of functionality that it almost outweighs the security improvement of using Qubes.

I would also like to use KDE in AppVMs. One important reason for me is the networkmanager systray applet. I can’t get the VPN connection to my employer to work with nm-applet as provided by gnome, but have it working perfectly on a non-qubes linux with KDE. I managed to add “network-manager” to an AppVM’s services, so that the “nm-applet” starts automatically. Now I would like to have that replaced with the KDE version. Any ideas how that might be possible?

No, You can’t change appearance in systemsettings. KDE systemsettings saves it’s configuration in ~/.config/kdeglobals and settings in this file are ignored or overriden somehow.
I’m stuck with KDE apps having an adwaita style (that is the Gnome compatibility style for KDE). It doesn’t matter if I choose breeze - the default or any other. And this behavior is common for both fedora-33 and debian-11 templates.

Sorry, I failed to mention you have to set a system environment variable for the VM to utilize the KDE settings. Create a file ‘/etc/profile.d/qt5.sh’ in the template and add the following to it:

XDG_CURRENT_DESKTOP=KDE

This worked for me in Qubes 4.0. But in Qubes 4.1 I think it might not be necessary to add the variable, only to install KDE and uninstall Xfce/Gnome.

1 Like

@tasket
Could you please clarify whether this is the only additional step required to get KDE-native apps looking as they should? I’m experiencing the same issues as several users above me, even after following the instructions in your last post.

Overall, in a fresh Debian-10 template I installed the Plasma desktop packages using tasksel and then make the file ‘etc/profile.d/qt5.sh’ with the line you wrote, but find that I am still stuck with (what I believe to be) the older gnome compatibility style. Any other suggestions on how to get it looking like a proper KDE setup? Thanks much!

Edit: I am using Qubes 4.0

For anyone who is finding this topic in the search, the right way to switch desktops in Fedora is the “switchdesk” application.

However running “switchdesk kde” is a bad idea because that bricks the vm.

The next time you try to start the vm you can’t open any windows and will get some long notification about “override_redirect” and even if you use qvm-run to try to switch it back via “switchdesk gnome” it won’t fix the problem.

As far as I can tell there is no way to recover and you just have to throw the vm away and re-create it. Hopefully you have backups.

@tasket @granular

You should export the variable:

sudo echo 'export XDG_CURRENT_DESKTOP=KDE' > /etc/profile.d/qt5.sh