1

Quite simple question. I am working on a project to have multiple operating systems (all linux) on the same machine using btrfs subvolumes so that the user can boot to the environment they are comfortable with. Since all of them use the Linux Kernel, can the single Kernel be compiled and used for all operating systems on the machine? Is there anything OS specific and if so, is it just the kernel modules that are required by the OS or does it go deeper than that?

My current assumption is that the kernel is quite independent of the OS and that as long as all the modules were included for both OS in the one shared kernel, they could both share the kernel and hence share updates and changes made to the kernel.

3
  • 1
    OpenVZ does this
    – tkausl
    Feb 27, 2015 at 16:25
  • Yes, I am aware of many virtualised/containerised environments that do share a kernel. But is it possible to boot on bare-metal with a single kernel for all Linux OS?
    – flungo
    Feb 27, 2015 at 16:27
  • 2
    I think you should clarify what is the difference for you between OpenVZ and what you are trying to accomplish. Because from the question and your comment, it seems to me you are pretty much describing what OpenVZ does.
    – Alex
    Feb 27, 2015 at 16:32

2 Answers 2

1

OpenVZ does exactly what you ask for.

It creates containers that are 100% independent from one another but shares the same modified kernel.

The only drawback versus full virtualization is that you cannot install anything other than Linux when using containers.

1

OpenVZ is great and provides a secure, stable, and easy to use solution for containers. However, there is also Linux Containers which are built into Linux and a lot of progress has been made in recent kernel releases.

Linux containers have many user space utilities you can use including lxc, vzctl (from OpenVZ), libvirt, and docker.

Linux containers allow you to run processes (and users if you use user namespaces) in separate namespaces. This gives the feel of a separate system running on the same kernel and allows you to add restrictions to resources using cgroups. Linux containers are extremely lightweight compared to hardware virtual machines like Xen, Qemu/KVM, or VMWare.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .