LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-26-2024, 09:22 AM   #1
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,181

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Unprivileged LXC -- opinions?


Hi all.

Back to Slackware after a prolonged absence. Health issues -- my own and serious illnesses among family members too. Still affecting us all but life must go on.

I'm about to get a VPS and I'm in two minds whether to install NetBSD 10 with Xen or Slackware 15 with unprivileged containers. I don't have any experience with the latter. Is it secure? Stable? Space constraints on the server make LXC more attractive, since I wouldn't have to second guess how much space to assign, as I would with full-blown virtual machines like Xen. And as far as I can tell the containers run fully unprivileged in $HOME. Thanks by the way to Chris Willing for the great instructions and information covering all this.

I would prefer also to connect a dummy network interface on the host to the bridge instead of connecting the physical interface. My memory is a bit rusty here, and it seems Slackware has a way of setting up a bridge in rc.inet now. Is tun/tap still the way to set up virtual or dummy interfaces? Obviously I would enable routing to the external interface. I would also firewall on the external interface. Don't ask why : I just never liked bridging the physical interface.

Last but not least, I hope to encrypt all but the boot partition. The host, that is ; I won't be encrypting guests. The VPS host provider tells me their machines are BIOS boot, so I don't anticipate too many problems. Thanks to those involved for the excellent write up on LUKS + LVM too.

I'm looking forward to doing this. It's a small project, 90 percent for personal use but there will eventually be a container serving web content for my brother. So security and stability are vital.

Looking forward to your views and opinions.

Last edited by Gerard Lally; 04-26-2024 at 09:25 AM.
 
Old 04-26-2024, 10:17 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,183

Rep: Reputation: 237Reputation: 237Reputation: 237
Containers do have more interesting flaws than KVM accelerated VMs. Both are secure for casual use and insecure if security is to be considered.

I use both qemu and apptainer. With qemu it is not strictly necessary to preallocate disk space. The 9p shared directory could be used for both /home and the operating system.

Qemu has optimized shared directory that approaches memory bandwidth, contrast to the shared folder of VirtualBox, which descended its code from ancient versions of qemu and is ten times slower.
 
2 members found this post helpful.
Old 04-26-2024, 11:37 AM   #3
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,181

Original Poster
Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by guanx View Post
Containers do have more interesting flaws than KVM accelerated VMs. Both are secure for casual use and insecure if security is to be considered.

I use both qemu and apptainer. With qemu it is not strictly necessary to preallocate disk space. The 9p shared directory could be used for both /home and the operating system.
Interesting. I hadn't heard of either apptainer or 9p. I wonder why apptainer isn't as well-known as Docker.

Curious to know what the flaws in LXC might be. I have read that LXC is not as secure or stable as full-blown virtualisation, but I imagine that's down to the likes of Debian, Ubuntu and Fedora making their own "improvements" to upstream. I imagine that isn't true of Slackware.
 
Old 04-26-2024, 05:08 PM   #4
alex14641
Member
 
Registered: Feb 2016
Distribution: Slackware64_14.2, Slackware 15.0, Slackware64_current
Posts: 322

Rep: Reputation: Disabled
Quote:
Originally Posted by Gerard Lally View Post
Hi all.

Looking forward to your views and opinions.
I've been using LXC unprivileged containers for years with no issues, with non-Slack distros.
LXC handles all the network/bridge setup. If you want to run non-Slack(systemd) distros with networking that starts with the container, you'll need patches to rc.elogind, and some additional scripts.
 
2 members found this post helpful.
Old 04-27-2024, 12:03 AM   #5
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,183

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by Gerard Lally View Post
Interesting. I hadn't heard of either apptainer or 9p. I wonder why apptainer isn't as well-known as Docker.

Curious to know what the flaws in LXC might be. I have read that LXC is not as secure or stable as full-blown virtualisation, but I imagine that's down to the likes of Debian, Ubuntu and Fedora making their own "improvements" to upstream. I imagine that isn't true of Slackware.
Apptainer was renamed from "singularity" only recently while joining the Linux Foundation:
https://www.linuxfoundation.org/pres...g-environments

LXC/Apptainer/Docker etc. lightweight virtual machines (or containers) and the host environment share the same kernel. Hardware flaws related to protected mode and kernel software flaws are vulnerable.

For a guest machine to break qemu-kvm, it is usually necessary to take advantage of hardware flaws before the host is exposed, such as hardware flaws like Zenbleed, Spectre, and those related to hardware virtualization. I'd say usually because in the cases where, for example, guest data goes through VFS of the host, host filesystem bugs are vulnerable. Another example is the guest stalling the SLUB of the host on machines with large memory (Slackware defaults to SLUB instead of SLAB).

Seriously, I'm not security expert so I might well be wrong.

Last edited by guanx; 04-27-2024 at 12:07 AM.
 
1 members found this post helpful.
Old 04-28-2024, 09:05 AM   #6
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,181

Original Poster
Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by alex14641 View Post
I've been using LXC unprivileged containers for years with no issues, with non-Slack distros.
LXC handles all the network/bridge setup. If you want to run non-Slack(systemd) distros with networking that starts with the container, you'll need patches to rc.elogind, and some additional scripts.
Good to know. I don't think I'll be running systemd distros, although I might run a kvm NetBSD guest in parallel, which I think is possible.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network help with unprivileged lxc containers on -current Rinndalir Slackware 6 09-10-2015 11:59 AM
[SOLVED] LXC unprivileged container in Debian Jessie - Cgroups permissions? matiasar Linux - Kernel 6 06-07-2015 12:17 PM
Unable to start unprivileged Lxc container on Debian Sid hurd Debian 0 02-02-2015 10:45 PM
LXC unprivileged container - operation no permitted gauthig Linux - Virtualization and Cloud 2 07-15-2014 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration