Subject: : libvirt default Network State Mismatch and Autostart Issues on Arch Linux
Hi everyone,
I’m struggling to set up a virtual machine using virt-manager on Arch Linux with libvirt 11.3.0, and I’d really appreciate some help. Here’s a summary of my journey so far:
System Details
- OS: Arch Linux
- libvirt: 11.3.0
- Network Manager:
netctl(configured a bridge at/etc/netctl/bridge) - Wi-Fi Interface:
wlan0(doesn’t support 4-address mode, so switched to NAT networking) - Goal: Install a VM using
virt-managerwith thedefaultNAT network.
Timeline of Issues and Steps
-
Initial Setup:
- Enabled KVM (
sudo modprobe kvm-intel kvm), created anetctlbridge (/etc/netctl/bridge), and started/enabledlibvirtd. - Tried to start a VM in
virt-managerwith a bridge network, but got:Unable to add bridge wlan0 port vnet0: Operation not supported. - Confirmed via
iw listthatwlan0doesn’t support 4-address mode (Supported interface modes: IBSS, managed). - Switched to NAT networking using the
defaultnetwork.
- Enabled KVM (
-
NAT Network Failure:
- Attempted to start the VM with the
defaultNAT network, but got:Unable to complete install: 'Requested operation is not valid: network 'default' is not active'. - Found that the
defaultnetwork didn’t exist:virsh net-list --all # Showed nothing - Defined the
defaultnetwork using:virsh net-define /dev/stdin <<EOF <network> <name>default</name> <bridge name="virbr0" stp="on" delay="0"/> <forward mode="nat"/> <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> EOF
- Attempted to start the VM with the
-
Firewall Issues:
- Tried to start the
defaultnetwork:sudo virsh net-start default- Got errors:
error: error creating bridge interface virbr0: Operation not permittederror: internal error: firewalld can't find the 'libvirt' zone that should have been installed with libvirt
- Got errors:
- Confirmed
firewalldwas running and thelibvirtzone was missing:sudo firewall-cmd --get-active-zones # Only showed public (wlan0) - Tried to create the
libvirtzone:sudo firewall-cmd --permanent --new-zone=libvirt- Failed with
Error: NAME_CONFLICT: new_zone(): 'libvirt'.
- Failed with
- Found
libvirtis a built-in zone:sudo firewall-cmd --permanent --delete-zone=libvirt # Error: BUILTIN_ZONE: 'libvirt' is built-in zone
- Tried to start the
-
Service Restarts:
- Stopped and restarted services to reinitialize the
libvirtzone:sudo systemctl stop libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket sudo systemctl stop libvirtd sudo systemctl stop firewalld sudo systemctl start firewalld sudo systemctl start libvirtd - Successfully started the
defaultnetwork:sudo virsh net-start default # Network default started - Confirmed
virbr0was created:ip link show # 9: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
- Stopped and restarted services to reinitialize the
-
State Mismatch and Autostart Issues:
- Immediately after starting,
virsh net-list --allshowed:Name State Autostart Persistent ---------------------------------------------- default inactive no yes - Tried to start again:
sudo virsh net-start default # error: Requested operation is not valid: network is already active - But
virsh net-list --allstill showedinactive.virbr0remained inip link show. - Tried to enable autostart:
sudo virsh net-autostart default # Network default marked as autostarted- But it didn’t persist:
virsh net-list --all # Name State Autostart Persistent # ---------------------------------------------- # default inactive no yes
- But it didn’t persist:
- Logs were missing:
cat /var/log/libvirt/libvirtd.log # cat: /var/log/libvirt/libvirtd.log: No such file or directory
- Immediately after starting,
Current State
- The
defaultnetwork is in a weird state:libvirtsays it’sinactive, but trying to start it says it’salready active, andvirbr0exists. - Autostart doesn’t stick, possibly a permissions issue.
- Logs are missing, so I can’t debug further. I suspect
journaldmight have the logs, but I haven’t checked yet.
Questions
- Why is there a state mismatch between
virsh net-list --all(inactive) and the actual state (already active)? - Why isn’t autostart persisting despite
sudo virsh net-autostart defaultsucceeding? - Where are
libvirtdlogs on Arch Linux if/var/log/libvirt/libvirtd.logdoesn’t exist? - How can I get the VM installation working in
virt-manager?
Any help would be greatly appreciated
I’m stuck and would love to get this VM running! Thanks in advance.