You are not logged in.

#1 2015-06-17 03:53:41

shenhd
Member
Registered: 2015-06-17
Posts: 4

libvirt via virt-manager virtual network start failed

virt-manager v1.2.1
libvirtd v1.2.16

I tested firewall: iptables && ip6tables work well while.

when I start a virtual network named 'default' (created by libvirt), it occur that:
"Error starting network 'default': internal error: Failed to initialize a valid firewall backend".

thanks for any reply

Last edited by shenhd (2015-06-17 03:56:45)

Offline

#2 2015-06-17 14:37:03

Bestiapeluda
Member
From: Buenos Aires, Argentina
Registered: 2007-10-16
Posts: 180

Re: libvirt via virt-manager virtual network start failed

I'm having exactly the same problem.

Offline

#3 2015-06-18 14:34:11

rob356
Member
Registered: 2010-12-31
Posts: 8

Re: libvirt via virt-manager virtual network start failed

I had the same problem, but with vagrant and the libvirt provider. I fixed it temporarily by re-building libvirt with a patch that removes the code that throws that error. It looks like in an attempt to fix this bug they went overboard checking if a valid firewall backend was loaded. I commented out that section and everything seems to work fine. Obviously this is not a permanent fix, but I don't know enough about libvirt's codebase to fix it properly. Anyways here is the patch:

--- libvirt-1.2.16.orig/src/util/virfirewall.c  2015-05-23 08:56:12.000000000 -0400
+++ libvirt-1.2.16.new/src/util/virfirewall.c   2015-06-18 10:01:51.954157612 -0400
@@ -932,14 +932,14 @@
 
     virMutexLock(&ruleLock);
 
-    if (currentBackend == VIR_FIREWALL_BACKEND_AUTOMATIC) {
+//    if (currentBackend == VIR_FIREWALL_BACKEND_AUTOMATIC) {
         /* a specific backend should have been set when the firewall
          * object was created. If not, it means none was found.
          */
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Failed to initialize a valid firewall backend"));
-        goto cleanup;
-    }
+//        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+//                       _("Failed to initialize a valid firewall backend"));
+//        goto cleanup;
+//    }
     if (!firewall || firewall->err == ENOMEM) {
         virReportOOMError();
         goto cleanup;

Offline

#4 2015-06-18 15:39:52

Basic-Master
Member
Registered: 2007-10-30
Posts: 21

Re: libvirt via virt-manager virtual network start failed

Had the same problem, but I was able to fix it. Just install the dependencies required by firewalld and that error message is hopefully gone wink IIRC you need iptables and ebtables, and perhaps a few more...

Offline

#5 2015-06-23 10:00:47

shenhd
Member
Registered: 2015-06-17
Posts: 4

Re: libvirt via virt-manager virtual network start failed

Basic-Master wrote:

Had the same problem, but I was able to fix it. Just install the dependencies required by firewalld and that error message is hopefully gone wink IIRC you need iptables and ebtables, and perhaps a few more...

thx!!! The problem is solved.

Offline

#6 2015-06-23 10:01:55

shenhd
Member
Registered: 2015-06-17
Posts: 4

Re: libvirt via virt-manager virtual network start failed

rob356 wrote:

I had the same problem, but with vagrant and the libvirt provider. I fixed it temporarily by re-building libvirt with a patch that removes the code that throws that error. It looks like in an attempt to fix this bug they went overboard checking if a valid firewall backend was loaded. I commented out that section and everything seems to work fine. Obviously this is not a permanent fix, but I don't know enough about libvirt's codebase to fix it properly. Anyways here is the patch:

--- libvirt-1.2.16.orig/src/util/virfirewall.c  2015-05-23 08:56:12.000000000 -0400
+++ libvirt-1.2.16.new/src/util/virfirewall.c   2015-06-18 10:01:51.954157612 -0400
@@ -932,14 +932,14 @@
 
     virMutexLock(&ruleLock);
 
-    if (currentBackend == VIR_FIREWALL_BACKEND_AUTOMATIC) {
+//    if (currentBackend == VIR_FIREWALL_BACKEND_AUTOMATIC) {
         /* a specific backend should have been set when the firewall
          * object was created. If not, it means none was found.
          */
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Failed to initialize a valid firewall backend"));
-        goto cleanup;
-    }
+//        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+//                       _("Failed to initialize a valid firewall backend"));
+//        goto cleanup;
+//    }
     if (!firewall || firewall->err == ENOMEM) {
         virReportOOMError();
         goto cleanup;

thx! however, @Basic-Master 's solution is better.

Offline

#7 2015-07-21 16:19:40

mostafaa91
Member
Registered: 2015-07-21
Posts: 3

Re: libvirt via virt-manager virtual network start failed

Can you please tell me which dependencies were that ?
cause i have these installed and i am still facing the same problem

Thank you

Offline

#8 2015-07-21 16:23:47

shenhd
Member
Registered: 2015-06-17
Posts: 4

Re: libvirt via virt-manager virtual network start failed

mostafaa91 wrote:

Can you please tell me which dependencies were that ?
cause i have these installed and i am still facing the same problem

Thank you

you should install firewalld, and start it. It will work!!! :-)

Offline

#9 2015-07-22 06:09:31

mostafaa91
Member
Registered: 2015-07-21
Posts: 3

Re: libvirt via virt-manager virtual network start failed

shenhd wrote:
mostafaa91 wrote:

Can you please tell me which dependencies were that ?
cause i have these installed and i am still facing the same problem

Thank you

you should install firewalld, and start it. It will work!!! :-)

Thanks for answering smile

But the problem seems to be the same :

╰─$ systemctl status firewalld                                                                                                                                                                                                                                                1 ↵
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2015-07-22 08:00:06 EET; 40s ago
Main PID: 27760 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─27760 /usr/bin/python -Es /usr/bin/firewalld --nofork --nopid

Jul 22 08:00:06 St0rM.local systemd[1]: Starting firewalld - dynamic firewall daemon...
Jul 22 08:00:06 St0rM.local systemd[1]: Started firewalld - dynamic firewall daemon.

╭─root@St0rM  ~ 
╰─$ virsh net-start default                                                                                                                                                                                                                                                   1 ↵
error: Failed to start network default
error: internal error: Failed to initialize a valid firewall backend

Offline

#10 2015-07-22 07:48:00

rubenvb
Member
Registered: 2011-01-14
Posts: 91

Re: libvirt via virt-manager virtual network start failed

Have you tried installing the libvirt server dependencies as mentioned on the Wiki?

# pacman -Syu ebtables dnsmasq

This did the trick for me. Make sure to restart the libvirtd service and virt-manager after installing these.

Offline

#11 2015-07-22 22:52:06

mostafaa91
Member
Registered: 2015-07-21
Posts: 3

Re: libvirt via virt-manager virtual network start failed

rubenvb wrote:

Have you tried installing the libvirt server dependencies as mentioned on the Wiki?

# pacman -Syu ebtables dnsmasq

This did the trick for me. Make sure to restart the libvirtd service and virt-manager after installing these.


Thank you , that seems to work just fine smile

Offline

Board footer

Powered by FluxBB