Skip to content

Proxmox

Is a Supervisor Operating System

Setup

Activate IOMMU / PCIe Passthrough

Import a VM from TrueNAS

  • Disk copy
    • Copy the raw file from TrueNAS to Proxmox - ZFS with dd
    • Import the raw file with qm importdisk <VMID> /path/to/file.raw local --format qcow2
    • Attach the disk to the VM with VirtIO
  • Other settings from TrueNAS
    • Boot loader: UEFI
    • Display: SPICE

USB Passthrough

  • The order of creation of passthrough does matter, like for Home Assistant

Remote SPICE access without going through Web GUI

  • Set up permissions
    • New role with VM.Console, VM.Audit
    • New group
    • New permission for the group with the role and the necessary path
    • New user in the PVE realm assigned to the group
  • Set up token
    • Create API Token, with Privilege Separation
    • In each VM, assign the API token to the Role created
  • Choose a script option

Configure ZFS settings

Limit ZFS Memory usage

Serial Console

  • Add Serial device to the VM
  • Edit /etc/default/grub with
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
  • Run update-grub

Create a QEMU CPU Model

  • Stored in /etc/pve/virtual-guest/cpu-models.conf
  • See Documentation

Disable mitigations

  • Edit /etc/default/grub
    • In GRUB_CMDLINE_LINUX_DEFAULT, add mitigations=off
  • update-grub
  • reboot

Utilization

Stop a VM

  • Shutdown simulate an ACPI power off
  • Stop simulate a sudden stops, like a power loss
  • qm stop <VMID> with VMID the ID in Proxmox
  • ps aux | grep <VMID> to grab the VM's process ID
  • kill -9 <PID> to kill the process

Mount a USB drive

  • Mount the drive with fstab
  • In the Proxmox interface, add the disk as a Directory

Shrink a VM Disk

  • Make sure that things are zeroed
    • Make sure that Discard is on
    • Resize a partition
  • Change the size (source)
    • If LV: lvreduce -L 5G /dev/pve/disk-name (reduce to 5G) or lvreduce -L -5G /dev/pve/disk-name (reduce by 5G)
    • If qcow2: qemu-img resize --shrink <vmfile.qcow2> [+-] or size
    • If ZFS: zfs set volsize=<new size>G rpool/data/vm-<vm id>-disk-<disk number>
      • Find the ZFS path with zfs list
  • Update Proxmox: qm rescan
  • If you use GUID Partition Table

Backup to USB External Drive

  • Have an existing ext4 partition
    • Or create it, check fstab
  • Create a folder and mount /dev/sdba1 /mnt/folder
  • Add the folder in Datacenter, Storage → Add Directory

Mail managements

See postfix

Sources