금. 8μ›” 8th, 2025

—]

πŸ” What is LXC?

Linux Containers (LXC) is an OS-level virtualization technology that runs multiple isolated user spaces (containers) on a single Linux kernel. Unlike VMs, it doesn’t require a guest OS (it shares the host OS kernel), stores less than 100MB, boots 1초⏱️, and is incredibly efficient with performance loss πŸ’‘ VM vs LXC > – VM: Full OS emulation (CPU virtualization, independent kernel) > – LXC: process/filesystem isolation (shared kernel) β†’ “ultra-lightweight VM”** concept

—.

πŸš€ Top 5 key advantages of LXC in Proxmox

  1. **Performance Efficiency
    • Direct access to host resources β†’ CPU/RAM overhead β‰ˆ 0
    • Better isolation than Docker (easier to run system services)
  2. **Faster Deployment
    • Template-based creation β†’ Ubuntu container creation in 3 seconds Example:
      pct create 100 local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst
  3. **Integrated Management
    • Integrated monitoring of VM/LXC in the Proxmox Web UI πŸ”„
  4. snapshot efficiency
    • Differential snapshot support β†’ 10GB container snapshot β‰ˆ 0.1 seconds ⚑.
  5. compatibility
    • Full Linux environment support including systemd, SSH, cron, etc.

—.

⚠️ Cautions when using LXC

  • Kernel dependencies: enforces host kernel version (e.g., no RHEL containers)
  • Security: lower isolation level than VMs β†’ mandatory use of Unprivileged Containers (Unprivileged).
  • Device access: Requires additional configuration for GPU/USB passthroughs

> πŸ”’ How to set up an Unprivileged Container. > Enable Unprivileged container checkbox in Proxmox creation wizard!

—]

πŸ› οΈ Proxmox LXC creation step by step guide

1. **Prepare a template

  • Repository β†’ Select local β†’ Download template (AlmaLinux, Debian, etc.) Download Proxmox template

2. Create a container

   # CLI Example (Ubuntu 22.04)
   pct create 101 \
     local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst \
     --storage local-lvm \
     --cores 2 --memory 2048 \
     --password mysupersecret \
     --unprivileged 1

3. Network Settings.

  • Bridge Mode**: Connect to vmbr0 β†’ Assign an independent IP.
  • Port Forwarding**:
     iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.0.0.101:80

4. **Mount Settings

  • Share the host directory:
     # Add /etc/pve/lxc/101.conf
     mp0: /mnt/data,mp=/data

—]

πŸ”§ Advanced Administration Tips

**Using Snapshots

   pct snapshot 101 pre-update # create
   pct rollback 101 pre-update # restore

Backup Strategy.

  • Incremental backup**: vzdump --mode snapshot
  • Storage replication: ZFS snapshot β†’ remote replication

**Create a clone

Web UI right-click β†’ “Clone” β†’ Full clone takes 5 seconds Example!

—.

🎯 LXC Optimal Use Cases

  1. **Web server cluster
    • Nginx + 10 PHP containers β†’ 70% RAM savings compared to VMs.
  2. development environment
    • Language-specific containers (Python/Node.js) β†’ Prevent dependency conflicts
  3. Media Server
    • Jellyfin + GPU pass-through:
      lxc.cgroup2.devices.allow: c 226:0 rwm # /dev/dri/renderD128
  4. **CI/CD Agent
    • GitLab Runner Container β†’ Can be deleted immediately after completing a task

—]

πŸ“ˆ Performance Benchmark (KVM vs LXC)

Item KVM LXC
CPU Score 9800 9980
Disk IOPS 89k 92k
Boot Time 8.2 seconds 0.3 seconds
RAM Usage 512MB 28MB

> πŸ“ Test Environment: Proxmox 8.1, Xeon E5-2680v4, NVMe SSD

—.

πŸ’Ž Conclusion: When to choose LXC?

  • Recommended: Web servers, DB (MySQL), development environments, microservices
  • Not Recommended: Running Windows, work requiring kernel module changes
  • Core Value: > “When you need to handle dense workloads in a resource-constrained environment, LXC is a weapon!”

Proxmox’s LXC is a technology that represents the pinnacle of simplicity and power. With the right setup, you can increase your server efficiency by 300%! πŸš€.

λ‹΅κΈ€ 남기기

이메일 μ£Όμ†ŒλŠ” κ³΅κ°œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. ν•„μˆ˜ ν•„λ“œλŠ” *둜 ν‘œμ‹œλ©λ‹ˆλ‹€