# LXC (Linux Containers)
LXC (Linux Containers) is an operating system-level virtualization method for running multiple isolated [[Linux]] systems (containers) on a single Linux kernel. Initially developed by IBM, first released August 2008.
Unlike full virtual machines, LXC containers share the host kernel, making them lightweight and fast.
## How It Works
LXC combines two key Linux kernel features:
- **cgroups**: Resource limitation and prioritization (CPU, memory, I/O, network)
- **Namespaces**: Isolation of system resources (process trees, networking, user IDs, filesystems)
## Key Features
- **Lightweight**: No hypervisor overhead, near-native performance
- **Fast startup**: Seconds vs minutes for VMs
- **Resource efficient**: Shared kernel, minimal memory overhead
- **Full Linux environment**: Complete OS experience per container
- **Unprivileged containers**: Run as regular users (since LXC 1.0)
- **Works with vanilla kernel**: No patches required
## Comparison with VMs
| Aspect | LXC Containers | Virtual Machines |
|--------|---------------|------------------|
| Isolation | Process-level | Hardware-level |
| Overhead | Minimal | Significant |
| Startup | Seconds | Minutes |
| Kernel | Shared | Separate |
| Density | High | Lower |
## Related Technologies
- **[[Docker]]**: Originally used LXC as execution driver (until v0.9, removed in v1.10)
- **LXD**: Higher-level container manager built on LXC (written in Go)
- **[[Proxmox]]**: Uses LXC for container virtualization
- **OpenVZ**: Alternative Linux container technology (requires kernel patches)
## Security
- **Privileged containers**: Root in container = root on host (use with caution)
- **Unprivileged containers** (LXC 1.0+): Safer, limited hardware access
- Proper configuration essential for security
## Version History
- **LXC 1.0** (2014): Long-term support, unprivileged containers
- **LXC 4.0**: Supported until June 2025
- **LXC 5.0**: Supported until June 2027
- **LXC 6.0** (2024): Current stable
License: GNU LGPL v2.1 (some components GPL v2, BSD)
## References
- Official Website: https://linuxcontainers.org/
- Source code: https://github.com/lxc
- Documentation: https://linuxcontainers.org/lxc/documentation/
- Wikipedia: https://en.wikipedia.org/wiki/LXC