I am struggling to find a fully functional vm solution that has sufficient access to my host and is fairly configurable. I was hoping that virt-manager could be the one, yet the VMs produced cannot connect to virtual network.
Tried both with win11 (PE) and Fedora KDE VMs, Fedora does recognize network presence yet refuses to connect.
Reinstalled OS, same.
Tried different NAT configs with different virt device models, the same.
Tried sysctl net.ipv4.ip_forward=1, the same.
Modified /etc/libvirt/network.conf with firewall_backend="iptables", the same.
Just some more context, when I enable the libvirtd at the first time, it works; but, after a reboot it fails to work. Also virtual network does work on vm-curator, on vm-curator, folder share does not work (topic for anothe post). Can anyone help me?
Edit: here are the list of packages layered for context: qemu qemu-char-spice qemu-device-display-virtio-gpu qemu-device-display-virtio-vga qemu-device-usb-redirect qemu-img qemu-system-x86-core qemu-user-binfmt qemu-user-static libvirt libvirt-nss edk2-ovmf
If you have configured a libvirt VM as default using NAT then it is very difficult to interact between the VM and the host, and all connections will need to originate from the guest to the host. Additionally, the guest must use the host external IP to connect.
If, instead, you chose to use a bridge device and set it to use virbr0 then it is very easy to communicate in both directions, guest to host and host to guest. The virtual address for the host should then be either 192.168.124.1 or 192.168.122.1 and the guest will have an IP on that same subnet.
When using bridging the affects of NAT are no longer in the picture.
I do understand; but, I am not concerned with network access of my vms, if I were to, I would have removed their NIC device, is there a simple way to fix NAT for virt-manager? If not I guess I can do bridge network; but, is there an easy guide for this?
libvirt will not create bridge for you. You need to create the bridge with the network configuration and libvirt can then create a network using that bridge.
You could ask your favorite google with “how do I create a network bridge with NetworkManager”. I would look at this guide.
If you install nm-connection-editor-desktop the connection editor can create a bridge the gui way. The network editor that comes with gnome is a bit cribbled in comparison with nm-connection-editor.
Be aware that the bridged network in the guest systems are just as open as the host system so the firewall on the guest system must be configured accordingly.
I have tried to create a bridge with both nm-connection-editor and plasma-nm, in plasma, I was able to add wifi as the bridge interface, on the former, it did not; hence, left it empty, both of them got stuck when I tried to connect to their produced networks (they got stuck on collecting an ip address). I did not see a tutorial about this that is specific to fedora, I assume fedora does something different since NAT does not work. Can you specifically give me which configurations I must provide to make this bridge network connect, also, again, I would much prefer fixing NAT since this bridge network adds an extra level of complexity for a thing I will heavily depend on. Any help would be appreciated.
wifi does not work well with a bridge set-up. For many years I have used the default nat configurations as it is set up by default by libvirt, and it has always worked. It is using dnsmasq as dns and dhcp server for the clients, and the configurations is also handled by libvirt when choosing the default network setup.
Sorry for not testing atomic versions, but in ‘normal’ Fedora installing VM looks like this sudo dnf in @virtualization
and both Wifi and Wired connection work out of the box with the default settings.
I did figure out that when I first start virtnetworkd then libvirtd, it works; I have no idea why or how, can I make systemd start in the order I specify? Does anyone have any other ideas?
sudo virsh net-list --all
[sudo] password for <user>
Name State Autostart Persistent
--------------------------------------------
default active yes yes
The status was already as this when I am having this issue, it still cannot connect to network unless I manually start libvirtd and virtnetworkd in order (tried your suggestion after fully disabling virtnetworkd, only having libvirtd enabled)
and it shows the same on the VM when running while still having the network active within the VM.
$ systemctl status libvirtd virtnetworkd
\u25cb libvirtd.service - libvirt legacy monolithic daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/libvirtd.service.d
\u2514\u250010-secret.conf
/usr/lib/systemd/system/service.d
\u2514\u250010-timeout-abort.conf
Active: inactive (dead)
TriggeredBy: \u25cb libvirtd-ro.socket
\u25cb libvirtd-admin.socket
\u25cb libvirtd.socket
Docs: man:libvirtd(8)
https://libvirt.org/
\u25cb virtnetworkd.service - libvirt network daemon
Loaded: loaded (/usr/lib/systemd/system/virtnetworkd.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
\u2514\u250010-timeout-abort.conf
Active: inactive (dead)
TriggeredBy: \u25cf virtnetworkd.socket
\u25cf virtnetworkd-admin.socket
\u25cf virtnetworkd-ro.socket
Docs: man:virtnetworkd(8)
https://libvirt.org/
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=6.71 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=6.51 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=115 time=8.16 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 6.507/7.125/8.163/0.738 ms
$ ip r
default via 192.168.124.1 dev enp1s0 proto dhcp src 192.168.124.232 metric 100
192.168.124.0/24 dev enp1s0 proto kernel scope link src 192.168.124.232 metric 100
On the host with the VM running I see this.
$ systemctl status libvirtd virtnetworkd
○ libvirtd.service - libvirt legacy monolithic daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
TriggeredBy: ○ libvirtd-admin.socket
○ libvirtd.socket
○ libvirtd-ro.socket
Docs: man:libvirtd(8)
https://libvirt.org/
● virtnetworkd.service - libvirt network daemon
Loaded: loaded (/usr/lib/systemd/system/virtnetworkd.service; disabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Mon 2026-10-12 19:52:21 CDT; 5min ago
Invocation: c8a0ee60dc9c42aebff6cd8428b2abc6
TriggeredBy: ● virtnetworkd-admin.socket
● virtnetworkd.socket
● virtnetworkd-ro.socket
Docs: man:virtnetworkd(8)
https://libvirt.org/
Main PID: 1624350 (virtnetworkd)
Tasks: 21 (limit: 38337)
Memory: 6.7M (peak: 13.2M)
CPU: 148ms
CGroup: /system.slice/virtnetworkd.service
├─1624350 /usr/bin/virtnetworkd --timeout 120
├─1624421 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─1624422 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
Oct 12 19:52:21 eagle.home.domain dnsmasq[1624421]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth DNSSEC l>
Oct 12 19:52:21 eagle.home.domain dnsmasq-dhcp[1624421]: DHCP, IP range 192.168.124.2 -- 192.168.124.254, lease time 1h
Oct 12 19:52:21 eagle.home.domain dnsmasq-dhcp[1624421]: DHCP, sockets bound exclusively to interface virbr0
Oct 12 19:52:21 eagle.home.domain dnsmasq[1624421]: reading /etc/resolv.conf
Oct 12 19:52:21 eagle.home.domain dnsmasq[1624421]: using nameserver 127.0.0.53#53
Oct 12 19:52:21 eagle.home.domain dnsmasq[1624421]: read /etc/hosts - 21 names
Oct 12 19:52:21 eagle.home.domain dnsmasq[1624421]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Oct 12 19:52:21 eagle.home.domain dnsmasq-dhcp[1624421]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Oct 12 19:52:41 eagle.home.domain dnsmasq-dhcp[1624421]: DHCPREQUEST(virbr0) 192.168.124.232 52:54:00:b6:54:f7
Oct 12 19:52:41 eagle.home.domain dnsmasq-dhcp[1624421]: DHCPACK(virbr0) 192.168.124.232 52:54:00:b6:54:f7 f45
When the VM is started the socket is created that then launches virtnetworkd with no user action. The Triggered By in that status report shows what starts it even when disabled.
Unless there’s a difficult to reproduce race condition resulting in a deadlock that matches the symptoms described by the OP.
Since I have personally experienced a similar issue in the past, I now have this service enabled with a custom preset to eliminate any possibility of the problem happening again.
I’ve also faced this race condition on Kinoite. I’ve had some success in fixing it by running systemctl restart libvirtd.service (it is initially started automatically). Only as a temporary solution, though.
For completeness: The followin lists the libvirt unites that are enabled by default and disabled by default. Most of the services are socket activated, that is, started if and when needed.
As suggested, I did try to use individual new services as the replacement libvirt and enabled invidually virtnetworkd,virtproxyd,virtqemud,virtstoraged,virtinterfaced, it still does not work.
Destroying and re-starting the default interface from virsh kinda fixes the issue; but, the fix does not persist through a reboot.
While I am not sure whether this is related, I heard that vpns can interfere with network stuff and I have unofficial flatpak of protonvpn on my system; but, closed during these troubleshooting info given on this thread.
here is the systemd log/info from the session, excuse the locale mismatch: