First upload the image via the Proxmox management console. Under the node, select the local storage, then ISO images. Upload the desired ISO image, with optional checksum.
Alternatively, the path to this folder is /var/lib/vz/template/iso
.
After which, use the "Create new VM" button to create a new VM using the image. The usual VM configuration and provisioning applies, e.g. RAM, CPU, NIC. Note to enable the QEMU Agent. Follow this nice documentation.
sudo apt install qemu-guest-agent sudo systemctl enable --now qemu-guest-agent
Some disambiguation may be needed. I'm pretty sure I don't have it exactly down, but these should be sufficient to get up and running:
Proxmox uses QEMU and loads KVM whenever available, so in this context QEMU and KVM are generally synonymous with each other.
Installing the QEMU agent (ref):
vm:~# apt install qemu-guest-agent # debian vm:~# systemctl enable --now qemu-guest-agent host:~$ qm set ${VM_ID} --agent 1 host:~$ qm reboot ${VM_ID} host:~$ qm agent ${VM_ID} ping
Saw from Reddit or somewhere that virt-sysprep doesn't really cooperate with PVE...?
A long-ass QEMU and Proxmox cheatsheet, but nice nonetheless.
Template guide here, together with a more automated version. Here's another one. And another one. Note the concerns with machine ID. This is what branched me off: Reddit.
For QM related instructions, referenced from script:
# Remove old templates and clone existing VMs qm destroy 6000 --destroy-unreferenced-disks 1 qm clone 9000 6000 --name mytemplate --full 1 # Prepare VM templates qm set 6000 --ipconfig0 ip=dhcp qm start 6000 # run stuff here... qm shutdown 6000 # Convert to template qm set 6000 --template 1
Setup apt-cacherng for faster upgrades.
Monitor LVM thin pool storage usage: pvesm status | grep lvmthin | awk '{print $7}'
"Linked clone feature is not supported for drive 'scsi0'" occurs when cloning from a template. Note to change the drive type for future updates.
Templates are available by default, and can be accessed by pveam available
. Updates are propagated via pveam update
.
Consider reading this for cloud-init based setup: https://github.com/UntouchedWagons/Ubuntu-CloudInit-Docs
The QEMU guest agent comes in handy here. We use the agent command network-get-interfaces
to query the IP addresses.
host:~# qm agent 1000 network-get-interfaces | grep "\"ip-address\"" "ip-address" : "127.0.0.1", "ip-address" : "::1", "ip-address" : "192.168.121.85", "ip-address" : "fe80::be24:11ff:fe0b:8d17",
Once booting, press any key to load from CD. Go through the installer and select Custom (Advanced). Load the following drivers:
vioscsi\w11\amd64
(Red Hat VirtIO SCSI pass-through controller)NetKVM\w11\amd64
(Redhat VirtIO Ethernet Adapter)Balloon\w11\amd64
(VirtIO Balloon Driver)
Install Windows (preferably Pro for RDP support) on the drive that appears. Afterwards, in the Windows regional setup page, pull the console with Shift+F10
and enter oobe\bypassnro
to disable network registration + Microsoft account requirement.
After which, update the computer, and install the VirtIO tools from the mounted CD. Verify that all devices have been updated as well. Install also the QEMU guest agent at guest-agent\qemu-ga-x86_64.msi
if the QEMU Agent was initially selected during VM Setup.
Resolution set by entering BIOS (using F2 at boot screen), and modifying "Device Manager > OVMF Platform Configuration".
Use RDP to connect to the Windows for almost native speeds.