Qemu, virt-manager and bridge network

Hi everyone!

I installed and configured qemu-kvm and virt-manager following this guide [Tutorial] How to install Virt-Manager Correctly on EOS/Arch base systems and everything works fine.

However, I would need to use my virtual machines in a bridge network, both between them and with the host system.

It’s possible to do it?

When I try to setup a VM’s network in bridge mode I get this error

I think I need to create the br0 interface with nmcli, but I don’t know how.

Thanks to those who will help me!

Generally, for host → virtual, or host ← virtual, there is already a virtual bridge (usually called Virtual Network 'default' : NAT) that is created when you installed the software. You would need to find out what IP each device has and then you can use the IP to connect. If you wanted to use host names, you could edit the /etc/hosts file to add a mapping for the needed IP, on each host. Virtual ↔ virtual generally works out of the box with host names, as long as they are both on the same virtual network.

A Network bridge is much more difficult to set up, and usually only needed if you need a VM to appear as a physical host on the network. I.E. a second physical host that needs access to VM on first physical host. Depending on your network setup, you still may need to edit the hosts file to reach them by name. The following Arch wiki entry can help with a network bridge, if it is indeed needed

Network bridge

The Network Manager or Iproute2 are possibly the easiest ways to accomplish this, in that order, YMMV.

The above presumes that appropriate services are running, and any firewall ports (if running) are open, already.

Thank you for your help.
I’ll explain my setup better, it’s very simple.
I have 2 virtual machines, the first with Ubuntu and the second with Windows and it would be enough for me that they were reachable from each other.

The problem is that starting them both receive the same IP address. Of course the ping between the two machines doesn’t work either.


