Linuxinfrastructure

Configure a Windows VirtIO VM on Proxmox (qm CLI)

Copy-paste qm commands to configure a Proxmox VM for a fast Windows guest: VirtIO SCSI disk, VirtIO NIC, the VirtIO driver ISO as a CD-ROM, the QEMU guest agent, and a TPM for Windows 11.

DistrosProxmox VE 8
Shellbash
Updated
Script
bash
#!/usr/bin/env bash
# Configure an existing Proxmox VM for a fast (paravirtualized) Windows guest.
# Run on the PROXMOX HOST. Create the VM first (q35 + OVMF), then run this.
# Read-through, then adjust the values marked below to your environment.
set -euo pipefail

# --- make these values your own ---
VMID=100                 # your VM's ID
DISK_STORE=local-lvm     # storage for the VM disk + TPM
ISO_STORE=local          # storage that holds your ISOs
BRIDGE=vmbr0             # the Linux bridge the NIC attaches to
DISK_GB=64               # OS disk size in GB
OSTYPE=win11             # win11 or win10

# 1) Download the stable VirtIO driver ISO into the ISO store (local shown).
cd /var/lib/vz/template/iso
wget -nc https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

# 2) Paravirtualized disk: VirtIO SCSI single controller, disk on the SCSI bus.
qm set "$VMID" --scsihw virtio-scsi-single
qm set "$VMID" --scsi0 "${DISK_STORE}:${DISK_GB},cache=writeback,discard=on,iothread=1"

# 3) Paravirtualized network card.
qm set "$VMID" --net0 "model=virtio,bridge=${BRIDGE}"

# 4) Enable the QEMU guest agent (also install it inside Windows later).
qm set "$VMID" --agent enabled=1
qm set "$VMID" --ostype "$OSTYPE"

# 5) Attach the VirtIO driver ISO as a second CD-ROM (ide0) so setup can load
#    drivers. The Windows install ISO stays on ide2 (Proxmox's default slot).
qm set "$VMID" --ide0 "media=cdrom,file=${ISO_STORE}:iso/virtio-win.iso"

# 6) Windows 11 only: add a TPM 2.0 device (Windows 11 requires TPM 2.0).
if [ "$OSTYPE" = "win11" ]; then
  qm set "$VMID" --tpmstate0 "${DISK_STORE}:1,version=v2.0"
fi

echo "Done. Boot the VM, then during setup load vioscsi and NetKVM from the w11 (or w10) folders."

What this does

This script configures an existing Proxmox VM for a fast, fully paravirtualized Windows guest from the command line — the CLI counterpart to the walkthrough in Install Windows on Proxmox with VirtIO Drivers. It sets the disk to a VirtIO SCSI controller, adds a VirtIO network card, downloads and attaches the official virtio-win driver ISO as a second CD-ROM, enables the QEMU guest agent, and — for Windows 11 — adds a TPM 2.0 device. Every flag matches the Proxmox qm manual.

It does not create the VM or install Windows — create the VM first (q35 machine type, OVMF/UEFI firmware, an EFI disk), then run this to wire up the fast hardware, then boot and install.

Prerequisites

  • Proxmox VE host access as root (the qm command runs on the host, not inside the guest).
  • A VM already created with the q35 machine type and OVMF (UEFI) firmware. See Creating Your First Proxmox VM.
  • Your Windows install ISO already uploaded as the VM’s first CD-ROM.

Notes

  • Make these values your own. Edit the variables at the top before running: VMID (your VM’s number), DISK_STORE (storage for the disk and TPM, e.g. local-lvm), ISO_STORE (storage holding your ISOs, e.g. local), BRIDGE (your Linux bridge, e.g. vmbr0), DISK_GB, and OSTYPE (win11 or win10). If a value looks specific to one machine, it’s a placeholder to change — not a literal to copy.
Windows 11 needs the TPM; Windows 10 does not

The TPM step only runs when OSTYPE=win11, because Windows 11 requires TPM 2.0 and Secure Boot. For Windows 10 leave OSTYPE=win10 and the script skips it.

  • The driver load still happens in the installer. This script makes the VirtIO disk and ISO available; you still load vioscsi (and NetKVM) from the w11 or w10 folder during Windows setup — the full guide shows exactly where.
  • tested: false — the qm flags are verified against the official manual, but this was not run end-to-end on hardware in a lab that installs Windows, so treat it as a verified-syntax reference and check each value against your setup.