Skip to content

implement network driver on macOS

Description:
Using the 6.7.0 build from Homebrew on macOS, it doesn't seem to be possible to list nor add network configurations due to driver errors.

Replication:
Install libvirt from Homebrew and try to interact with any network settings.

$ brew install libvirt
$ sudo brew services start libvirt # starts successfully
$ sudo virsh -c qemu:///system net-list --all
error: Failed to get the number of active networks
error: this function is not supported by the connection driver: virConnectNumOfNetworks

Similarly, when trying to add any virtual network via virt-manager GUI (available for macOS here), another driver error is thrown:

Error creating virtual network: this function is not supported by the connection driver: virNetworkDefineXML

Based on this old issue with a similar error message, I tried brew edit libvirt, adding -Ddriver_network=enabled to the compile flags and then rebuilding via brew uninstall --ignore-dependencies libvirt && brew install -s libvirt, but the issue persists.

Context:
macOS version: tested both 10.13.6 (High Sierra) and 10.14.6 (Mojave)
libvirt version: 6.7.0 (from Homebrew)
libvirt build arguments: please see the Homebrew formula definition
virsh output:

$ virsh -V
Virsh command line tool of libvirt 6.7.0
See web site at https://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM VMware VirtualBox ESX Test
 Networking: Remote Bridging
 Storage: Dir
 Miscellaneous: Daemon Secrets Debug Readline

Additional notes:
It's beyond cool that libvirt supports macOS as well, very thankful for all of your work.

Edited by Peter Krempa
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information