Need Help - virt-manager can't use 'default' NAT network

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 the default NAT network.

Timeline of Issues and Steps

  1. Initial Setup:

    • Enabled KVM (sudo modprobe kvm-intel kvm), created a netctl bridge (/etc/netctl/bridge), and started/enabled libvirtd.
    • 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 that wlan0 doesn’t support 4-address mode (Supported interface modes: IBSS, managed).
    • Switched to NAT networking using the default network.
  2. 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
      
  3. 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
    • Confirmed firewalld was running and the libvirt 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'.
    • Found libvirt is a built-in zone:
      sudo firewall-cmd --permanent --delete-zone=libvirt
      # Error: BUILTIN_ZONE: 'libvirt' is built-in zone
      
  4. 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> ...
      
  5. 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 showed inactive. virbr0 remained in ip 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
        
    • Logs were missing:
      cat /var/log/libvirt/libvirtd.log
      # cat: /var/log/libvirt/libvirtd.log: No such file or directory
      

Current State

  • The default network is in a weird state: libvirt says it’s inactive, but trying to start it says it’s already active, and virbr0 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

  1. Why is there a state mismatch between virsh net-list --all (inactive) and the actual state (already active)?
  2. Why isn’t autostart persisting despite sudo virsh net-autostart default succeeding?
  3. Where are libvirtd logs on Arch Linux if /var/log/libvirt/libvirtd.log doesn’t exist?
  4. How can I get the VM installation working in virt-manager?

Any help would be greatly appreciated :folded_hands: I’m stuck and would love to get this VM running! Thanks in advance.

PS: I’ll be AFK for the next few hours but will get back to this as soon as possible. Thanks for any help in the meantime!

Hey all, quick bump - I’m done banging my head against the wall :sweat_smile:.
What other virtual managers do you folks use on EndeavourOS?
I just want to mess around with a macOS Monterey USB bootable in a VM.

On my Mac, I tried

  • VirtualBox (simple but buggy)
  • Parallels (decent but paywalled)
  • and another one I can’t recall (better quality, trickier to use).

USB passthrough was a nightmare, though NAT/bridge mode worked fine - ironic, since Linux should have less restrictive drivers!
Any recs for a Mac-friendly VM setup that plays nice with USB and networking?

Did you skim through the wiki?

https://discovery.endeavouros.com/applications/how-to-install-virt-manager-complete-edition/2021/09/

Personally I use vmware workstation pro.

Never needed to create a bridged network. One thing that I’ve always done on my systems is switch to the home zone in firewalld before installing/configuring libvirtd.