[Howto] QEMU virtio-scsi: raw passthrough internal dvd-drive

posted in: computer | 0

/dev/sg0 = internal dvd-drive (sg0 = generic scsi, don’t use /dev/sr0 or /dev/cdrom)

source: https://forums.gentoo.org/viewtopic-p-8810385.html?sid=4d2c578cda12c941e278258e3e52b276

#neccessary options
-device virtio-scsi-pci,id=scsi0,bus=pci.0 \
-drive file=/dev/sg0,if=none,media=cdrom,readonly=on,format=raw,id=drive-hostdev0 \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-hostdev0,id=hostdev0

Now the drive will appear correctly by it’s name (e.g. ASUS DRW-24D1ST) on the SCSI controller in Windows.