During pci passthrough, the VM does not start with qm, but it can with run /usr/bin/kvm.

jic5760

Member
Nov 10, 2020
40
8
13
26
Running the qm start command or from the GUI throws a `got timeout` error and the VM does not start.
However, if run the following command directly in the shell, it will work.

```
/usr/bin/kvm -id 1003 -name pc-01 -no-shutdown -chardev 'socket,id=qmp,path=/var/run/qemu-server/1003.qmp,server=on,wait=off' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/1003.pid -daemonize -smbios 'type=1,uuid=...' -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' -drive 'if=pflash,unit=1,format=raw,id=drive-efidisk0,size=131072,file=/dev/zvol/datastore/vm-1003-disk-0' -smp '6,sockets=1,cores=6,maxcpus=6' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vnc 'unix:/var/run/qemu-server/1003.vnc,password=on' -no-hpet -cpu 'host,+aes,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt' -m 10240 -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg -device 'vmgenid,guid=...' -device 'vfio-pci,host=0000:0d:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0,rombar=0' -device 'qxl-vga,id=vga,bus=pcie.0,addr=0x1' -chardev 'socket,path=/var/run/qemu-server/1003.qga,server=on,wait=off,id=qga0' -device 'virtio-serial,id=qga0,bus=pci.0,addr=0x8' -device 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0' -object 'rng-random,filename=/dev/urandom,id=rng0' -device 'virtio-rng-pci,rng=rng0,max-bytes=1024,period=1000,bus=pci.1,addr=0x1d' -device 'virtio-serial,id=spice,bus=pci.0,addr=0x9' -chardev 'spicevmc,id=vdagent,name=vdagent' -device 'virtserialport,chardev=vdagent,name=com.redhat.spice.0' -spice 'tls-port=61000,addr=127.0.0.1,tls-ciphers=HIGH,seamless-migration=on' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:533295ae3b52' -drive 'if=none,id=drive-ide0,media=cdrom,aio=io_uring' -device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=101' -device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' -drive 'file=/dev/zvol/datastore/vm-1003-disk-1,if=none,id=drive-scsi0,cache=writethrough,discard=on,format=raw,aio=io_uring,detect-zeroes=unmap' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,rotation_rate=1,bootindex=100' -drive 'file=/dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB...,if=none,id=drive-scsi1,format=raw,cache=none,aio=io_uring,detect-zeroes=on' -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=1,drive=drive-scsi1,id=scsi1' -netdev 'type=tap,id=net0,ifname=tap1003i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=...,netdev=net0,bus=pci.0,addr=0x12,id=net0' -rtc 'driftfix=slew,base=localtime' -machine 'type=pc-q35-6.1+pve0' -global 'kvm-pit.lost_tick_policy=discard'
```

```
$ ps aux | grep 'id 1003'
root 3877349 1.0 0.0 293868 41732 ? SLl 00:05 0:00 /usr/bin/kvm -id 1003
root 3877369 52.0 1.2 11324492 1063092 ? RLl 00:05 0:01 /usr/bin/kvm -id 1003

$ ps tree

├─kvm(3877369)─┬─{kvm}(3877370)
│ ├─{kvm}(3877778)
│ ├─{kvm}(3877779)
│ ├─{kvm}(3877780)
│ ├─{kvm}(3877781)
│ ├─{kvm}(3877782)
│ ├─{kvm}(3877783)
│ └─{kvm}(3877784)
├─pvedaemon(3875)─┬─pvedaemon worke(2840086)───task UPID:pve-n(3877295)───task UPID:pve-n(3877348)───kvm(3877349+
│ ├─pvedaemon worke(2840087)
```

# cat /etc/modprobe.d/vfio.conf
```
options vfio-pci ids=10de:1b80,10de:10f0,1912:0015 disable_vga=1
```

# lspci
```
options vfio-pci ids=10de:1b80,10de:10f0,1912:0015 disable_vga=10d:00.0 0c03: 1912:0015 (rev 02) (prog-if 30 [XHCI])
Flags: fast devsel, IRQ 18, NUMA node 0, IOMMU group 44
Memory at fb300000 (64-bit, non-prefetchable) [size=8K]
Capabilities: [50] Power Management version 3
Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
Capabilities: [90] MSI-X: Enable- Count=8 Masked-
Capabilities: [a0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [150] Latency Tolerance Reporting
Kernel driver in use: vfio-pci
Kernel modules: xhci_pci
```

# cat /proc/cmdline
```
BOOT_IMAGE=/boot/vmlinuz-5.11.22-1-pve root=/dev/mapper/pve-root ro quiet pcie_aspm=off intel_iommu=on iommu=pt
```

There is no output to dmesg.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!