libvirt network error - no 'default' network device found

53,715

Solution 1

List available networks and specify the one you need:

virsh net-list

You can use virt-manager GUI too.

Solution 2

list files in

/etc/libvirt/qemu/networks/

and

/etc/libvirt/qemu/networks/autostart/

if empty - create it

useful commands:

virsh net-start default

or

virsh net-autostart default

and

virsh net-destroy default
virsh net-undefine default
service libvirtd restart

for detailed explanation read wiki: http://wiki.libvirt.org/page/Networking

Solution 3

This is actually expected behaviour it seems .. something to do with how NAT forwarding is set-up by default. The system expects a 'default' network, bound to virbr0. So, if you delete that network, virt-install would no longer run as expected.

You probably can work around this if you are willing to poke around the innards of libvirt config files, and modify all relevant configuration file defaults. The error message can also be made more useful and explanatory ..

To recreate the network, first move off the network currently assigned to virbr0, and then:

# virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml
# virsh net-autostart default
Network default marked as autostarted
# virsh net-start default
Network default started`

Of course, you can also recreate the 'default' network via the virt-manager or other GUI ..

See more details here

Solution 4

You can start the default network by doing:

virsh net-start default

Solution 5

Simply requires, as above:

yum install libvirt-daemon-config-network

This will populate the files required... then execute the command:

virsh net-list

...then if the network isn't active

virsh net-start default
Share:
53,715

Related videos on Youtube

sparcboy
Author by

sparcboy

Just a DevOps, who's passionate about scaling and automation. Who doesn't want to do less job anyway? DevOps practices brought a new way to decrease maintenance for the whole company, which is basically increase of profit up to 80% in some cases! My background is mostly Python with HA web services. Currently working with Kubernetes and Terraform.

Updated on September 18, 2022

Comments

  • sparcboy
    sparcboy almost 2 years

    My original purpose is to create centos image for openstack. Although I did directly with kvm, still wondering about error.

    Was using this manual for my task.

    After this command:

    # virt-install --virt-type kvm --name centos-6.4 --ram 1024 \
    --cdrom=/data/isos/CentOS-6.4-x86_64-netinstall.iso \
    --disk /tmp/centos-6.4.qcow2,format=qcow2 \
    --network network=default \
    --graphics vnc,listen=0.0.0.0 --noautoconsole \
    --os-type=linux --os-variant=rhel6
    

    I got an error:

    ERROR    Error in network device parameters: Virtual network 'default' does not exist: Network not found: no network with matching name 'default'
    

    Needless to say that I'm using RDO. By default I don't have any pre-configured network devices for libvirt. Question is which networking devices are available? Or if there's none, how to create one? Maybe RDO has different approach on libvirt networking?

    • Lorin Hochstein
      Lorin Hochstein almost 11 years
      I proposed a documentation patch to document how to start the 'default' network if it isn't running: review.openstack.org/44784
  • sparcboy
    sparcboy almost 11 years
    seems to be there's no any in there.. how can I add one..? RDO seems to be using bridge interface. actually launching this container directly from qemu it works. Wondering why it's not working for virsh.
  • GioMac
    GioMac almost 11 years
    p.s. RDO/Openstack is quite complicated system, it puts all the data to it's db, etc
  • GioMac
    GioMac almost 11 years
    virt-install uses libvirt, if virsh doesn't show you anything about it, then it wont do anything. you can create network with virt-manager, or virsh net-create: libvirt.org/sources/virshcmdref/html/sect-net-create.html
  • sparcboy
    sparcboy almost 11 years
    ok i've changed network option with this and it's working --network=bridge=br100,mac=22:44:66:EE:EF:1F specified my bridge device which was created by RDO, and random mac address. not sure if internet will work inside vm, but I need virsh only for using virt-sysprep tool