Proxmox VE on a VPS: Running a Nested Virtualization Lab for Testing and CI

Running virtual machines inside your VPS — nested virtualization — sounds like a lab experiment, but it is one of the most useful tricks a KVM-based VPS supports. You can spin up disposable VMs to test Ansible playbooks, validate Kubernetes manifests, reproduce production bugs in isolation, or run a small homelab-style environment in the cloud. Proxmox VE makes this practical: it installs on a Debian base and gives you a web UI, LXC containers, and KVM virtual machines from one dashboard. This guide covers the prerequisites, the installation, and the honest performance trade-offs so you can decide whether a nested lab belongs on your server.

Before You Start: What Nested Virtualization Requires

Nested virtualization only works on VPS platforms that expose hardware virtualization to the guest. That means a KVM- or Xen-based provider; OpenVZ-style container VPSes will not work. On a fresh Debian or Ubuntu server, verify support with these two checks before installing anything:

grep -cE '(vmx|svm)' /proc/cpuinfo
ls -l /dev/kvm

The first command counts cores advertising Intel VT-x (vmx) or AMD-V (svm); the second confirms the /dev/kvm device exists. If you see zero flags or no device, your provider does not pass virtualization through and Proxmox will fall back to pure emulation — usable for testing, but far too slow for real workloads.

Minimum Sizing for a Nested Lab

Lab sizevCPURAMDiskTypical use
Small24 GB40 GB1–2 VMs for Ansible/CI tests
Medium48 GB80 GBK3s cluster, multi-node tests
Large8+16 GB160 GBFull staging environments

Remember that the hypervisor and its management tools consume roughly 1–2 GB of RAM and one vCPU before you start any guests. Nested KVM adds about 5–15% CPU overhead on top of normal virtualization costs, so leave headroom.

Installing Proxmox VE on the VPS

Proxmox VE requires a fully qualified domain name. Set the hostname first, then add the repository and install. On Debian 12:

hostnamectl set-hostname lab.example.com
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve.list
wget -qO- https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/proxmox.gpg
apt update
DEBIAN_FRONTEND=noninteractive apt install -y proxmox-ve postfix

When Postfix asks for configuration, choose Internet Site and use your FQDN as the mail name. After installation completes, reboot so the server boots the Proxmox kernel. The web UI will be available at https://YOUR_IP:8006 — accept the self-signed certificate warning on first visit.

Creating Your First VM and Container

From the web UI you can create guests in a few clicks, but the command line is faster for repeatable setups. A minimal Debian VM with 2 GB RAM and a 16 GB disk:

qm create 100 --name debian-test --memory 2048 --cores 2   --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci   --disk0 local-lvm:16 --ostype l26   --cdrom local:iso/debian-12.iso
qm start 100

For lightweight workloads, LXC containers use far less memory than full VMs:

pveam update
pveam download local debian-12-standard_12.2-1_amd64.tar.zst
pct create 200 local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst   --hostname web-test --memory 1024 --cores 1 --net0 name=eth0,bridge=vmbr0
pct start 200

Networking works through the vmbr0 bridge, which NATs or routes out through the VPS’s public interface. Guests appear as normal outbound connections, so no provider firewall changes are needed for guest traffic.

Managing the Lab: Snapshots, Limits, and Autostart

A lab only stays useful if you can reset it quickly. Proxmox snapshots let you roll a VM back to a known-good state before every experiment:

qm snapshot 100 baseline-before-ansible
qm rollback 100 baseline-before-ansible
pct snapshot 200 clean-state

Because a nested lab shares one physical server, resource limits matter more than on a dedicated hypervisor. Set hard caps per guest so one runaway test cannot starve the host or your production services running beside it:

qm set 100 --cpulimit 2 --memory 2048 --cpuunits 1024
pct set 200 --cpulimit 1 --memory 1024 --swap 512

cpulimit caps the guest’s CPU time, cpuunits sets its weight when the host is contended, and memory plus swap bound its RAM footprint. Enable autostart so lab guests come back after a host reboot, but stagger the boot order with --startup order=N to avoid an I/O stampede:

qm set 100 --startup order=1
pct set 200 --startup order=2

Performance Reality: What You Give Up

Guest workloadExpected overhead vs. bare metal
CLI tools, builds, scripting2–5%
Web servers, application servers5–10%
Databases under sustained load10–20%

Nested virtualization also amplifies host-level CPU steal: if the physical host is oversubscribed, your VPS waits for CPU time, and every layer inside it waits too. Benchmark before and after with sysbench cpu run and fio so you have a baseline. For latency-sensitive production traffic or anything with a strict SLA, keep guests off the critical path — use the nested lab for testing, CI, and development only.

Troubleshooting Common Failures

  • “KVM acceleration not available” — the provider does not expose /dev/kvm; check ls -l /dev/kvm and the CPU flags from the checks above.
  • VMs are extremely slow — you are running without hardware acceleration; either switch providers or stick to LXC containers.
  • modprobe kvm_intel fails — the host CPU does not support VT-x passthrough; there is nothing to fix from inside the guest.
  • Guest network is down — verify the bridge exists (ip link show vmbr0) and that the VM uses vmbr0, not a non-existent bridge.

Is a Nested Lab Worth It?

For development, testing, and learning, a Proxmox VE lab on a VPS is excellent value — you get multiple isolated environments for the price of one server. For production, keep it simple and run services directly on the host. If you are shopping for hardware that supports this kind of work, a KVM-based VPS with dedicated resources is the right starting point, and it is worth reading up on what cloud VPS plans typically expose before you choose one.

Leave a Reply