QEMU-KVM - How to configure bridged network for VM

I have QEMU/KVM installed under Clear Linux and some virtual machines set up.
By default network for virtual machines under QEMU/KVM in Clear Linux is NAT.
How can such network be configured as bridged so the virtual machine can see network devices of the host?
Advice will be greatly appreciated.

Last time I played with this, I did it with OpenVSwitch. It wasn’t straight forward, but then OVS is pretty new to me. Might be worth taking a look though, it’s pretty powerful in terms of what you can do with it.

Thanks much for the info. I will take a look.
My question was also pointing to the fact that e.g. in VMware it is a choice whether to pick network connection for VM as NAT or bridged, while under QEMU/KVM bridged selection appears to be missing, unless it is hidden under some different name…

Have a hunt around this guys blog for KVM and OVS. It’s old material, but I remember finding some good basic guidance. Some of it is outdated, but you’ll work that out as you go.


For bridging, I won’t lie, Google appears to be your friend on this:

Pretty hard to go pass this as a reference:

Thanks again. I have done my googling of these articles beforehand. However most are rather old and not reflecting current, much enhanced versions of tools.
I was hoping that with the current QEMU/KVM under Clear Linux this would be much simpler to accomplish, particularly that it is so simple in VMware and Virtualbox, so why would bridged connection be missing in QEMU/KVM?

Are you using desktop or server?

It’s not really a Clear Linux issue, it’s more the tooling you are using. On the desktop, there might be an easy gui way of doing it using Gnome Boxes (haven’t played with it personally).

For CLI, you are really talking about libvirt from the sounds of it, rather than native QEMU, so, I dived into some old notes I had. As I said, I moved to OVS rather than bridging to a bond, but I think this is from the first VM I ever made on Clear. You are interested in the XML config of the VM, notably it’s ‘devices’ section, subsection ‘interface’:

			<disk type='file' device='disk'>
			  <source file='/var/lib/libvirt/vm_disk_images/$VM_NAME.img'/>
			  <target dev='sda' bus='virtio'/>
			<disk type='file' device='cdrom'>
			  <source file='/mnt/isos/Linux/debian-9.5.0-amd64-netinst.iso'/>
			  <target dev='hdb' bus='virtio'/>
			<interface type='bridge'>
			  <source bridge='br0'/>
			  <model type='virtio'/>
			  <mac address="00:16:3E:EF:61:91"/>

Reference the above, in concert with the libvirt manual i linked earlier. It might all be covered just under networking, or you might have to go digging deeper into other sections. Sorry, been ages since I was playing with that.

Thanks again.
Understood. It is not a Clear Linux issue but rather QEMU/KVM deficiency as it seems to be.
To your question, I am using desktop, standard Gnome default as included in Clear Linux. I have been trying Gnome Boxes as well but so far Boxes appear to have some limitations or not working too well. I am new to Boxes so it might need more familiarity to use it. I am not sure what it is, whether it is relative immaturity or just not well designed. Again, I might be misjudging Boxes due to not being too familiar…
Thanks again and Regards.