Libvirt/KVM/Qemu Guest does not connect to internet

651 Views Asked by At

I am creating VMs on the go with libvirt. My host is an Ubuntu 22.04 LTS wired to an ethernet cable. I have already tried NAT Networking and it works perfectly but I am trying to move to bridge networking because I want to assign static IPs later on to the VMs and bridge seems to be a simpler implementation.

I set up the bridge by looking at this video: Video link. I followed steps as they are in the video:

  1. Use nmtui to create a new bridge.
  2. Add an ethernet connection as a slave to the bridge.
  3. Remove the ethernet connection using nmtui.
  4. sudo systemctl restart NetworkManager
  5. sudo systemctl restart libvirtd

Here are the pictures of me creating a new bridge: NMTUI activation page

Details about the bridge and adding ethernet as a slave

List of all networks

The results of ip a are:

(base) pierre@pierre-host:~$ sudo ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enx3c18a0d5b15c: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br1 state UP group default qlen 1000
    link/ether 3c:18:a0:d5:b1:5c brd ff:ff:ff:ff:ff:ff
3: wlp0s20f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether c8:34:8e:3f:67:1b brd ff:ff:ff:ff:ff:ff
6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:ca:28:2c:22 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
8: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether e6:94:ae:bd:bd:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.18/24 brd 192.168.0.255 scope global dynamic noprefixroute br1
       valid_lft 3404sec preferred_lft 3404sec
    inet6 2601:483:5581:10e0:1afe:6c51:8408:b1d7/64 scope global temporary dynamic
       valid_lft 3600sec preferred_lft 3600sec
    inet6 2601:483:5581:10e0:4c68:bcc8:af9:bfbd/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 3600sec preferred_lft 3600sec
    inet6 fe80::53a:a45a:32b3:2048/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

The result of sudo brctl show br1 is:

(base) pierre@pierre-host:~$ sudo brctl show br1
bridge name bridge id STP enabled interfaces
br1 8000.e694aebdbd99 yes enx3c18a0d5b15c

I create a Virtual Machine using virt-install like this:

sudo virt-install --virt-type kvm --name ubuntu_new --disk /var/lib/libvirt/images/bck/d5957a6_2023-11-23-18-41-22.qcow2 --import --os-variant ubuntu22.04 --vcpu 2 --memory 8192 -network bridge:br1 --noautoconsole

When the machine starts up, there is something weird I noticed. I see a line when it is booting:

    no configuration methods succeeded (http //ipxe.org/040ee119) no more network devices

enter image description here

The info section of the Virtual Machine (in the virt manager window) shows that the virtual machine is connected to the bridge: enter image description here

I have tried rebooting the VM but that does not help either. One thing strange I noticed is that the Bridge does not appear as the forth tab of Virt manager window (once the QEMU/KVM section is clicked) in the virt manager. enter image description here

Here is my virt-manager without the network interfaces tab: enter image description here

Is this a cause of concern?

My problem is that the guest Virtual Machine does not connect to the internet. Here is what the guest says: My virt manager does not have the network interfaces tab. Does this suggest anything?

Please help!!!

0

There are 0 best solutions below