NIC port passthrough

neohidra

New Member
Mar 28, 2016
5
0
1
38
I would like to passthrough a port from a PCI NIC. Here is what i did:
  1. GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" added to /etc/default/grub, executed update-grub
  2. dmesg | grep -e DMAR -e IOMMU does produce output
  3. appenede (to /etc/modules):
    vfio
    vfio_iommu_type1
    vfio_pci
    vfio_virqfd
  4. The output of dmesg | grep ecap ends with e, so IOMMU interrupt remapping is supported
  5. I did find the address - 0a:00.0, and ist in its own iommu_group
But cannot boot the VM.
I added (to /etc/pve/qemu-server/102.conf):
machine: q35
hostpci0: 0a:00.0,pcie=1
and the
Use of uninitialized value $kvmver in pattern match (m//) at /usr/share/perl5/PVE/QemuServer.pm line 6378.
Use of uninitialized value $current_major in numeric ge (>=) at /usr/share/perl5/PVE/QemuServer.pm line 6384.
Running as unit 102.scope.
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0: vfio: failed to set iommu for container: Operation not permitted
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0: vfio: failed to setup container for group 20
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0: vfio: failed to get group 20
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0: Device initialization failed
TASK ERROR: start failed: command '/usr/bin/systemd-run --scope --slice qemu --unit 102 -p 'KillMode=none' -p 'CPUShares=1000' /usr/bin/kvm -id 102 -chardev 'socket,id=qmp,path=/var/run/qemu-server/102.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -vnc unix:/var/run/qemu-server/102.vnc,x509,password -pidfile /var/run/qemu-server/102.pid -daemonize -smbios 'type=1,uuid=4de08e04-d36e-48ed-88e5-ef6c42759d3d' -name tmpomv -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000' -vga cirrus -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 3092 -k en-us -readconfig /usr/share/qemu-server/pve-q35.cfg -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' -device 'vfio-pci,host=0a:00.0,id=hostpci0,bus=ich9-pcie-port-1,addr=0x0' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:803a1a4fc45e' -drive 'file=/proxmox/img/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100' -drive 'file=/proxmox/iso/template/iso/openmediavault_2.1_amd64.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -machine 'type=q35'' failed: exit code 1

I also tried with just:
hostpci0: 0a:00.0
but still without success.
Running as unit 102.scope.
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=pci.0,addr=0x10: vfio: failed to set iommu for container: Operation not permitted
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=pci.0,addr=0x10: vfio: failed to setup container for group 20
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=pci.0,addr=0x10: vfio: failed to get group 20
kvm: -device vfio-pci,host=0a:00.0,id=hostpci0,bus=pci.0,addr=0x10: Device initialization failed
TASK ERROR: start failed: command '/usr/bin/systemd-run --scope --slice qemu --unit 102 -p 'KillMode=none' -p 'CPUShares=1000' /usr/bin/kvm -id 102 -chardev 'socket,id=qmp,path=/var/run/qemu-server/102.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -vnc unix:/var/run/qemu-server/102.vnc,x509,password -pidfile /var/run/qemu-server/102.pid -daemonize -smbios 'type=1,uuid=4de08e04-d36e-48ed-88e5-ef6c42759d3d' -name tmpomv -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000' -vga cirrus -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 3092 -k en-us -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'vfio-pci,host=0a:00.0,id=hostpci0,bus=pci.0,addr=0x10' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:803a1a4fc45e' -drive 'file=/proxmox/iso/template/iso/openmediavault_2.1_amd64.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/proxmox/img/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100'' failed: exit code 1

What i am doing wrong?
 

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!