I have a project using qemu/kvm. I need to make 2 virtual machines (Windows server and Ubuntu server 18), and connect them with physical switch and 2 physical computers (Windows XP). Target is to make a local network.

How do I configure qemu/kvm to connect to physical machines (switch and 2 Windows XP)? what configurations do I need to make for Ubuntu server to join other PCs to the network?

I have already made 2 virtual machines (Windows server and Ubuntu server) and I have two PCs with Windows XP installed and a Cisco switch.


The way i would do this is to create install linux bridge first

    apt-get install bridge utils -y 

Then i would tag vlan on the interface and and then add a bridge and enslave that interface to the bridge.

    vconfig add physical_interface vlandID

Then enslaving it to the bridge

    brctl addbr bridge 
    brctl addif bridge interface.vlanid

Then in KVM assign the your VM to the bridge you just created.

On the switches make sure your ports are trunked and you allow the vlans needed to pass through the trunk ports.


take a look at the netplan guide how to create and link bridges with guests. That oulines exactly the example you need to have your machines visible on the external network.

At the core that means Step #1: define a bridge:

version: 2
renderer: networkd
      dhcp4: no   bridges:
      dhcp4: yes
        - enp3s0

Run netplan apply to make this config active.

Step #2: let libvirt connect the guest to that bridge

  <bridge name='br0'/>
  <forward mode="bridge"/>

This is a network that you then virsh define and can reference from your guests, in the example above the name br0.

  • Can you provide importants steps from that link? Please edit to do it – damadam Nov 6 '19 at 8:36
  • @damadam - done – Christian Ehrhardt Nov 12 '19 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.