Can a VM/Container be run without requiring host system libraries?

Viewed 99

Some software we have developed, we have "encapsulated it" into a virtual machine, that we run with Virtualbox, in command line in a non interactive way (no graphical interface). We send some instructions to the virtual machine, and it outputs some resulting files. We have tested this locally in a Linux machine. Now we would like to send this to many people using Linux, but we realize they will have different distributions, system libraries versions, etc, and then our VM might fail. So my question, is, it is possible to have someething like a static binary version of Virtualbox (or any other similar system / VM / Container) that does not need to use the system libraries, so that it can be run like a static binary?

2 Answers

It would be important to know what are the 'special' requirements of your solution regarding system libraries and the kind.

If you are using a standard host configuration, a standard VirtualBox install should be able to run the VM on any host OS.

Since a VM runs its own kernel, for the most part, is not dependent on host libraries. The the exception to this is when accessing/controlling host resources (disk, net, etc.). This being said, VirtualBox provides ways to access the most common resources (disk, net, etc.) that are transparent for the VM. Meaning that the VM will be configured always in the same way, regardless of whether the host is Win, Linux or Mac, and you can export your VM on Linux and importing it in other platforms without having to tweak it.

A container (eg. dockers) is more complicated, since it shares the kernel of the host, and it depends on how the host kernel is configured.

Again, if your application doesn't depend on 'special' access to host resources, a Docker will run the same way on all host OSs (Linux provides a native kernel, while Win and Mac run a linux virtual machine and then dockers inside it)

If you feel this doesn't answer your question, please share more details about the 'special' needs/configurations of your application, so we can dive deeper into this.

Have you looked at providing portable instances of the VM that can run on different host systems?

This example show how to create one for a windows host, check it out here, but I'm sure it can be done for different host systems as well.

Related