r/linux • • Jul 16 '17

How Linux containers have evolved

https://opensource.com/article/17/7/how-linux-containers-evolved
130 Upvotes

28 comments sorted by

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.