# Libvirt shuts down when networkmanager loses connection?

## acidtonic

I have been trying to figure out an issue that is bothering me.

I am using VM's to run certain applications over X11 tunneling. I've defined a basic NAT network which is shared between my VM's and the host. 

Yet when my workstation loses network connectivity, libvirt shuts down my guest VM's and refuses to let me restart them. Saying "Networkmanager is inactive". Once I plug in network manager gets an IP the VM's immediately start on their own again.

I looked around in the /etc/init.d/libvirt script but I see nothing tying this to networking. It's to the point where I cannot use WIFI because if the connection is lost my programs come crashing down as libvirt shuts off.

This is TOTALLY unacceptable and I'm amazed that it's a default behavior for a workstation! I'd rather my VM's lose a bit of network connectivity to the outside world instead of suspending everything. 

Please help  :Smile: .

----------

## eccerr0r

Curious, are you using systemd here?

Agreed that's pretty crappy behavior here...

----------

## acidtonic

This is with the default rc-init.

```

USE="-bindist mmx sse sse2 sse3 ssse3 sse4_1 avx avx2 ncurses ssl vnc truetype smp lm_sensors crypt bash_completion X acpi alsa udev vim-syntax dbus lock python aac a52 xv zlib networkmanager ncurses icu xinerama lvm parted device-mapper virt-network virtio consolekit policykit pam"

```

```

# rc-update 

       NetworkManager |      default                 

             bootmisc | boot                         

           consolekit |      default                 

                 dbus |      default                 

                devfs |                       sysinit

                dmesg |                       sysinit

                 fsck | boot                         

             hostname | boot                         

              hwclock | boot                         

              keymaps | boot                         

            killprocs |              shutdown        

             libvirtd | boot default                 

                local |      default                 

           localmount | boot                         

             loopback | boot                         

                  lvm | boot                         

              metalog |      default                 

              modules | boot                         

             mount-ro |              shutdown        

                 mtab | boot                         

             netmount |      default                 

               procfs | boot                         

                 root | boot                         

            savecache |              shutdown        

                 sshd |      default                 

                 swap | boot                         

            swapfiles | boot                         

               sysctl | boot                         

                sysfs |                       sysinit

         termencoding | boot                         

         tmpfiles.dev |                       sysinit

       tmpfiles.setup | boot                         

                 udev |      default          sysinit

           udev-mount |                       sysinit

              urandom | boot  
```

----------

## DirectXMan12

I've been having this problem, and I finally tracked it down.

Check your /etc/conf.d/libvirtd file -- there's a line that adds "net" as a custom dependency, like you would in /etc/rc.conf

You can just comment that out, and you should be all set.

Best Regards,

Solly (directxman12)

----------

