Sample Header Ad - 728x90

QEMU on FreeBSD : how to passthrough a PCIe Wireless Network Adapter to the guest OS (Android 7)

1 vote
0 answers
126 views
I would like to passthru a PCI device to qemu for FreeBSD (14.2) without using virt-manager and vfio (because FreeBSD does not support it),but only the "raw" parameters. This is the device that I want to assign to qemu : marietto# lspci 05:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8192EE PCIe Wireless Network Adapter According with this post : https://unix.stackexchange.com/questions/96606/qemu-arm-how-to-passthrough-a-pci-card I've added the parameter "device pci-assign,host=05:00.0",like this : /usr/local/bin/qemu-system-x86_64 -machine pc-q35-9.1 -cpu max -m size=4292608k \ -vga std \ -drive file=/mnt/zroot2/zroot2/bhyve/img/Android/Android-qemu.img,format=raw \ -smp 4,sockets=4,cores=1,threads=1 -no-user-config -nodefaults \ -rtc base=utc,driftfix=slew \ -device pcie-root-port,port=16,chassis=1,id=pci.1,bus=pcie.0,multifunction=true,addr=0x2 \ -device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \ -device pcie-root-port,port=17,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x1 \ -device pcie-root-port,port=18,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x2 \ -device pcie-root-port,port=19,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x3 \ -device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \ -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=true,addr=0x1d \ -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x1d.0x1 \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \ -device ich9-ahci,id=sata \ -netdev tap,id=hostnet0,ifname=tap13,script=no,downscript=no \ -device e1000,netdev=hostnet0,mac=52:54:00:a3:e1:52 \ -device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 \ > -device pci-assign,host=05:00.0 \ -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial,index=0 \ -drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd \ qemu-system-x86_64: -device pci-assign,host=05:00.0: 'pci-assign' is > not a valid device model name Probably pci-assign is not a valid parameter anymore for the version of qemu that I'm using ? this one : marietto# qemu-system-x86_64 --version QEMU emulator version 9.1.0 Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers I have to say that if I boot the vm using bhyve instead of qemu,using these parameters,it is able to connect to internet,so the PCI-e device is recognized : bhyve-lin -S -c sockets=2,cores=1,threads=1 -m 4G -w -H -A \ -s 0,hostbridge \ -s 1,ahci-hd,/mnt/zroot-133/bhyve/img/Android/Android-qemu.img,bootindex=1 \ > -s 8:0,passthru,5/0/0 \ -s 11,hda,play=/dev/dsp,rec=/dev/dsp \ -s 13,virtio-net,tap13 \ -s 29,fbuf,tcp=0.0.0.0:5913,w=1600,h=950,wait \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd \ vm0:13 < /dev/null & sleep 5 && vncviewer 0:13 && echo vncviewer 0:13 & I think that's only a matter of finding the correct syntax. Please,help me, thanks.
Asked by Marietto (579 rep)
Dec 29, 2024, 10:16 PM
Last activity: Dec 29, 2024, 10:31 PM