# bhyve and USB passthru



## pyret (Aug 22, 2018)

q


----------



## SirDice (Aug 22, 2018)

pyret said:


> To use the Ethernet devices inside bhyve I'd have to use passthru, but when running `pciconf -vl` I don't see the USB Ethernet devices specifically.


The name of the command should already give you a hint. It's to list PCI/PCIe devices, not USB devices.

Bhyve passthrough works for PCIe devices, not USB.

https://wiki.freebsd.org/bhyve/pci_passthru


----------



## sko (Aug 22, 2018)

You can only pass through the whole USB controller, as this is what connects to the PCI/e bus. This also works far better than the flaky USB-pass-through in VirtualBox or KVM.
Given USB NICs usually have terrible performance and no or hopelessly broken offloading capabilities, I'd just put another 2- or 4-port NIC into the system and use those for VMs. If bandwidt isn't a concern, just use the already present NIC(s) also for the VMs and if segregation is needed just use different VLANs.



pyret said:


> BTW, if nobody is aware, Joyent is working to port bhyve into SmartOS which will replace KVM as their method of virtualization.


It is available since ~February IIRC and works rather well. There were some small issues/limitations regarding paravirtualized networking, but they should be sorted out by now. I didn't had time since ~June to further evaluate bhyve on SmartOS, but I was running several FreeBSD Servers inside bhyve on SmartOS on a test server without any issues and with much less overhead than KVM. Even migrating KVM VMs to bhyve worked flawlessly for FreeBSD and OpenBSD. The main reason holding me back from switching our virtualization hosts to bhyve are the Windows VMs which completely blow up if you change the hypervisor (and I have better things to do than endlessly nursing a bunch of Windows boxes...)


----------

