bhyve Getting virt-manager to use bhyve

D

Deleted member 67862

Guest
I'd like to use Bhyve from virt-manager since its supposed to support Bhyve, but when I open it I'm greeted with the following:
Code:
Could not detect a default hypervisor. Make sure the appropriate QEMU/KVM virtualization packages are installed to manage virtualization on this host.

I can also try going into File -> Add Connection and choose Bhyve but it gives this traceback:

Code:
Unable to connect to libvirt bhyve:///system.

Verify that the 'libvirtd' daemon is running.

Libvirt URI is: bhyve:///system

Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtManager/connection.py", line 922, in _do_open
    self._backend.open(cb, data)
  File "/usr/local/share/virt-manager/virtinst/connection.py", line 153, in open
    conn = libvirt.openAuth(self._open_uri,
  File "/usr/local/lib/python3.8/site-packages/libvirt.py", line 148, in openAuth
    raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

Some folks recommend this to me as a good GUI frontend for Bhyve on FreeBSD but I always have this issue (and apparently others do too). Does anyone have any idea how to get it working?
 
Have a look at Phishfry's approach:
 
Okay so I learned a few things. Its related to these parameters in libvirtd.conf:
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"

I had managed to get the connection working (not networking) by changing the permissions of /var/run/libvirt/libvirt-sock myself. This is only temporary, and to change this permanently you're supposed to use libvirtd.conf but I still get this issue even with the two parameters above uncommented. I tried changing the sock group to wheel, but still had the same permission issue pasted in the original post.

Whenever I temporarily got it working, I couldn't fire up a VM because networking wouldn't work either. I tried to follow the pkg info instructions here:
To enable this network please do the following: cp /usr/local/share/examples/libvirt/networks/default.xml /usr/local/etc/libvirt/qemu/networks
To configure this network for autostart, execute the following: ln -s ../default.xml /usr/local/etc/libvirt/qemu/networks/autostart/default.xml

But no use.

Don't know if this works or not but it might be useful: https://people.freebsd.org/~rodrigc/libvirt/virt-manager.html
I saw this originally but I think its from 2014, whenever bhyve support was first added. Based on what I figured out above, I think its permission related but not sure how to fix.
 
Do you belong to the libvirt group? When I used qemu/kvm + virt-manager in linux I had to add the executing user = me to the libvirt group to run the vm.
 
Do you belong to the libvirt group? When I used qemu/kvm + virt-manager in linux I had to add the executing user = me to the libvirt group to run the vm.
Yes, I had to create the group but still had the issue.
 
I tried to follow the pkg info instructions here:
The networking section is where you must make decisions. Topology wise.
I dislike the bridge method but it does work.
I used e1000 driver and a dedicated motherboard interface.
I saw this originally but I think its from 2014
It's still somewhat valid. Maybe not the patches but the general scope.

Code:
virsh -c 'bhyve:///system' "define /tmp/bhyve.xml"
virsh -c 'bhyve:///system' "start --console bhyve"
Once you master the virsh console you are home free. Edit XML and restart VM.
You probably want your XML config in a more permanent location before running this.

Where I really had trouble is PCIe passthrough to libvirt. The XML syntax is unfamiliar to me.
I pass thought 4 port cards++ on bare bhyve. I could never figure out passthrough on libvirt.

One example is all I would like to see. I know it works as confirmed to me by a developer.
I never could coax a config from him.

Topic was more experiment for me.

What gets my goat is there is translator from XML to bhyve commands.
I need the opposite. native-to-domxml Please.
 
Can I say something controversial here.
Why in the world would a library require a dnsmasq?
libvirt requires dmsmasq. No compile config option.
How utterly ridiculous. It don't even need to be running?
I will bake my virtual network how I please thank you.
 
I tried to use their docs but they are Linux-centric
So hostdev type device and the bus and slot are in hex code.

And Redhat example is used in the docs.

How does any of this translate into FreeBSD ppt addresses like 2:0:0 ???
Is that Linux conversion of bus=0 and slot=2 function=0 ??
Maybe bus=2 slot=0 and function=0
I dunno and gave up after failure.
 
I wouldn't know. Im incredibly confused by all this. I just want a GUI vm, LOL.

Even Virtualbox is quite troublesome, the guest additions DVD never works in my experience and anything you look up online is about using FreeBSD as the guest, not as the host. Talk about neglecting a great desktop.
 
FreeBSD guests (if that's what you mean) are not intended to work with Oracle's distribution of the additions.
Ive only tried Windows guests, for example Windows 7. The Guest Additions DVD that Virtualbox downloaded resulted in an error halfway through the installation (on Windows 7).
 
Ive only tried Windows guests, for example Windows 7. The Guest Additions DVD that Virtualbox downloaded resulted in an error halfway through the installation (on Windows 7).
Well, this made me curious. I have just tried to install win 7 home premium (64bit) inside Virtualbox. In the end: It did work. Loading the guest additions, however, only worked halfway as you say. When loading a mouse driver it stops with an error message complaining about a missing certificate. But after rebooting, both - the mouse integration as well the screen resolutions - worked as expected. So, I would say this is most probably not a problem of the host operating system but rather a Virtualbox internal flaw.
 
Well, this made me curious. I have just tried to install win 7 home premium (64bit) inside Virtualbox. In the end: It did work. Loading the guest additions, however, only worked halfway as you say. When loading a mouse driver it stops with an error message complaining about a missing certificate. But after rebooting, both - the mouse integration as well the screen resolutions - worked as expected. So, I would say this is most probably not a problem of the host operating system but rather a Virtualbox internal flaw.
The one I tried was Windows 7 Ultimate. It also stopped on a mouse driver. On reboot, I can go up to like 1366x768 at most when I natively use 1920x1080. Also, 3D acceleration doesnt work so its really slow. I needed to use Visual Studio for school but I really didnt want to use the crappier versions.
 
I think I deciphered FreeBSD PCI buses shown in pciconf.
Lets use this stanza from pciconf -l
Code:
ath0@pci0:2:0:0
So according to the pciconf(8) manual
ath0=drv
pci0:2:0:0=unit number and selector.

From Bhyve PCI Passthru Wiki
The bus/slot/function is for this devices is 2/0/0 (from the end of 'alc0@pci0:2:0:0')
So from those sources I deduce:
ath0=drv
pci0=pci domain
2=bus
0=slot
0=function

So I will see how that works for passthru with libvirt XML file next chance I get.
 
Back
Top