View previous topic :: View next topic |
Author |
Message |
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Wed May 01, 2024 7:33 pm Post subject: Error starting network 'default': Unable to create bridge vi |
|
|
From virt-manager
Error starting network 'default': Unable to create bridge virbr0: Package not installed
From terminal:
$ sudo virsh net-start default
error: Failed to start network default
error: Unable to create bridge virbr0: Package not installed
$ virsh net-start default
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'
Please throw me a bone on how to approach this problem.
I am trying to get QEMU working with VIRT-MANAGER to run Linux VMS (Redhat, Centos) _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1910
|
Posted: Wed May 01, 2024 7:49 pm Post subject: |
|
|
What are the USE flags on app-emulation/libvirt? At minimum, the libvirtd and virt-network USE are required for the default network to exist.
In addition, ensure the libvirtd service is started at boot time (both OpenRC and systemd). |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Wed May 01, 2024 8:50 pm Post subject: |
|
|
grknight wrote: | What are the USE flags on app-emulation/libvirt? At minimum, the libvirtd and virt-network USE are required for the default network to exist.
In addition, ensure the libvirtd service is started at boot time (both OpenRC and systemd). |
Thank you. I'm using openrc.
I restarted libvirtd and it is set to start on boot.
Is there a config file I need to edit?
I am also going to check to make sure I have the kernel flags set from this doc: https://wiki.gentoo.org/wiki/Libvirt
Code: |
emerge -pv app-emulation/libvirt
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 7.79 s (backtrack: 0/20).
[ebuild R ] app-emulation/libvirt-9.8.0-r2:0/9.8.0::gentoo USE="caps libvirtd nls policykit qemu udev virt-network -apparmor -audit -bash-completion -dtrace -firewalld -fuse -glusterfs -iscsi -iscsi-direct -libssh -libssh2 -lvm -lxc -nfs -numa (-openvz) -parted -pcap -rbd -sasl (-selinux) -test -verify-sig -virtualbox -wireshark-plugins -xen -zfs" 0 KiB
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1910
|
Posted: Wed May 01, 2024 11:04 pm Post subject: |
|
|
What is in /etc/libvirt/qemu/networks/ ? This should include a default.xml which should be valid xml and libvirt can start. |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Thu May 02, 2024 12:09 am Post subject: |
|
|
grknight wrote: | What is in /etc/libvirt/qemu/networks/ ? This should include a default.xml which should be valid xml and libvirt can start. |
thank you . this would be a NAT. I'm 192.168.1.x
I'm recompiling my kernel right now.
Code: |
pwd
/etc/libvirt/qemu/networks
cwc@yoda /etc/libvirt/qemu/networks $ sudo more default.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh net-edit default
or other application using the libvirt API.
-->
<network>
<name>default</name>
<uuid>23ac86af-2995-420d-9dad-da65db9a0646</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:c1:de:1b'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Thu May 02, 2024 2:44 pm Post subject: |
|
|
recompiled kernel
reinstalled packages
Now I get a usb error from virt-manager
Unable to complete install: 'unsupported configuration: USB redirection is not supported by this version of QEMU' _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22619
|
Posted: Thu May 02, 2024 3:33 pm Post subject: |
|
|
Did you set the relevant USE flags on qemu? usb and usbredir look like good candidates. |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Thu May 02, 2024 5:40 pm Post subject: |
|
|
Hu wrote: | Did you set the relevant USE flags on qemu? usb and usbredir look like good candidates. |
reinstalled qemu
still no luck .
Code: |
yoda /etc/libvirt # virsh list
Id Name State
--------------------
yoda /etc/libvirt # virsh net-list
Name State Autostart Persistent
----------------------------------------
yoda /etc/libvirt # virsh net-start default
error: Failed to start network default
error: Unable to create bridge virbr0: Package not installed
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1910
|
Posted: Thu May 02, 2024 5:50 pm Post subject: |
|
|
What does virsh net-list --all report? |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Thu May 02, 2024 7:26 pm Post subject: |
|
|
grknight wrote: | What does virsh net-list --all report? |
thank you
# virsh net-list --all
Name State Autostart Persistent
----------------------------------------------
default inactive yes yes _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Thu May 02, 2024 9:40 pm Post subject: |
|
|
cwc wrote: | Hu wrote: | Did you set the relevant USE flags on qemu? usb and usbredir look like good candidates. |
reinstalled qemu
still no luck .
Code: |
yoda /etc/libvirt # virsh list
Id Name State
--------------------
yoda /etc/libvirt # virsh net-list
Name State Autostart Persistent
----------------------------------------
yoda /etc/libvirt # virsh net-start default
error: Failed to start network default
error: Unable to create bridge virbr0: Package not installed
|
|
The error was not relate to qemu, but libvirt. it is because the "bridge" kernel module is not avaliable. So you either need to load "bridge" module by "modprobe bridge" or rebuild kernel with "bridge" module compiled in (or as module) if not previously configured) |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Thu May 02, 2024 10:20 pm Post subject: |
|
|
pingtoo wrote: |
The error was not relate to qemu, but libvirt. it is because the "bridge" kernel module is not avaliable. So you either need to load "bridge" module by "modprobe bridge" or rebuild kernel with "bridge" module compiled in (or as module) if not previously configured) |
Thank you
I have <*> 802.1d Ethernet Bridging set in the kernel not as a module
Do I follow this doc: https://wiki.gentoo.org/wiki/Network_bridge ?
Code: | FILE /etc/conf.d/netAdd bridge device example
# Set up the initial layer 2 bridge interface
bridge_br0="enp1s0 enp2s0"
# Bridge static config
config_br0="192.168.26.199 netmask 255.255.255.0"
routes_br0="default via 192.168.26.254"
bridge_forward_delay_br0=0
bridge_hello_time_br0=1000
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Fri May 03, 2024 2:44 pm Post subject: |
|
|
cwc,
Not yet. let's test some more before we go there.
From the execution path I learned from source code, it seems to unlikely you will get "Package not installed" if your running kernel actually have the "bridge" module loaded.
Here is the execution path I learned
https://github.com/libvirt/libvirt/blob/9804ded60f769b7875b689eecd73364b251c9beb/src/util/virnetdevbridge.c#L405: |
#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR)
static int
virNetDevBridgeCreateWithIoctl(const char *brname,
const virMacAddr *mac)
{
VIR_AUTOCLOSE fd = -1;
if ((fd = virNetDevSetupControl(NULL, NULL)) < 0)
return -1;
if (ioctl(fd, SIOCBRADDBR, brname) < 0) {
virReportSystemError(errno,
_("Unable to create bridge %1$s"), brname);
return -1;
}
if (virNetDevSetMAC(brname, mac) < 0) {
virErrorPtr savederr;
virErrorPreserveLast(&savederr);
ignore_value(ioctl(fd, SIOCBRDELBR, brname));
virErrorRestore(&savederr);
return -1;
}
return 0;
} |
And the linux ioctl call https://github.com/torvalds/linux/blob/f03359bca01bf4372cf2c118cd9a987a5951b1c8/net/socket.c#L1185: | int br_ioctl_call(struct net *net, struct net_bridge *br, unsigned int cmd,
struct ifreq *ifr, void __user *uarg)
{
int err = -ENOPKG;
if (!br_ioctl_hook)
request_module("bridge");
mutex_lock(&br_ioctl_mutex);
if (br_ioctl_hook)
err = br_ioctl_hook(net, br, cmd, ifr, uarg);
mutex_unlock(&br_ioctl_mutex);
return err;
} | The "if (br_ioctl_hook) ... not true will lead to the err=-ENOPKG
That seems the only reason you will get the message "error: Unable to create bridge virbr0: Package not installed"
I think (I don't use libvirt) the errors you got is because libvirt is responsible create the bridge interface ahead of qemu execution, so lets try to focus on that first.
I would like to verify that bridge interface can actually be created from command line.
Code: | ip link add name virbr0 address 192.168.122.1 broadcast 192.168.122.255 type bridge | If this command successfully return ($? == 0)
Try command Code: | ip link show type bridge | Please share output
If all these commands work, then I need to dig more into source to understand why virsh net-start default failed
To delete the command line test created virbr0 use command
If the test bridge create failed, we need to see if the running kernel actually have the "bridge" module loaded by using Code: | namei /sys/module/bridge | if the return is Code: | f: /sys/module/bridge
d /
d sys
d module
d bridge | May be also examine dmesg to see if there is any messages related to the bridge module.
if the namei command did not give you the output above than your running kernel does not have the "bridge" module. so you need to examine what you need to do in order to get the right kernel.
If namei command come out OK, then most likely the libvirt package have something wrong, it could be the libvirt use dev-libs/libnl is buggy need to rebuild.
There are many thing need to examine if kernel is OK, so let's dig deep when we got confirmation that kernel is good. |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1364 Location: Tri-Cities, WA USA
|
Posted: Fri May 03, 2024 4:11 pm Post subject: |
|
|
pingtoo,
Thank you so much. This will take me a while. Lots to test and read.
I am starting from scratch. I am recompiling my kernel with the .config prior to setting up KVM.
I'm going to read and research before I dive in. _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1238 Location: Richmond Hill, Canada
|
Posted: Fri May 03, 2024 4:53 pm Post subject: |
|
|
cwc.
You are welcome.
Take as long as you want. Should you need more information I will be happy to check around to see if I can find them. |
|
Back to top |
|
|
|