4 ms·
VMs each have their own kernel, but containers share the host kernel. This tends to be more efficient and doesn't require you to statically allocate vCPUs and v
by wmf 15y ago
VMs each have their own kernel, but containers share the host kernel. This tends to be more efficient and doesn't require you to statically allocate vCPUs and vRAM upfront when you create a container.
LXC also has an under-appreciated mode where you can run some processes (but not a full OS) in a container.
- dkulchenko 15y agoLXC also has an under-appreciated mode where you can run some processes (but not a full OS) in a container. Please elaborate, I'd like to try this out. I've been playing around with LXC for years, but assumed /sbin/init always had to be the root process.
- wmf 15y agohttp://lxc.sourceforge.net/man/lxc-execute.html http://lxc.sourceforge.net/man/lxc-execute.html
- dylanvee 15y agoUnfortunately I've been running into a bug with lxc-execute (https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/986956 https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/986956) that prevents it from "just working" with interactive programs such as bash or python.
- vidarh 15y ago/sbin/init never needs to be the root process in a Linux system. You will end up in a messy situation if your init replacement allow you to spawn processes without wait()'ing for children now and again (e.g. some daemons will "double fork" and wait for the immediate child to die, and then expect init to take care of the real worker later), but that's pretty much it.