A VM has virtual hardware, including a fixed allocation of RAM and a virtual disk, and runs its own kernel, including drivers for virtual devices such as a virtual display and network interfaces.
A container uses Linux kernel features to allocate a slice of the host kernel to make it appear to processes as though they have the host to themselves.
With a VM you pay the overhead of an entire kernel for the guest, as well as device emulation. Whereas with a container, you are using the host kernel and device abstractions directly, with isolation and resource limits implemented in that same kernel.
View all comments
Show parent comment
3
u/totemo Jul 17 '17 edited Jul 17 '17
A VM has virtual hardware, including a fixed allocation of RAM and a virtual disk, and runs its own kernel, including drivers for virtual devices such as a virtual display and network interfaces.
A container uses Linux kernel features to allocate a slice of the host kernel to make it appear to processes as though they have the host to themselves.
With a VM you pay the overhead of an entire kernel for the guest, as well as device emulation. Whereas with a container, you are using the host kernel and device abstractions directly, with isolation and resource limits implemented in that same kernel.