this post was submitted on 04 Mar 2024
45 points (90.9% liked)

Linux

48328 readers
502 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm used to using Linux from the terminal. I have a new machine which I plan to use mostly headless but would occasionally like to run a desktop environment and play games with GPU acceleration. I know I don't have to launch the desktop environment on startup, but I was wondering if it's possible to have that entire portion containerized, like an instance in LXD.

I am trying Bazzite right now, I really like the idea of layering on top an immutable base. That's close to what I want. If I understand correctly, I could have a different layer for the headless part to keep them totally separate, but I'd have to do restarts to switch from one to the other.

I also think NixOS could also be what I want, just with a steeper learning curve.

I'm wondering if anyone has already set something like this up? It would be helpful to read about what software people have for this and their experiences using that.

top 19 comments
sorted by: hot top controversial new old
[–] GravitySpoiled@lemmy.ml 11 points 8 months ago (1 children)
[–] jkrtn@lemmy.ml 3 points 8 months ago

This is really cool. I think this is very close to what I want, but am I correct in understanding the host also has an X11 server in this setup? I'll have to check out distrobox, that's an interesting tool.

[–] flashgnash@lemm.ee 11 points 8 months ago* (last edited 8 months ago) (1 children)

Have you ever heard of qubes os? The idea of it is absolutely every system component is containerised

I'm sure if anything has a way to achieve what you want it's that

[–] scratchandgame@lemmy.ml 2 points 8 months ago (1 children)

Qubes os does not run xfce in a vm I think?

It actually run everything in a vm, not a container.

[–] flashgnash@lemm.ee 1 points 8 months ago

Depending on the use case I don't think it really makes much difference

I'm not sure whether it can specifically containerise the DE but it's worth investigating I think

[–] anamethatisnt@lemmy.world 5 points 8 months ago

Never tried doing LXC for it but with kvm/qemu you can use vfio and pcie passthrough if you don't need the gpu in your headless server.
https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF

[–] evanstucker@lemmy.ml 5 points 8 months ago (1 children)

At work the only option I had was to get a Macbook, but I don't like MacOS, so I installed UTM and I run Arch Linux (ALARM for aarch64) as my desktop. It's functional, but of course I'd rather have a beat up, 5 year old Dell or Thinkpad so I could just run Arch natively.

[–] AzzyDev@beehaw.org 6 points 8 months ago (1 children)

You could try Asahi Linux, they’ve been doing lots of work getting Fedora working nicely on the new ARM macbooks :)

[–] Kidplayer_666@lemm.ee 2 points 8 months ago

Can confirm! Proud M1 user of Fedora asahi remix! Check out asahilinux.org!

[–] Rekindle5414@lemmy.ml 3 points 8 months ago
[–] federalreverse@feddit.de 3 points 8 months ago

I am not using it, but you can also try Opensuse Kubic. The twist here is that you don't get a completely immutable ISO-type base installation but rather you have an at-boot updateable/customizable base installation image that can't be changed while the OS is running.

[–] matcha_addict@lemy.lol 2 points 8 months ago (1 children)

What are your goals? What's the motive to containerize? Is it security?

Do you specifically need a full DE, or are you okay with something more lightweight like a window manager or kiosk mode display?

[–] jkrtn@lemmy.ml 3 points 8 months ago

That's a good question. Security is a factor. I like the idea of a containerized DE so I can easily back up and restore changes independently of the distro beneath. Or like totally abandon one, try something new, and still have the first setup available. I think a container could be portable from system to system, maybe less of a burden migrating to a new machine?

I also think it would be interesting :)

My objective with the DE is to be able to play GPU accelerated games and browse the web. I'd be fine with a simpler software than a full DE if I could do that.

[–] humanplayer2@lemmy.ml 2 points 8 months ago

Maybe Vanilla OS will be of interest?

[–] LeFantome@programming.dev 2 points 8 months ago (1 children)

You cannot run a GUI in LXC / LXD. If somebody thinks otherwise, please point me in the right direction as I would love this on Proxmox.

Distrobox sounds very close to what you want. You can run the DE and your GUI apps in a container. I think you still need a window server ( Wayland or X11 ) locally though I believe.

You can see your VMs in a web browser ( like Proxmox does ). Again though, the GUI for that has to be hosted in something else.

The other option is to use QEMU and display to SDL. You can do that without a native window server. That is more virtualized than a native window server but now we are starting to add overhead that may not be necessary.

There are some pretty small Wayland compositors and you can start them from the command line. Velox is just a few megs I think. You do not need a graphical login manager. All you need is a compositor and you can run distrobox from there.

[–] moonpiedumplings@programming.dev 1 points 8 months ago* (last edited 8 months ago)

You cannot run a GUI in LXC

It's probably possible, especially considering lxc can run systemd nowadays, and I can find many sources on this, for GUI and for GPU acceleration (but not in proxmox):

https://stgraber.org/2017/03/21/cuda-in-lxd/

https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/

And then there are also technologies like KasmVNC which can serve a GUI as a website, and it doesn't need a GPU at all.

EDIT: Two year old guide, but a redditor pulled it off

[–] possiblylinux127@lemmy.zip 0 points 8 months ago (1 children)

That's probably not a good idea

[–] jkrtn@lemmy.ml 1 points 8 months ago

I get that it could be a PITA to achieve / not worth the effort, but otherwise I think it is a great idea.

[–] wargreymon2023@sopuli.xyz -2 points 8 months ago

sound like you want virtual machine.