Back to proxmox
As I mentioned in my previous post, I’m using proxmox (again). But, in the same time, I wanted to migrate my services without long disruption, so I decided to move whole docker stack, as it is. But I prefer to use LXC containers than VMs. Why? Because LXC containers are faster and they are using less resources.
LXC are better than VMs because are:
- Lightweight – than means LXC containers have a smaller footprint and require fewer system resources compared to VMs.
- LXC containers share the host system’s kernel, reducing the overhead of running multiple operating systems.
- Faster – LXC containers have quicker startup times.
- Efficient resource handling – LXC containers efficiently manage system resources, optimizing performance and reducing waste. Mostly because LXC is not blocking resources like VM. So even if you declare 16GB of memory for LXC container, it will use only us much as needed, instead of block 16GB like VMs do.
Virtual Machines are better than LXC containers because they are:
- Not connected to host kernel – that means you can virtualize any OS, not only Linux based. So if you want to use Windows, MacOS, FreeBSD, etc you cannot use LXC, but VM
- They are isolated from host OS – that means they are safer by default. Because they’re isolated, security issues in one VM won’t spill over to others—crucial for maintaining system integrity and uptime. From the same reason, any kernel panic error will crash only VM, not whole host with all containers.
- May emulate different hardware – Proxmox VMs emulate a complete set of hardware, creating an entirely isolated environment for each operating system.
Docker in unprivileged container
I have to mention – according to the Proxmox documentation, docker should be run in VM, not in LXC container. If you want to use LXC container, then you have two possibilities – privileged or unprivileged. Privileged containers running on host root account, so it’s not safe, that’s why I’m not using them at all.
Read more Docker in unprivileged container (Arch based) in Proxmox