Disk Passthrough on Proxmox
💡
It is highly recommended to take notes of the device, serial number and device id.
See Sample Notes for example.
Step-by-Step Guide
Install Required Tools
-
Install
lshw
apt install lshw
-
List Disk and Storage Information
lshw -class disk -class storage
-
List Block Devices with Device IDs
lsblk | awk 'NR==1{print $0" DEVICE-ID(S)"} NR>1{dev=$1; printf $0" "; system("find /dev/disk/by-id -lname \"\*"dev"\" -printf \" %p\""); print "";}' | grep -v -E 'print|lvm'
-
Set Up Disk Passthrough
qm set <VMID> -scsi<UNUSED SCSI#> /dev/disk/by-id/ata-xxxxxxxxxxx-xxxxxx_xxxxxxxx
NOTE: UNUSED SCSI# must be incremented for each disk.
Backup and Edit VM Configuration
-
Backup the VM Configuration File
cp /etc/pve/qemu-server/<VMID>.conf /root/<VMID>-backup.conf
-
Edit the VM Configuration File
nano /etc/pve/qemu-server/<VMID>.conf
- Append
,serial=<SERIAL#>
to the end of each added disk line.
- Append
Sample Notes
-
For
/dev/sdc
:- Serial:
W9A34BTN
- Device ID:
ata-ST1000DM003-1SB102_W9A34BTN
- Serial:
-
For
/dev/sdd
:- Serial:
Z1DB25YT
- Device ID:
ata-ST1000DM003-1CH162_Z1DB25YT
- Serial:
Happy virtualizing!