Rand0mUser
Dabbler
- Joined
- Jun 1, 2019
- Messages
- 22
Hello,
I know this is something already discussed in many threads, but I searched a lot and didn't find any real working solution so I created a new thread.
I want to use a Z-Wave USB device with a domotic automation system running into a VM. The debian based VM was built using the UI, I'm running FreeNAS 11.2-U5.
I found this thread about virtualhere but it is not relevant since it won't work with USB device plugged in the mobo running FreeNAS. It needs to run the virtualhere server in other machine.
I tried following instructions here for bhyve PCI Passthrough. I started to have trouble at step 5 about the slot option, because I can't really pass it to bhyve since the VM was created from UI, and is started automatically by the FreeNAS system. I found the bhyve command used to launch the VM in the file /var/log/middlewared.log as described in this thread: How do you start/stop VMs from shell?. So in my case, command was:
My PCI parameters were as following (I'm trying to pass through the whole PCI USB controller to the VM):
so I added it to the bhyve command:
Using this whole command:
Then I get "passthru requires guest memory to be wired " error. I tried adding -S as explained here: Not working with pci passthru. VM could not start, and when I tried again same bhyve command the FreeNAS get freezed and I had to hard reset the server.
Here is where I am so far, I set up loader.conf options directly from the UI in Tunables like that:
So at boot my PCI USB controller is recognized from this:
xhci0@pci0:0:20:0: class=0x0c0330 card=0xa12f1849 chip=0xa12f8086 rev=0x31 hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
to this:
ppt0@pci0:0:20:0: class=0x0c0330 card=0xa12f1849 chip=0xa12f8086 rev=0x31 hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
I tried what's explained here: USB 3.0 PCI Controller Pass through (I didn't disable xhci driver in the kernel since I don't think this is mandatory), but I noticed this only seems to work if the VM was created using iohyve. Problem is since my VM was created from the UI, iohyve just don't see it:
So obviously there is no way that I can pass the PCI controller to the VM using iohyve command such as
So I guess this "could" work if I create a VM using iohyve but I didn't tried yet. Is there any way to pass the PCI device to the VM which was created from the FreeNAS GUI? I really want my system to stay as clean as possible, I don't want to wreck my install. Is there any way that iohyve can see the VM which was created from the GUI?
I know this is something already discussed in many threads, but I searched a lot and didn't find any real working solution so I created a new thread.
I want to use a Z-Wave USB device with a domotic automation system running into a VM. The debian based VM was built using the UI, I'm running FreeNAS 11.2-U5.
I found this thread about virtualhere but it is not relevant since it won't work with USB device plugged in the mobo running FreeNAS. It needs to run the virtualhere server in other machine.
I tried following instructions here for bhyve PCI Passthrough. I started to have trouble at step 5 about the slot option, because I can't really pass it to bhyve since the VM was created from UI, and is started automatically by the FreeNAS system. I found the bhyve command used to launch the VM in the file /var/log/middlewared.log as described in this thread: How do you start/stop VMs from shell?. So in my case, command was:
Code:
bhyve -A -H -w -c 2 -m 1024 -s 0:0,hostbridge -s 31,lpc -l com1,/dev/nmdm2A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 4,e1000,tap0,mac=00:a0:98:xx:xx:xx -s 29,fbuf,vncserver,tcp=192.168.1.xx:6416,w=1024,h=768,,wait -s 30,xhci,tablet -s 3:0,ahci,cd:/mnt/pool1raidz_9tb/9TB_dataset/Systemes-d-exploitation,hd:/dev/zvol/pool1raidz_9tb/Jeedom-thcz47 2_Jeedom_VM
My PCI parameters were as following (I'm trying to pass through the whole PCI USB controller to the VM):
Code:
pptdevs="0/20/0"
so I added it to the bhyve command:
Code:
bhyve -s 7,passthru,0/20/0
Using this whole command:
Code:
bhyve -A -H -w -c 2 -m 1024 -s 0:0,hostbridge -s 31,lpc -s 7,passthru,0/20/0 -l com1,/dev/nmdm2A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 4,e1000,tap0,mac=00:a0:98:xx:xx:xx -s 29,fbuf,vncserver,tcp=192.168.1.xx:6416,w=1024,h=768,,wait -s 30,xhci,tablet -s 3:0,ahci,cd:/mnt/pool1raidz_9tb/9TB_dataset/Systemes-d-exploitation,hd:/dev/zvol/pool1raidz_9tb/Jeedom-thcz47 2_Jeedom_VM
Then I get "passthru requires guest memory to be wired " error. I tried adding -S as explained here: Not working with pci passthru. VM could not start, and when I tried again same bhyve command the FreeNAS get freezed and I had to hard reset the server.
Here is where I am so far, I set up loader.conf options directly from the UI in Tunables like that:
So at boot my PCI USB controller is recognized from this:
xhci0@pci0:0:20:0: class=0x0c0330 card=0xa12f1849 chip=0xa12f8086 rev=0x31 hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
to this:
ppt0@pci0:0:20:0: class=0x0c0330 card=0xa12f1849 chip=0xa12f8086 rev=0x31 hdr=0x00
vendor = 'Intel Corporation'
device = 'Sunrise Point-H USB 3.0 xHCI Controller'
class = serial bus
subclass = USB
I tried what's explained here: USB 3.0 PCI Controller Pass through (I didn't disable xhci driver in the kernel since I don't think this is mandatory), but I noticed this only seems to work if the VM was created using iohyve. Problem is since my VM was created from the UI, iohyve just don't see it:
Code:
root@freenas[~/scripts]# iohyve info -v -s -d Guest Size CPU RAM Pool OS Loader Tap Con VMM? Running rcboot? Description
So obviously there is no way that I can pass the PCI controller to the VM using iohyve command such as
Code:
iohyve set vmname pcidev:1=passthru,0/20/0
So I guess this "could" work if I create a VM using iohyve but I didn't tried yet. Is there any way to pass the PCI device to the VM which was created from the FreeNAS GUI? I really want my system to stay as clean as possible, I don't want to wreck my install. Is there any way that iohyve can see the VM which was created from the GUI?