Proxmox LXC and KDE

Hi, has anybody been able to run KDE on an LXC (Proxmox)?

I can run a VM just fine, and NixOS also runs fine. But can’t seem to get to a graphical interface. Is this a limitation of LXC?

These are the pertinent parts of :

imports =
[
(modulesPath + "/virtualisation/proxmox-lxc.nix")
];
boot.isContainer = true;

# Enable the X11 windowing system.
services.xserver.enable = true;

# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;

# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
autorun = true;
};

# Enable automatic login for the user.
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "user";

Are you possibly lacking a remote desktop protocol?

It is not referenced anywhere (at least can’t find any mention), but it seems that running lxc console <vm name> --type=vga does imply that some SPICE server is running:

To start the VGA console with graphical output for your VM, you must install a SPICE client (for example, virt-viewer or spice-gtk-client ).

You may then setup any remote desktop protocol server within the NixOS VM and access it via matching client.
https://nixos.wiki/wiki/Remote_Desktop

e.g with xrdp (VM), works with remmina (client):

{
  services.xrdp = {
    enable = true;
    openFirewall = true;
    defaultWindowManager = "startplasma-x11";
  };

  services.xserver = {
    enable = true;

    displayManager = {
      sddm = {
        enable = true;
      };
    };

    desktopManager = {
      plasma5 = {
        enable = true;
      };
    };
  };
}

Some examples: GitHub - JimJ92120/nixos-remote-desktop-for-lxd: Demonstrate how to build and run a NixOS Desktop as a container for LXD.

Thanks for the information! I may end up going that route. What I was trying to attempt though is using the HDMI output from the host where the LXC is running. The monitor would then display the NixOS’ LXC’s desktop environment, KDE in my case.

You may investigate a different solution if e.g you would need “performance” from the desktop environment. Maybe re-route the desktop instance video output to the host HDMI?

I got an environment with KDE, using Remmina, can also span on multiple monitors (got 3), no issue! - beware of possible wayland and x11 shenanigans