In this part you prepare the Debian computer the lab runs on. You check that it can run virtual machines, update it, install QEMU and KVM, give your user access to KVM, create an empty disk for Proxmox and write the script that starts it. There’s no Proxmox yet. That’s Part 3 and Part 4.
Every command below is its own step, with a screenshot of what it showed on my machine.
What you’ll end up with
The finished lab has three layers:
- A Debian computer called
sharewarepress. This is the physical machine, the host. - Proxmox VE running as a virtual machine on that host, managed from a web browser.
- Windows test machines inside Proxmox, each with a clean snapshot to roll back to after every review.
This part builds the first layer. When you’re done, the host has QEMU and KVM installed, an empty 200 GB disk waiting for Proxmox, and a script that starts the Proxmox machine with or without the installer.
What you need
- A 64-bit computer running Debian 13, with an account that can use
sudo. - Hardware virtualization turned on in the BIOS/UEFI setup.
- A terminal. Every step is a command you type and a result you compare.
Note: Hardware virtualization is called AMD-V or SVM on AMD boards and Intel VT-x on Intel boards, and the menu it lives in differs from board to board. Steps 2 and 4 tell you whether it’s on.
Step 1: Check the operating system
Show the Debian version:
cat /etc/os-release
Open larger screenshotLook at PRETTY_NAME, which should say Debian GNU/Linux 13 (trixie), and DEBIAN_VERSION_FULL, which says 13.7 here. The rest are links and IDs.
Then show the kernel and the machine name:
uname -a
Open larger screenshotThe second word, sharewarepress, is the host name. After it comes the kernel version, 6.12.113, and at the end x86_64, which means a 64-bit system.
I run the host on Debian for a few reasons. Proxmox VE is built on Debian, so the tools and the way things work on the host are the same ones you’ll see inside Proxmox later. It’s stable, and a lab host should be boring: the apps under test should break, not the machine under them. It has a large community, so most questions have been asked before. And many distributions, like Ubuntu, are based on Debian, so what you learn here carries over.
Step 2: Check the CPU and virtualization support
lscpu | grep -v Flags
lscpu prints a lot, including a long Flags line that lists everything the CPU supports. You don’t need to read it, so grep -v Flags leaves it out:
Open larger screenshotLook at Model name, which is AMD Ryzen 9 7950X here, and Core(s) per socket, which is 16. The line that matters most is Virtualization, so pull it out on its own:
lscpu | grep -A1 'Virtualization'
Open larger screenshotExpected result: Virtualization: AMD-V, which means the CPU’s hardware virtualization is available to this system. On an Intel machine, that line says VT-x instead of AMD-V. The -A1 also prints the line after the match, which is why L1d cache shows up too.
Step 3: Check memory and disk space
Check the memory:
free -h
Open larger screenshotThe -h makes the numbers readable. Look at the Mem: line: 31Gi total and 28Gi available.
Note: The machine has 32 GB; free shows a bit less because the system reserves some.
Then check the disk the system is on:
df -h /
Open larger screenshotSize is 476G, and Avail says 444G is free. That’s where the Proxmox disk goes in Step 9.
Step 4: Check the KVM device
ls -l /dev/kvm
Open larger screenshotExpected result: /dev/kvm exists, owned by root and the group kvm, with read and write for both. Remember the group name. You need it in Step 7.
Warning: If /dev/kvm is missing, or lscpu shows no Virtualization line, stop here. Virtualization is off in the BIOS/UEFI. Turn it on there, then check again. Nothing after this step will run at a usable speed without it.
Here is what this host has:
| Item | This host |
|---|---|
| Operating system | Debian 13 “trixie” (13.7) |
| CPU | AMD Ryzen 9 7950X, 16 cores |
| Virtualization | AMD-V, /dev/kvm present |
| Memory | 32 GB |
| Disk | 476 GB, 444 GB free |
Proxmox needs a 64-bit CPU with hardware virtualization turned on, enough memory for Proxmox itself plus every machine you plan to run inside it, and enough disk space for those machines’ virtual disks. This host has more than enough for the lab in this series.
Step 5: Update Debian
Always update before installing new packages. First, refresh the package lists:
sudo apt update
Open larger screenshotNote: sudo asks for your password first. Nothing shows while you type it, not even dots. Type it and press Enter.
Each Hit or Get line is a package source being checked. The last line is the one to read: “All packages are up to date.”
Then install whatever upgrades there are:
sudo apt full-upgrade -y
Open larger screenshotThe -y answers yes for you. Here the summary says 0 for everything, so there was nothing to do. The point is to start from a current system. If yours upgrades a lot, especially the kernel, restart before you continue.
Step 6: Install QEMU and KVM tools
KVM is built into the Linux kernel. QEMU is the program that uses it to run virtual machines. Install three packages in one command:
sudo apt install -y -qq qemu-system-x86 qemu-utils ovmf
Tip: The -qq just hides apt’s progress output. You still see what it installs.
qemu-system-x86gives youqemu-system-x86_64, the program that runs the Proxmox machine.qemu-utilsgives youqemu-img, which creates and inspects virtual disks.ovmfis UEFI firmware for virtual machines. The launch script doesn’t use it; it’s there for a UEFI machine later.
Open larger screenshotapt first lists what it’s about to install: the three packages you asked for, plus four it pulls in to go with them. Then it unpacks everything.
Open larger screenshotExpected result: the output is long. At the end you want a list of Setting up lines, including qemu-utils and qemu-system-x86, then a Processing triggers line and your prompt back, with no error.
Check that both programs are there. First QEMU itself:
qemu-system-x86_64 --version
Open larger screenshotThen the disk tool:
qemu-img --version
Open larger screenshotBoth report version 10.0.13.
Step 7: Give your user access to KVM
/dev/kvm belongs to the kvm group, as Step 4 showed. If your user isn’t in that group, QEMU can’t use KVM, and you end up running QEMU as root or running it without KVM. Neither is what you want. Add your user to the group:
sudo usermod -aG kvm $USER
Open larger screenshotNo output means it worked. $USER is your own user name, so you don’t have to type it.
Warning: The -a matters. Without it, usermod -G replaces your other groups instead of adding one.
Check it:
getent group kvm
Open larger screenshotExpected result: a line like kvm:x:993:user. That’s the group name, a placeholder for the password, the group number and, at the end, its members. My user is called user, so that’s me.
Note: Log out and back in after this. A new group only applies to new logins. Until then, your current session doesn’t have it yet, even though getent already shows it.
Step 8: Plan the network
Proxmox runs with QEMU’s user-mode networking. The Proxmox machine sits behind QEMU’s own small network and reaches the internet through the host. There’s no bridge and no change to the host’s network settings. The catch is that nothing can reach Proxmox unless you forward a port to it. You need two:
| Host port | Goes to | What for |
|---|---|---|
| 127.0.0.1:8006 | Proxmox port 8006 | The Proxmox web interface, at https://localhost:8006 |
| 127.0.0.1:2222 | Proxmox port 22 | SSH into Proxmox, for later |
Note: Both are bound to 127.0.0.1, so only the host itself can open them. For a machine where you install software you don’t trust yet, that’s what you want.
A bridge would be faster, but the lab doesn’t need the speed. The plan goes into the launch script in Step 10.
Step 9: Create the lab folders and the Proxmox disk
Create the folders for the lab:
mkdir -p ~/lab/proxmox ~/lab/iso
Open larger screenshot~/lab/proxmox holds the disk and ~/lab/iso holds the installer in Part 3. The -p creates ~/lab too, and doesn’t complain if a folder already exists.
Then create the disk itself:
qemu-img create -f qcow2 ~/lab/proxmox/proxmox.qcow2 200G
Open larger screenshotThe Formatting line confirms the file name, the format qcow2 and the size in bytes, 214748364800, which is 200 GiB. The rest are qcow2 settings left at their defaults.
Look at what was created:
qemu-img info ~/lab/proxmox/proxmox.qcow2
Open larger screenshotExpected result: two lines matter. virtual size: 200 GiB is how big the disk looks to Proxmox. disk size: 196 KiB is how much space it actually takes on the host right now.
Tip: The disk is thin. It only grows as Proxmox and its machines write data. Thin disks fill up quietly, so keep an eye on free space.
Step 10: Write the launch script
Typing a long QEMU command every time gets old fast, so the whole thing goes into one script. Open it in nano, the simple text editor that comes with Debian:
nano ~/lab/start-proxmox.sh
Type the script in:
#!/bin/bash
# Start the Proxmox VE lab VM.
# Usage: ./start-proxmox.sh boot from the disk
# ./start-proxmox.sh install.iso boot the installer
set -e
LAB="$HOME/lab"
ISO="$1"
ARGS=(
-name proxmox-lab
-machine q35,accel=kvm
-cpu host
-smp 12
-m 24G
-drive file="$LAB/proxmox/proxmox.qcow2",if=virtio,format=qcow2,cache=none,discard=unmap
-netdev user,id=net0,hostfwd=tcp:127.0.0.1:8006-:8006,hostfwd=tcp:127.0.0.1:2222-:22
-device virtio-net-pci,netdev=net0
-vga virtio
-display gtk
)
if [ -n "$ISO" ]; then
ARGS+=( -cdrom "$ISO" -boot once=d )
fi
exec qemu-system-x86_64 "${ARGS[@]}"
Open larger screenshotThe * after the file name at the top means it isn’t saved yet. The colors are nano’s, not part of the file.
Tip: The two shortcut rows at the bottom are nano’s menu; ^ means Ctrl. So ^O Write Out is Ctrl+O and ^X Exit is Ctrl+X.
To save, press Ctrl+O. nano asks for the file name, already filled in:
Open larger screenshotPress Enter to keep it:
Open larger screenshotnano says “Wrote 23 lines”, and the * is gone from the top. Press Ctrl+X to leave nano.
What each part of the script does:
set -estops the script at the first command that fails.LABis the lab folder.ISOis the first argument, if you give one.-name proxmox-labnames the machine, so the window title says what it is.-machine q35,accel=kvmuses QEMU’s newer q35 machine type and runs it with KVM. Withoutaccel=kvm, QEMU would emulate the CPU and everything would crawl.-cpu hostpasses the host CPU’s features through. Proxmox needs the virtualization flag to run its own machines, and this is how it gets it.-smp 12and-m 24Ggive Proxmox 12 of the 16 cores and 24 GB of the 32 GB. That leaves 4 cores and 8 GB for Debian itself.-drive …attaches the qcow2 disk as a virtio disk.cache=noneskips the host’s file cache, anddiscard=unmaplets space freed inside the machine be given back to the qcow2 file.-netdev user,…is the user-mode network with the two port forwards from Step 8.-device virtio-net-pciis the network card Proxmox sees.-vga virtioand-display gtkshow the machine’s screen in a window on the host desktop. The installer needs a screen.- The
ifblock adds the ISO as a CD and boots from it once (-boot once=d) when you pass an ISO. After the next restart, it boots from the disk again. execreplaces the script with QEMU, so closing QEMU ends everything cleanly.
Make the script executable, so you can run it by its name:
chmod +x ~/lab/start-proxmox.sh
Open larger screenshotNo output again, which is what you want.
Step 11: Check the script and the files
There’s no installer to boot yet, but you can check the script and the files.
Check the script’s syntax:
bash -n ~/lab/start-proxmox.sh
Open larger screenshotbash -n reads the script without running it. If there were a mistake, it would print an error with the line number. Expected result: nothing, so the syntax is fine.
Check the lab folder:
ls -l ~/lab
Open larger screenshotExpected result: two folders, iso and proxmox, and start-proxmox.sh at 624 bytes. The x letters in -rwxrwxr-x mean it’s executable, which is what chmod +x did.
Check the disk folder:
ls -lh ~/lab/proxmox
Open larger screenshotExpected result: one file, proxmox.qcow2, at 196K, the same as qemu-img info said.
If something goes wrong
bash -nprints an error: compare your script with the one in Step 10, at the line number it gives. A missing bracket or quote is the usual reason.- Permission denied when you run the script: the
chmod +xstep was skipped. - QEMU later complains about permission on /dev/kvm: you probably didn’t log out and back in after adding yourself to the
kvmgroup.
What’s next
The host is ready. QEMU and KVM are installed, your user can use KVM, the disk exists and the launch script is written and checked. What’s missing is Proxmox itself.
In Part 3, “Downloading and Verifying the Proxmox VE ISO”, you download the Proxmox VE installer into ~/lab/iso and check it, so this script has something to boot.

Discussion
Was this helpful? 0
Open a fresh voting form