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-manager
with thedefault
NAT network.
Timeline of Issues and Steps
-
Initial Setup:
- Enabled KVM (
sudo modprobe kvm-intel kvm
), created anetctl
bridge (/etc/netctl/bridge
), and started/enabledlibvirtd
. - Tried to start a VM in
virt-manager
with a bridge network, but got:Unable to add bridge wlan0 port vnet0: Operation not supported
. - Confirmed via
iw list
thatwlan0
doesn’t support 4-address mode (Supported interface modes: IBSS, managed
). - Switched to NAT networking using the
default
network.
- Enabled KVM (
-
NAT Network Failure:
- Attempted to start the VM with the
default
NAT network, but got:Unable to complete install: 'Requested operation is not valid: network 'default' is not active'
. - Found that the
default
network didn’t exist:virsh net-list --all # Showed nothing
- Defined the
default
network 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
default
network:sudo virsh net-start default
- Got errors:
error: error creating bridge interface virbr0: Operation not permitted
error: internal error: firewalld can't find the 'libvirt' zone that should have been installed with libvirt
- Got errors:
- Confirmed
firewalld
was running and thelibvirt
zone was missing:sudo firewall-cmd --get-active-zones # Only showed public (wlan0)
- Tried to create the
libvirt
zone:sudo firewall-cmd --permanent --new-zone=libvirt
- Failed with
Error: NAME_CONFLICT: new_zone(): 'libvirt'
.
- Failed with
- Found
libvirt
is 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
libvirt
zone: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
default
network:sudo virsh net-start default # Network default started
- Confirmed
virbr0
was 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 --all
showed: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 --all
still showedinactive
.virbr0
remained 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
default
network is in a weird state:libvirt
says it’sinactive
, but trying to start it says it’salready active
, andvirbr0
exists. - Autostart doesn’t stick, possibly a permissions issue.
- Logs are missing, so I can’t debug further. I suspect
journald
might 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 default
succeeding? - Where are
libvirtd
logs on Arch Linux if/var/log/libvirt/libvirtd.log
doesn’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.