| VM (KVM/QEMU) | LXC container | |
|---|---|---|
| Kernel | its own | shares the host kernel |
| Operating systems | any (Windows, BSD, Linux) | Linux only |
| Overhead | higher (RAM, disk) | very low |
| Isolation | strong | weaker (kernel is shared) |
| Hardware passthrough | full PCIe/USB passthrough possible | limited |
Use a VM for Windows, anything that needs its own kernel or strong isolation, Docker hosts you do not fully trust, or hardware passthrough. Use an LXC for lightweight Linux services you trust. Running Docker inside LXC is possible but needs the container features enabled and is less isolated than in a VM; many people run Docker in a VM for that reason.