Ошибка запуска requested operation is not valid network default is not active

I use Virtual Machine Manager (virt-manager).

  • Host: Ubuntu 18.04.
  • Guest: Windows.

After first shutdown I can’t start it. I get this error message:

Error starting domain: Requested operation is not valid: network 'default' is not active

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn

I use Virtual Machine Manager (virt-manager).

  • Host: Ubuntu 18.04.
  • Guest: Windows.

After first shutdown I can’t start it. I get this error message:

Error starting domain: Requested operation is not valid: network 'default' is not active

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn

Run the steps below if you ever get this message:

ERROR    Requested operation is not valid: network 'default' is not active

Steps

Stage 1

First check if you have the network defined by running:

sudo virsh net-list --all

If you got the following output then proceed to «Stage 1 — Create the Default Network». If you don’t and the network exists, proceed to «Stage 2 — Start and autostart the network».

 Name                 State      Autostart     Persistent
----------------------------------------------------------

Stage 1 — Create the Default Network

Create the default network by copy-pasting the following lines into a file called default.xml.

<network>
  <name>default</name>
  <uuid>9a05da11-e96b-47f3-8253-a3a482e445f5</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:0a:cd:21'/>
  <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>

Now to add that network permanently to our KVM host, run the following:

sudo virsh net-define --file default.xml

Stage 2 — Start and autostart the network

To manually start the network run:

sudo virsh net-start default

To have the network automatically start up in future run:

sudo virsh net-autostart --network default

Debugging

Failed To Initializae Firewall Backend

Kris Maussen has kindly pointed out in the comments that if you get the following error messages:

error: Failed to start network default
error: internal error: Failed to initialize a valid firewall backend

You will need to install firewalld.

sudo apt update && sudo apt install firewalld -y

Now run the following commands in order to enable the service and make networking work again:

sudo systemctl enable --now firewalld
sudo systemctl restart libvirtd

DnsMasq Issue

If you get the following error:

error: Failed to start network default
error: Cannot check dnsmasq binary /usr/sbin/dnsmasq: No such file or directory

Just install dnsmasq.

sudo apt-get install dnsmasq -y

Last updated: 16th September 2021
First published: 16th August 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Minikube version (use minikube version): v0.12.2

Environment:

  • OS (e.g. from /etc/os-release): Debian GNU/Linux stretch/sid
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): kvm
  • Docker version (e.g. docker -v): 1.12.3
  • Install tools: ???
  • Others:

What happened:

# minikube start 
                 --vm-driver=kvm 
                 --container-runtime=rkt
[... failed ...]
# sudo apt install libvirt-clients
[...]
# minikube start 
                 --vm-driver=kvm 
                 --container-runtime=rkt
[... failed ...]
# sudo apt install libvirt-daemon libvirt-daemon-system
[...]
[libvirtd could not access KVM, due to permission issues, thus:]
# reboot
[...]
# minikube start 
                 --vm-driver=kvm 
                 --network-plugin=cni 
                 --container-runtime=rkt 
                 --iso-url=http://storage.googleapis.com/minikube/iso/buildroot/minikube-v0.0.6.iso
Starting local Kubernetes cluster...
Downloading Minikube ISO
 68.79 MB / 68.79 MB [==============================================] 100.00% 0s
E1118 13:37:13.086967    7590 start.go:92] Error starting host: Error creating host: Error creating machine: Error in driver during machine creation: [Code-55] [Domain-19] Requested operation is not valid: network 'default' is not active. Retrying.
E1118 13:37:13.087235    7590 start.go:98] Error starting host:  Error creating host: Error creating machine: Error in driver during machine creation: [Code-55] [Domain-19] Requested operation is not valid: network 'default' is not active
================================================================================
An error has occurred. Would you like to opt in to sending anonymized crash
information to minikube to help prevent future errors?
To opt out of these messages, run the command:
        minikube config set WantReportErrorPrompt false
================================================================================
Please enter your response [Y/n]:

Please note that I never get a chance to actually respond to the «report error» question. The console prompt was already flashing on the next line, which leads me to believe that the report was sent without my consent.

What you expected to happen:

Minikube should have started Kubernetes using KVM and created any missing networks.

How to reproduce it (as minimally and precisely as possible):

Hopefully the information given above is enough to reproduce it on a Debian 9.0 «Stretch» installation.

Anything else do we need to know:

There appear to be no networks configured in libvirt right now:

# virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------

21.Jul.2015

"Error starting domain: internal error Network 'default' is not active."

how to permanently fix it:

su - root; # become root
virsh net-start default
virsh net-autostart default

Details:

Error starting domain: Requested operation is not valid: network ‘default’ is not active

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 127, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/domain.py", line 1355, in startup
self._backend.create()
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1029, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Requested operation is not valid: network 'default' is not active
  • print 
  • email 
  • share 
  • share 
  • share 
  • share  
  • share  
  • tweet 
  • share 

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!

  • Ошибка запуска point blank
  • Ошибка запуска open server
  • Ошибка запуска office 0xc0000142
  • Ошибка запуска nvidia control panel
  • Ошибка запуска no launcher medal of honor airborne