Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 254
Open the way Avatar asked Feb 22 '20 16:02

Open the way


People also ask

Do containers use the host OS?

A container uses the kernel of the host OS and has operating system dependencies. Therefore, containers can differ from the underlying OS by dependency, but not by type. The host's kernel limits the use of other operating systems. Containers still do not offer the same security and stability that VMs can.

Does container need OS to run?

Since containers share the host OS, they do not need to boot an OS or load libraries. This enables containers to be much more efficient and lightweight. Containerised applications can start in seconds and many more instances of the application can fit onto the machine as compared to a VM scenario.

Can you run containers on a VM?

You can run containers on virtual machines (VMs), bare metal, or both. But what one is better? The debate over whether to use containers on virtual machines or bare metal really comes down to speed and efficient use of hardware resources versus isolation and ease of portability.

Which of the following is true regarding containers and virtual machines?

This is Expert Verified AnswerContainers and virtual machines are two different methods of deploying isolated and multiple services on the same platform. Containers have lesser overheads than virtual machines and offer service isolation only between containers.


1 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.

like image 89
matus Avatar answered Sep 30 '22 16:09

matus