@pycaw So I was originally writing a response to one of your comments but I kind of spiralled into responding to multiple of your comments instead. Here’s a bit of an essay addressing some of the points you made.
From: A detail step to run desktop environment in container - #28 by pycaw
Likely all can be unprivileged but why not go privileged and make some shortcuts.
There aren’t any shortcuts. There isn’t a benefit because enabling security.priviledged
, it just sets CT UID=0 == Host UID=0 [1]. Additionally, Incus expects an empty /dev
in base images and automatically creates the device nodes listed in [2]. So you’d need to passthrough /dev/dri/card*
into the instance regardless.
[1] About security - Incus documentation
[2] Container runtime environment - Incus documentation
Handling (ZFS) storage directly in the NAS for example would be more straightforward, as well as things like graphics or sound probably.
You could but I don’t see any upsides in doing so. You would also likely introduce a potential denial of service (at least for zfs
and zpool
) due to introducing an impedance mismatch between the DKMS (or akmod) kernel module and the user space utility should they ever be out of sync.
A simpler approach would be to let Incus handling the storage pools and just create a bare instance with a NFS, or Samba, server; this still requires that you install kernel modules on the host at least but those wouldn’t break your ability administer your pool.
Graphics I mentioned earlier (/dev/dri/card*
) and audio wouldn’t make too much sense if you are treating it in a remote multi-tenant scenario, remote desktop solutions should have virtual audio devices you can use instead. In a local scenario, it’s possible that you could configure multiple Pipewire sockets to route to different speakers but that isn’t something I’m knowledgeable in.
But you say you have apparmor and SELinux enabled, why do that with unprivileged containers?
Defence in depth. I think @stgraber can say more, but Linux containers (as in cgroups and namespaces) used to be quite vulnerable so it’s safer than not to layer on MAC in the event a new breakout exploit is discovered.
There’s no real disadvantage to keep MAC enabled especially if you’re doing most of your work within instances and not touching the host.
Also note that Incus automatically mounts paths listed in the “Mounts” section of [2] and I quote verbatim: “[the] majority of those paths will not be writable (or even readable) from inside an unprivileged container. In privileged containers, they will be blocked by the AppArmor policy.”
The images I used so far come with them disabled.
MAC is setup on the host, not in containers
From A detail step to run desktop environment in container - #30 by pycaw
I didn’t write about wanting to add compositor, you must have misread something.
I think their interpretation would be you creating GUI instances to use for workstations
–
From A detail step to run desktop environment in container - #31 by pycaw
Absolutely don’t give up on the idea, give it a shot and see what sticks. I found this post a while ago, you can try to see if it’ll give you an inspiration: I Built a Home Server | zacksiri.dev. Despite it being written for LXD and having a vague, it should be compatible with Incus and give some ideas as to how to handle serving as a network storage