I turned my laptop into a Proxmox server for my sysadmin course lab

From a CachyOS desktop to Proxmox VE on a laptop with a single NIC: the lid, the disks, a lab OPNsense and the VMs I use for my sysadmin course.

IvánPublished on 6 minLeer en español

I had a laptop running CachyOS that had been through it all: the Omarchy look, a local AI on the GTX 1060 that I ended up removing… and then it just sat there, switched on now and then. This year I started ASIR, the Spanish two-year vocational degree in network systems administration, and I needed somewhere to create and break virtual machines without fear. So on October 7 I wiped it and installed Proxmox VE. Here’s how I set it up and what I learned in the first week.

Spoiler: the install went without a single problem and I don’t miss CachyOS at all. The interesting part is that a laptop isn’t a server, and you have to make it behave like one.

1. Why Proxmox and not virt-manager on the desktop

On CachyOS I already had KVM and virt-manager working. The catch was that the VMs depended on the laptop having a session open and on me sitting in front of it. With Proxmox the laptop stays closed on a shelf and I manage everything from the web UI (port 8006) on my desktop PC:

  • I create a VM in two minutes, snapshot it before an assignment and roll back if I break it.
  • The ones that must always be running start on their own with the host (onboot).
  • I can install whatever I want: a firewall, a Linux server, a desktop Linux, Home Assistant… That freedom is exactly what I need for the course.

If you’re new to Proxmox, the step-by-step install is in the first part of the guide. Here I’ll focus on what’s specific to doing it on a laptop.

2. The hardware

Part What it has
CPU 12 threads
RAM 16 GB
Disk 1 119 GB SSD
Disk 2 1 TB 5,400 rpm HDD (it was empty)
Network A single wired card (plus Wi-Fi, which I don’t use)
GPU GTX 1060 6 GB (unused for now)

RAM is the limit, not the CPU. With 16 GB you have to think about how much each VM gets, and that already forced a decision I’ll tell you about below.

3. Making a laptop behave like a server

I installed it over cable, with a static IP that’s also reserved on the router so nothing else grabs it. After the usual tweaks (the pve-no-subscription repository and a full upgrade, as in part two), I did three laptop-specific things.

Ignore the lid. Under Proxmox there’s a Debian, and by default closing the lid suspends it… with every VM inside.

mkdir -p /etc/systemd/logind.conf.d
cat > /etc/systemd/logind.conf.d/lid.conf <<'EOF'
[Login]
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
EOF
# And in case something tries to suspend it anyway:
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
systemctl restart systemd-logind

Let the screen blank by itself. Otherwise the console stays lit for days. In /etc/default/grub I add consoleblank=60 to GRUB_CMDLINE_LINUX_DEFAULT and then run update-grub.

The battery is my UPS. This one’s free: if the power goes, the laptop keeps running for a good while. A real server would need a separate one.

4. Two disks and the NAS, each with its own job

A 119 GB SSD fills up fast, so I turned the 1 TB disk into LVM-thin storage for VMs:

# The disk name is an example: check with lsblk first, this wipes it
pvcreate /dev/sdb
vgcreate hdd /dev/sdb
lvcreate -l 95%FREE --thinpool hdd hdd
pvesm add lvmthin hdd --vgname hdd --thinpool hdd --content images,rootdir

(You can do the same from the web UI under Node > Disks > LVM-Thin > Create.)

The rule I follow:

  • SSD (local-lvm): whatever needs to be snappy and always on, like Home Assistant or the firewall.
  • HDD (hdd): big disks and lab VMs I only start for an assignment.
  • NAS (over SMB): ISOs and backups. That way they don’t eat local disk and, if the laptop dies, the backups live somewhere else. More on that in part five of the guide.

A tip: you don’t need to download ISOs to your PC and upload them. Proxmox can fetch them straight into a storage with Download from URL, which you can also do from the shell with pvesh.

5. A single NIC and a lab OPNsense

The course covers networking and firewalls, so I wanted an OPNsense. But with a single card it can’t be my home router: you’d need one card for the internet and another for the inside network. The answer is an internal bridge with no physical port at all, acting as the lab network:

# /etc/network/interfaces (added)
auto vmbr1
iface vmbr1 inet static
        address 10.10.10.2/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
  • OPNsense has its WAN on vmbr0 (the home network) and its LAN on vmbr1 (10.10.10.1/24, with DHCP).
  • Lab VMs are attached to vmbr1: they reach the internet through OPNsense and don’t mix with the devices at home.
  • Proxmox has an IP on vmbr1 so I can reach that network from my PC through an SSH tunnel:
ssh -L 8443:10.10.10.1:443 root@PROXMOX_IP
# and the OPNsense web UI is at https://localhost:8443

I did consider using OPNsense to filter my home network (via DNS, which works with a single card), but I dropped the idea: a lab is there to be broken, and I don’t want an experiment to take the whole house offline.

6. The VMs I run now

VM What for Where
OPNsense Lab firewall SSD, starts on boot
Ubuntu Server Linux assignments, behind OPNsense HDD
Home Assistant OS Home automation SSD, starts on boot
Debian 13 with GNOME Assignments that need a desktop HDD

A few notes on each:

  • Home Assistant went in from the official qcow2 image (checking the checksum before importing it). Heads-up: the first boot took about 20 minutes on the preparation screen while it downloaded the core. It isn’t stuck, just wait.
  • Debian with GNOME I set up for an assignment about terminal emulators. I used Debian’s cloud image with cloud-init and learned two things: it has to be the generic image, not genericcloud, which ships without graphics drivers; and with the qxl display the console screenshots came out black, while virtio works fine.
  • Windows Server I tried and deleted the same day. I installed Server Core by mistake and, seeing how much RAM it wanted, decided that Windows Server VMs go on my desktop PC when I need them. On a 16 GB box already running Home Assistant and the firewall, it’s not worth it.

They all have the QEMU guest agent installed, so Proxmox sees their IP and can shut them down cleanly. Why that matters is in part three.

What not to do

  1. Closing the lid before configuring logind. You’ll find everything suspended.
  2. Running your home router on a box with a single NIC. Fine for a lab, not for production.
  3. Putting everything on the small SSD. Decide up front what goes on each disk.
  4. Assuming the CPU is the limit. At home it’s almost always RAM: do the maths before creating the VM.
  5. Using the genericcloud image for a desktop VM.

Summary

  1. An old laptop makes a good lab server: low power draw, and the battery doubles as a UPS.
  2. Lid ignored, screen that blanks by itself, static IP reserved on the router.
  3. SSD for what’s always on, HDD for the lab, and the NAS for ISOs and backups.
  4. With a single NIC, an internal bridge (bridge-ports none) gives you a lab network behind an OPNsense.
  5. With 16 GB you have to choose: I moved Windows Server off it.

After a week, for studying I wouldn’t swap it for anything: going from “do I dare install this?” to “I’ll try it and, if it goes wrong, roll back the snapshot” is exactly what I needed.

Mini quiz

Did it stick?

Three quick questions. Each right answer is worth 10 XP.

  1. The laptop has a single network card. How do I run an OPNsense with both WAN and LAN?
  2. What happens if you close the lid of a Proxmox laptop without changing anything?
  3. Why is Debian's 'genericcloud' image no good for a desktop VM?
  • #proxmox
  • #lab
  • #sysadmin-course
  • #opnsense
  • #home-assistant
Esc