enp10s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fec0::525f:1fe:a318:bac6  prefixlen 64  scopeid 0x40<site>
        inet6 fec0::c7f:5baa:895f:29f5  prefixlen 64  scopeid 0x40<site>
        inet6 fe80::62d9:b994:1cd7:ed8a  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:3a:12:c1  txqueuelen 1000  (Ethernet)
        RX packets 184  bytes 82712 (82.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 384  bytes 56037 (56.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



Windows IP Configuration

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . :
   Site-local IPv6 Address . . . . . : fec0::dbf6:28c8:2b79:3cc5%1
   Link-local IPv6 Address . . . . . : fe80::b2fe:b061:541:c0ae%14
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . : fe80::2%14

I tried setting the IP address manually but without success, I set the windows machine to the address but it can’t see the ubuntu at the address (but can navigate to internet…)


Windows IP Configuration

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . :
   Site-local IPv6 Address . . . . . : fec0::dbf6:28c8:2b79:3cc5%1
   Link-local IPv6 Address . . . . . : fe80::b2fe:b061:541:c0ae%14
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . : fe80::2%14


Pinging with 32 bytes of data:
Reply from bytes=32 time=1ms TTL=255
Reply from bytes=32 time<1ms TTL=255
Reply from bytes=32 time<1ms TTL=255
Reply from bytes=32 time<1ms TTL=255

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms


Pinging with 32 bytes of data:
Reply from Destination host unreachable.
Reply from Destination host unreachable.
Reply from Destination host unreachable.
Reply from Destination host unreachable.

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

The default network segment for me has always been, with a gateway of, In Virt-manager under Edit->Connection Details then Virtual Networks tab you should have a screen like this:

So at the moment

  • Do you have a bridge running on your host?
  • I would expect your default gateway to be, rather than .2 (unless you have manually set)
  • Does the network range match (based on subnet shown in above posts)
  • Is your DHCP range -
  • Is it set for NAT?
  • Do you have other networks listed in Virtual Networks?
  • Are the VMs set to use the default : NAT network?
  • Have you restarted libvirt or your machine after any edits to make sure configs running are latest?

At the moment I can’t explain why the windows machine would be able to get out, unless it is using the IPv6 route.

I think we are getting closer to the problem.

I don’t have the same network options as you and I’m using qemu:///session (user session) instead of qemu:///system

Yes, it appears that you have created a bridge through libvirt possibly. Honestly, I was never able to make that work, in a useful way. I always create my bridge through the OS itself, which then show up as an option in virt-manager when creating the VM (or can be changed on existing VMs).

I would recommend creating the default network again, the instructions and where to get the data can be found here (from Stackoverflow): Restore default network libvirt
If you create the file just make sure it is named default.xml

Again, if you want a network bridge, I would follow the link for the Arch wiki above to create through the OS.

Thanks again for the help.

This is my default.xml file

sudo cat /etc/libvirt/qemu/networks/default.xml
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh net-edit default
or other application using the libvirt API.

  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:4f:38:2e'/>
  <ip address='' netmask=''>
      <range start='' end=''/>

This is the error I get following the method you linked to me

sudo virsh  net-define default.xml
errore: impossibile collegarsi all'hypervisor
errore: Operazione non supportata: Cannot use direct socket mode if no URI is set

No need to thank me, especially since I haven’t “solved” anything for you.

From your previous post where you mentioned qemu:///session, something of a faint memory came to me. I looked at the link you worked from, checked my installs (all qemu:///system), and did a little research (one of the better pages). I stumbled back across that qemu:///session is running unprivileged, and networking is limited. There is a way to use virbr0 still though, as long as it is in /etc/qemu/bridge.conf, you can check yours to see that you get this.

$ cat /etc/qemu/bridge.conf 
  allow virbr0

What I don’t know, is how that might show up in the list when you choose networking for a new or existing VM. I can try spinning up a VM, running through the instructions you used later (after I get some sleep), and hopefully get back to you with a solution.

Edit: You might try in NIC setting of a VM by using setting Network source: to Bridge device…, and Device name: to virbr0 (screenshot is just where you want to be, don’t use my setting)

OK, sorry this took so long. When I started earlier I wasn’t quite awake, and introduced a completely unrelated issue, and followed it right down the rabbit hole. Once I came out the other side with a solution, I had steps that then didn’t seem necessary. I flattened my lab and started over, without said rabbit hole, and indeed the solution was as easy as my last post screenshot under the Edit:

To recap, in your settings for the VM, goto NIC

  • in Network source: use Bridge device...
  • in Device name: type virbr0

This will allow the VMs to communicate with each other by name or IP, and you can communicate with the host by IP. To use hostname you would need to edit the /etc/hosts file appropriately on each machine.

From your screenshot, it looks like the default connection of QEMU/KVM was deleted. You may want to add that back, in case you ever want to edit the virbr0 network with a GUI. If you decide to, just click File -> Add Connection... make sure it says QEMU/KVM, and click Connect.

1 Like

For editing the default network from the terminal, use sudo virsh net-edit default.

For a reference, here is my working default.xml (from sudo virsh net-dumpxml default):

  <forward mode='nat'>
      <port start='1024' end='65535'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:92:8e:30'/>
  <ip address='' netmask=''>
      <range start='' end=''>
        <lease expiry='24' unit='hours'/>
      <host mac='52:54:00:5d:52:ea' name='windows-11' ip=''/>
      <host mac='52:54:00:91:37:db' name='debian-cin' ip=''/>
      <host mac='52:54:00:e7:a2:3f' name='debian-kde' ip=''/>
      <host mac='52:54:00:40:0e:ab' name='debian-gnome' ip=''/>
      <host mac='52:54:00:a9:33:cf' name='arch-iso' ip=''/>
      <host mac='52:54:00:40:20:7e' name='arch-cin' ip=''/>
      <host mac='52:54:00:8c:07:95' name='arch-kde' ip=''/>
      <host mac='52:54:00:9f:62:85' name='arch-gnome' ip=''/>
      <host mac='52:54:00:52:80:33' name='ubuntu-cin' ip=''/>
      <host mac='52:54:00:92:ce:ef' name='ubuntu-kde' ip=''/>
      <host mac='52:54:00:0f:c6:79' name='ubuntu-gnome' ip=''/>
      <host mac='52:54:00:5b:75:8e' name='fedora-cin' ip=''/>
      <host mac='52:54:00:06:d5:b4' name='fedora-kde' ip=''/>
      <host mac='52:54:00:33:bf:85' name='fedora-gnome' ip=''/>
      <host mac='52:54:00:8b:2e:b8' name='opensuse-cin' ip=''/>
      <host mac='52:54:00:3e:82:db' name='opensuse-kde' ip=''/>
      <host mac='52:54:00:3e:e8:c6' name='opensuse-gnome' ip=''/>
      <host mac='52:54:00:2b:1b:18' name='gentoo-systemd' ip=''/>
      <host mac='52:54:00:3e:b7:82' name='gentoo-term' ip=''/>
      <host mac='52:54:00:69:d7:27' name='gentoo-cin' ip=''/>
      <host mac='52:54:00:ad:1d:b8' name='gentoo-kde' ip=''/>
      <host mac='52:54:00:57:e2:49' name='gentoo-xfce' ip=''/>
      <host mac='52:54:00:25:e5:a5' name='nixos-kde' ip=''/>
1 Like

Thank you both very much, I finally solved it.
Having configured virt-manager for use as a simple user I had a bit of trouble getting things right.

To recreate the default connection I had to use the command
virsh net-edit default (without sudo and using xml file provided by @ajgringo619 )

The new virbr0 connection in user mode didn’t connect, I had to open virt-manager as root and set it to autostart.

Now everything is finally working as it should!

Thanks again!


Glad you got it working.

And thanks, I was able to learn about session vs system.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.