Define a network bridge using Ubuntu’s / Linux Mint’s Network Manager application

I’m regularly passing large amounts of data between my Windows VM and my Linux host. To avoid bottlenecks, I use a virtual network bridge that creates a 10 GBit link between the guest and the host, enough to challenge the fastest SSD on the market.

When running Ubuntu or Linux Mint, Network Manager offers a convenient way to configure a network bridge.

Here is how you set up a virtual network bridge for connecting a Virtual Machine to the Linux Host. Please note that this will not work with a wireless network connection, at least not without some modifications:

  1. Click on the Network Manager icon (near the bottom right in the Linux Mint panel). Then select “Edit connections…”.
wired connection
Network Manager before editing
  1. Click “Add”, then select “Bridge” from the drop-down menu.
add bridge
Add bridge

Then click “Create…”.

  1. Select the Bridge tab and click “Add”.
bridge connection
Add a connection to the bridge
  1. From the drop-down menu, choose “Ethernet” as the connection type.
Ethernet link
Create an Ethernet link for the bridge

Click “Create…”.

  1. Under the Ethernet tab, select your network link next to the “Device:” specification. I have selected enp3s0 which is the fixed Ethernet link to my router.
Ethernet bridge device
Specify the Ethernet link enp3s0 as the bridge slave device

Click “Save” to save the configuration and to close the window.

  1. Back in the “Editing Bridge connection 1” window, select the IPv4 Settings tab.
DHCP configuration
The IPv4 Settings tab to select DHCP or manual configuration

If you wish to automatically assign an IP address every time you start your PC, you can click “Save” and close the window. Congratulations – you are done!

If, like me, you prefer to use a static IP, select “Manual” from the “Method:” drop-down menu. Fill in the IP address, network mask, gateway address, and the DNS server address. Mine are as follows:

manual IPv4 settings
Manual configuration of IPv4 settings for the bridge

I also selected “Require IPv4 addressing for this connection to complete” (not sure this is needed). Once you are done, click “Save”. Close the “Network connections” window.

  1. Check the new configuration by clicking on the Network Manager icon, then select “Connection Information”. Here is my configuration:
bridge configuration
Bridge configuration in Network Manager
  1. To enable the new network configuration, reboot your computer!

Good luck!

If this article has been helpful, click the “Like” button below. Don’t forget to share this page with your friends.

9 thoughts on “Define a network bridge using Ubuntu’s / Linux Mint’s Network Manager application”

  1. I have tried this, but I can’t get it to work with my Virtual Machine Manger VM’s. Which device do you specify in the VM for connection?

    1. I choose “Bridge device” and it should select the network bridge, in my case I had named it “bridge0”. The question is: Do you connect your PC via wireless? If yes, a network bridge won’t work. Unless you try your luck in creating a L3 tunnel for L2 networks (there is a way to do it, but I gave up eventually).

  2. Hi,

    I have to say that – in general – I really like your guides as they are very easy and visual to follow.

    I started out going through your guide on how to create a Windows 10 kvm VM on the 3900x… (I have the 5900x myself) and everything went quite well, to the point that I decided to wipe my “bare metal” install of Windows 10 and instead – after a bit of tinkering – managed to install directly onto a partition (took some e trial and error though).

    Anyway – even though everything else went well I couldn’t quite get the file sharing part to play well. I tried the shared (public) folder, but couldn’t get the rest to work as I wanted, so I went about to set up the bridge, as you mentioned somewhere that you used that to be able to share things between host/guest through smb.

    And then I ran out of luck. Following this guide the resulting connection that I’m offered (I removed the NIC from my VM and added it back again to make sure that everything was as untainted as possible) is “Bridge bridge0: Empty bridge” which results in a VM without an internet connection.

    Any suggestions as to what that might be about?

    1. Hello Göran,
      It’s a bit difficult to debug bridge settings with the given information. First of all, in order for a bridge to work, you must run a wired Ethernet network, not a wireless network. In other words, your computer must be connected to the router via cable, not WiFi.
      If you have a wired connection, make sure you defined the correct network interface under bridge slave. In a terminal window on the Linux host, enter “ifconfig” and press Enter. You should get a list of network interfaces, including the bridge and the network port of the host. My network port is enp7s0, yours may be different. This network port is the one you specify in step 5.
      Make also sure you configured the IPv4 addressing correctly. I prefer to assign fixed IP addresses manually. My Linux host has a fixed IP address, for example 192.168.1.100. See step 6.

      After network configuration changes, reboot to enable the changes. Check the configuration as described in step 7. In my case, I also have a default route specified (not shown in the screenshot above).

      Now is the time to check the VM configuration using virt-manager. Under the “NIC…” section, I got the following configuration:

      Virtual Network Interface

      Network source: Bridge device…
      Device name: bridge0 [my comment: corresponds with the “Interface” on the “Connection Information” screen of Network Manager]
      Device model: virtio
      MAC address: some MAC address
      IP address: Unknown
      Link state: V active [is activated]

      For the above to work, you need to have the virtio network driver installed during the Windows installation (you take the driver from the virtio ISO you mounted). You can also install the virtio driver later by booting the Windows VM with the virtio ISO added as “Storage – CDROM device”.

      If everything seems to be correct but you still cannot connect to the bridge or Internet, check with your distribution to get some specific help on bridge configuration. Sometimes there are network scripts or config files that may override your Network Manager configuration.

      Last not least: My tutorial on creating a network bridge assumes that you first define the network bridge and then specify that bridge inside virt-manager. virt-manager respectively libvirt has it’s own ways of creating a bridge and that could lead to conflicts. See the following libvirt related wiki on “virtual networking” that might shed more light: https://wiki.libvirt.org/page/VirtualNetworking

      Good luck!

    2. One more thing: your default route both on your host and your Windows VM should be the IP of your router. In the tutorial above it is 192.168.0.1.

  3. Hopefully the last comment on that: I just checked my Windows VM network settings under virt-manager. My QEMU/KVM Connection Details show the following:
    Virtual Networks tab:
    Name: default

    State: Inactive

    It works because I configured the network outside of virt-manager. You could roll back your network configuration (delete the bridge and use your Ethernet device as your network port, as it was before), and then configure networking inside virt-manager.

    I used virt-manager to set up networking some years ago and ran into problems. In the end it was easier for me to use Network Manager, but your mileage may vary.

  4. Hi again,

    Trying to post you an update/more details, but it doesn’t seem to want to get registered…

    The sum of it – I’m on LM 20.3 using a wired connection. I went through the steps a couple of times more and even went ahead and created a new VM from scratch – still only the “Empty Bridge” option (apart from the macvtap ones – but the virt-manager say that option might complicate host/guest sharing).

    (Is it possible to copy/paste the ifconfig output here or do this editor go weird if I do?)

    I’m like one step (more like half a step) away from wiping my host and go about it from scratch to see if that makes a difference…

    1. Hi again,

      Last post here… decided to go for a reinstall of a fresh LM 21, and that did the trick. Bridge is up and running and after having researched (more like trouble shooting) samba a bit more I now have very fast folder sharing between the guest & host. Did take some extra steps though to get windows to see my smb shares – read a post in LM forums that some things have changed “recently” so that there are more to install to get it working…

      Anyway – Thank you for a nice and easy to follow guide. Everything is working great, and just to make sure it stays that way I’m going to be a bit more consistent with my timeshift snapshots.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.