Is it possible to setup QEMU/Libvirt to act the same as virtualbox (in terms of bridged networking)?

I was wondering if QEMU/Libvirt can (in a sense) replicate the bridged networking in Virtualbox, I want to use QEMU/Libvirt over Virtualbox but when it came to bridged networking on QEMU/Libvirt the guest machine didn't get it's own ip from the router in some cases and when it did, it couldn't connect to the other machines inside the Intranet (inside the router's local network) but when I used virtualbox the bridged adapter did exactly that (the router treated the vm as if it was just another machine on the network) but I would like to switch to QEMU/Libvirt as I've heard it is better for performance and I do like the way QEMU/Libvirt behaves as opposed to Virtualbox.

Have you taken a look through this?
https://wiki.archlinux.org/index.php/QEMU#Tap_networking_with_QEMU

There multiple ways to setup bridged networking for qemu

Thank you, I will check it out!

1 Like

yes you can use qemu even better than the (free) virtualbox. there are a lot of examples and tutorials at the internet, youtube etc. just search for "bridged network" , "GPU Passtrough". meanwhile i even prefer qemu without kvm. once you're familiar with the startup-configs it allows you really individual settings. you can also create images that are compatible to virtualbox. the main problem in the beginning is to sort out the tutorials, a lot of qemu is not very good explained and the documentation is very often not helpful unless you find a tutorial. but all in qemu is the most flexible and powerfull vm you can get (for free).

I actually did look up virtualbox to qemu bridged networking and found this https://serverfault.com/questions/819466/how-to-achieve-virtualbox-like-bridging-under-kvm But this was made with Ubuntu in mind so I decided to ask here but I will look at the Arch Wiki Link Dalto gave above and look up some tutorials for QEMU, Thank you for all the help!

another helpful forum for virtual boxes, especially qemu
https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/

For the Arch Wiki page linked it doesn't specify how to make a tap network bridge as far as I could tell so I found this page on the Arch Wiki https://wiki.archlinux.org/index.php/Network_bridge do I need to make the tap network bridge using a certain tool or will making one with any tool specified work? (wondering if you need to make the bridge with a specific tool to make it work with QEMU)

I just used nmcli from NetworkManager to create a bridge and slave the ethernet connection to it when I set this up some months ago.
Looking through the history, these where the commands used:

$ sudo nmcli connection add type bridge ifname br0 stp no
$ sudo nmcli connection add type bridge-slave ifname enp14s0 master br0
$ sudo nmcli connection up br0

enp14s0 is/was my ethernet connection, you'd have to adjust that accordingly.

1 Like

this tutorial helped me on bridging with libvirt

Thank you I will try those commands!

EDIT: I tried those commands but they didn't work

Thank you for the tutorial I will look into it!

EDIT: I actually saw this tutorial and tried it before but I tried it again and still the vm doesn't get an ip

2020-07-03_16-22

I forgot which tutorial worked for me, iirc I ended up using netctl and disabling the NetworManager services. I use my passthrough system on a seperate manjaro install.

My ip a

2: eno1: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br10 state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
altname enp0s31f6
inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
3: br10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 192.168.1.151/24 brd 192.168.1.255 scope global br10
valid_lft forever preferred_lft forever
inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever

In /etc/netctl I have a config for example bridgewith:

Description="Bridge Interface br10 : eno1"
Interface=br10
Connection=bridge
BindsToInterfaces=(eno1)
IP=static
Address='192.168.1.151/24'
Gateway='192.168.1.1'
DNS='192.168.1.1'
#MACAddressOf=eno1

## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes
SkipNoCarrier=yes

And in virtual manager

Screenshot_20200704_063235

I have MACAddressOf=enp35s0 uncommented, should I comment it or does uncomment or comment work fine?

EDIT: also for device model, I only have virtio, Hypervisor default, and e1000e, is there any one in particular I should choose (Have virtio selected atm)

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

Forum kindly sponsored by