LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-02-2020, 01:37 PM   #1
caibbor
LQ Newbie
 
Registered: Dec 2009
Posts: 27

Rep: Reputation: 0
virsh / Failed to start network default


I've been scouring google for the past day trying to figure out why I can't create a default network for my linux guest. One source says the iptables error is harmless, but I still can't create a default network. What's going on here?

the default.xml didn't even exist on my filesystem, so I had to copy it from a forum.

Code:
# pwd
/usr/share/libvirt/networking

# virsh net-undefine default
Network default has been undefined

# virsh net-destroy default
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'

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

# cat default.xml
<network>
  <name>default</name>
  <uuid>afd4e923-66cb-45ca-9120-1e46e72899a3</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <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>

# virsh net-define default.xml
Network default defined from default.xml

# virsh net-autostart default
Network default marked as autostarted

# virsh net-start default
error: Failed to start network default
error: internal error: Failed to apply firewall rules /sbin/iptables -w --table filter --insert LIBVIRT_INP --in-interface virbr0 --protocol tcp --destination-port 67 --jump ACCEPT: iptables: No chain/target/match by that name.
Code:
# uname -a
Linux user-pc 5.3.0-45-generic #37-Ubuntu SMP Thu Mar 26 20:41:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/issue
Ubuntu 19.10 \n \l
 
Old 04-02-2020, 01:44 PM   #2
caibbor
LQ Newbie
 
Registered: Dec 2009
Posts: 27

Original Poster
Rep: Reputation: 0
Found the magic bullet. I think I just had to restart the libvertd service...

Code:
virsh net-undefine default
virsh net-destroy default
virsh net-list
systemctl enable --now libvirtd
systemctl enable virtlogd.socket
systemctl restart libvirtd.service
cat default.xml
virsh net-define default.xml
virsh net-autostart default
virsh net-start default
 
Old 12-14-2020, 06:45 AM   #3
Alessandro_Selli
LQ Newbie
 
Registered: Dec 2020
Posts: 1

Rep: Reputation: Disabled
Thank you!

Eight months later this post saved my day! No, what am I saying, my week!

virsh --version
6.7.0


Running on Debian 10.
Just a note: my default.xml was located in the directory /etc/libvirt/qemu/networks/, and it was erased by the command virsh net-destroy default.
Luckily I had an old one saved as /etc/libvirt/qemu/networks/default.xml.dpkg-old, which only differed from the original one by the interface's UUID and mac address.
So I only had to copy it into /etc/libvirt/qemu/networks/default.xml and run:

virsh net-define /etc/libvirt/qemu/networks/default.xml
virsh net-autostart default
virsh net-start default

to have the network back online!

Should it be handy to someone else, I'm copying it's content here:

<!--
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>df2e3516-fd39-9ac5-4df2-a6125fd75c7c</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='a0:47:01:d5:85:c6'/>
<ip address='192.168.0.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.0.2' end='192.168.0.254'/>
</dhcp>
</ip>
</network>

Last edited by Alessandro_Selli; 12-14-2020 at 12:03 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL - KVM - virsh failed to connect to the hypervisor isagarran Linux - Virtualization and Cloud 4 02-20-2020 06:34 AM
virsh failed to start domain zolainfo Linux - Virtualization and Cloud 1 07-15-2015 05:38 PM
libvirt/kvm: Enter passphrase during guest startup using virsh start <domain> druuna Linux - Virtualization and Cloud 0 09-29-2011 06:59 AM
LXer: Virsh (Libvirt 0.7.2) & managing PV DomUs on openSUSE 11.2 LXer Syndicated Linux News 0 01-10-2010 12:30 PM
Xen, xendomain and virsh matiasquestions Linux - Software 0 12-04-2007 12:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration