Solved vm-bhyve - does't work PCI passthru

When I use vm-bhyve, my passthru device not connect to VM. My vm.conf have string: passthru0="2/0/3".

With old script device work in vm: -s 2:1,passthru,2/0/3 \

What I do wrong?
 
Does the vm still run or does bhyve exit with an error?

Can you post the lines from the guest's vm-bhyve.log that show the bhyveload/grub-bhyve command (if there is one), and the lines below that which show the bhyve command itself. (Also what FreeBSD version is it)
 
VM running without bhyve exit errors.
Code:
Jun 06 13:45:38: initialising
Jun 06 13:45:38:  [guest: linux]
Jun 06 13:45:38:  [loader: grub]
Jun 06 13:45:38:  [uefi: no]
Jun 06 13:45:38:  [cpu: 2]
Jun 06 13:45:38:  [memory: 4G]
Jun 06 13:45:38:  [hostbridge: standard]
Jun 06 13:45:38:  [com ports: com1]
Jun 06 13:45:38:  [uuid: e85382ba-2bb3-11e6-a8a6-288023a946e0]
Jun 06 13:45:38:  [utctime: no]
Jun 06 13:45:38:  [debug mode: no]
Jun 06 13:45:38:  [primary disk: bitryx.img]
Jun 06 13:45:38:  [primary disk dev: file]
Jun 06 13:45:38: booting
Jun 06 13:45:38: create file /vm/bitryx/device.map
Jun 06 13:45:38:  -> (hd0) /vm/bitryx/bitryx.img
Jun 06 13:45:38: /usr/local/sbin/grub-bhyve -c /dev/nmdm0A -m /vm/bitryx/device.map -M 4G -r hd0,1 bitryx
Jun 06 13:45:41:  [bhyve options: -c 2 -m 4G -AHP -U e85382ba-2bb3-11e6-a8a6-288023a946e0]
Jun 06 13:45:41:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vm/bitryx/bitryx.img -s 5:3,passthru,2/0/3]
Jun 06 13:45:41:  [bhyve console: -l com1,/dev/nmdm0A]
Jun 06 13:45:41: starting bhyve

Maybe, trouble in ID 5:3? Before in script I set id to 2:3, other id's may not work.
 
I'm also wondering if it doesn't like 5:3.
With your original script did you have something in slot 2:0? I did note in the code that I'm not sure if the devices have to start at X:0, X:1, etc, but I've never been able to test passthru myself.

I've added a fix to 1.0 and 1.1 on GitHub that should put the device on 5:0 instead, although you'd need to download the code from GitHub or patch it manually if you're willing to try it out.
 
What's the version of FreeBSD and vm-bhyve?
Code:
# vm version
vm-bhyve: Bhyve virtual machine management v1.0-p2 (build 100010)

10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015

With your original script did you have something in slot 2:0?
In original script I use slot 2:3. I noticed that in different systems need to use different slots,since the slot that running in one system may not work in another.
 
I've added a fix to 1.0 and 1.1 on GitHub that should put the device on 5:0 instead
I made changes, the device works! (OS - Ubuntu 14.04). I will try vm-bhyve with guest on CentOS 6.7 with 3 passthru devices.
 
Back
Top