+86-135-5029-3426 sales@vinchin.com
Vinchin Blog
Vinchin Blog What is the difference between a container and a virtual machine?

What is the difference between a container and a virtual machine?


For these two virtualization methods, file systems with all operating systems can be observed. However, in the docker container, such as CentOS 5. X, if I execute uname - A in the shell of the container, the output shows my host kernel version. How does it work and what is its main difference from traditional virtual machines (VMware, VirtualBox, Xen, etc.)?

Both methods allow multiple operating systems to run on a single physical machine.

For containers, these operating systems are isolated (they have their own file systems, processes, libraries, including libc, IP address, etc.), but they share the same kernel. That's why uname - a displays your host kernel version

Using traditional virtualization, each operating system has its own kernel. These multiple cores run not on real hardware, but on Virtualization hardware provided by a software called virtual machine manager. This is an additional layer compared with container-based virtualization

Each virtualization has its advantages and disadvantages. The container is more limited in the choice of the operating system. The container must be supported by the running kernel (e.g. Solaris zones on Solaris, LxC on Linux, wpar on AIX). Although technically, there is no content. Developers prohibit the support of "foreign" user areas (e.g. lxbrand). When using the hypervisor, The operating system only needs to be supported by virtual hardware, which allows a variety of heterogeneous configurations (e.g. Linux 32-bit and 64-bit kernels, * BSD, Solaris, Windows,) Linux zones on Solaris 10 and SmartOS, or more recently Ubuntu runtime on Windows 10) Mac OS X,...)

The main advantage of containers is that they are lighter, and the application performance is basically the same as that of real bare-metal operating system installation. The instantiation speed of new containers is much faster, because there is no additional kernel to start, and the density of the virtual environment can be higher because there is no additional kernel to run

Please note that docker is not a container implementation. Docker is the build/package/distribution standard for applications running on containers, including the engine running them, and an orchestrator has been added recently. The role of this engine is similar to that of the hypervisor, but it is applicable to applications on containers

  • Tag:
  • Virtualization

Interested Blogs More