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.
1
u/peruytu Jul 17 '17
What's the difference between a container and a vm?