How to Add a Bridge Network on Ubuntu 18.04 Server

In order for your VMs or guest machines to communicate with each other or with the host, you should set a bridge network on your hypervisor.

To do this, edit the default network file :

sudo nano /etc/netplan/50-cloud-init.yaml

Then, add the below content to the file.  Remember to replace eno1 with the name of your interface and 192.168.0.50with the correct IPV4 address.

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no  
  bridges:
    br0:
      interfaces: [eno1]
      dhcp4: no
      addresses: [192.168.0.50/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [192.168.0.1]

Then, on the guest machine, the network files should look as shown below:

# This is the network config written by 'subiquity'
network:
  version: 2
  ethernets:
    ens3:
      dhcp4: no
      addresses: [192.168.0.14/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [192.168.0.1]

Remember to apply the settings by running:

sudo netplan apply

 

How to List Virtual Machines using Virsh Utility on Ubuntu 18.04

To list all virtual machines (VMs) running on your Ubuntu 18.04 hypervisor, run the command below:

sudo virsh list --all

You should see the below list of all guest machines on your Ubuntu 18.04 servers

 Id    Name                           State
----------------------------------------------------
 1     ubuntu_20_4                    running
 -     server-3                       shut off
 -     win10                          shut off

 

How to Check the Virtualization Platform on Ubuntu 20.04

To check the Virtualization platform used by your virtual machine on Ubuntu 20.04 , type the command below:

hostnamectl | grep Virtualization

You should see an output similar to the one shown below:

Virtualization: kvm

Please note, the above method for checking the Virtualization platform also works for Ubuntu 18.04