Cannot update Ubuntu Guest using Bridge Mode network

Discussions related to using VirtualBox on Windows hosts.
Post Reply
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi there,

I have been used Virtual Box 6.0.22 properly but I got a strange behavior. After created a new VM with Ubuntu 16, Ubuntu 18 or Ubuntu 20, if network is at NAT all works fine. I have Internet, I can type apt update with success, etc.
But, when I exchange network adapter from NAT to Bridge I still have internet access but apt update doesn't work anymore. I saw Connection Timeout.

Even after update to Virtual Box 6.1.14 I got the same behavior.

I am able to reproduce this on three differents desktops and using different networks.

I am wondering if it would be a VBox issue.

I tried by WiFi and cabled and got the same result.


My host is Windows 10.



Thank you.
Attachments
vb_error.PNG
vb_error.PNG (96.46 KiB) Viewed 3520 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by scottgus1 »

I have anecdotally seen Linux guests fail to recognize the IP address range change that occurs from NAT to Bridged. (NAT defaults to 10.0.2.15, Bridged is in the host-LAN IP range.)

When on Bridged, and the guest apt-gets are failing, see if you can browse the internet inside the guest.
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi there,

When apt update fail I can yet ping external site (i.e. google.com) and also open browser properly.

Tks,
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by scottgus1 »

As I understand, your apt commands fail when your Virtualbox network is on Bridged but they work on NAT.

You have internet access (ping & browser) at all times.

If Virtualbox itself were interfering we would see regular internet access faill, too.

I suspect something further down the line in your physical network. Are you in an office with an IT department? I'm wondering if there is an Ethernet switch with special access rules or a firewall getting in the way?
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi,

You have understood correctly.

No. It is happening at home and a colleague is getting the same problem in their home. He had reported to me the issue and I could reproduce the behavior.

Are you able to reproduce the same behavior from your side?

Thank you.
multiOS
Volunteer
Posts: 1227
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux, BSD
Location: United Kingdom

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by multiOS »

In the Ubuntu VM, go to the 'Software and Updates' Menu and change the 'Download from:' menu to Main Server, If updating works after the change, then there is a (hopefully temporary) problem with the Mirror Site you have currently specified. If not, the search for a solution continues.
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi,

Unfortunately the issue still persists even after the suggested change.

Thanks,
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi there,

Please see what happens when I am using VM in Bridge Mode:

root@virtualmachine:~# ip a
1: 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:8b:a3:d8 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.204/24 brd 192.168.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 86369sec preferred_lft 86369sec
root@virtualmachine:~#
root@virtualmachine:~# nslookup archive.ubuntu.com
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: archive.ubuntu.com
Address: 91.189.88.142
Name: archive.ubuntu.com
Address: 91.189.88.152
Name: archive.ubuntu.com
Address: 2001:67c:1562::15
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::23
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::24
Name: archive.ubuntu.com
Address: 2001:67c:1562::18

root@virtualmachine:~#
root@virtualmachine:~# apt update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Unable to connect to archive.ubuntu.com:http:
Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Unable to connect to archive.ubuntu.com:http:
Err:4 http://archive.ubuntu.com/ubuntu focal-security InRelease
Unable to connect to archive.ubuntu.com:http:
Reading package lists... Done
Building dependency tree
Reading state information... Done
180 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/ ... /InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/ ... /InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/ ... /InRelease Unable to connect to archive.ubuntu.com:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@virtualmachine:~#


I have tried with 'sudo' and also as 'root' and I got same result.



And now, when I am using NAT:

root@virtualmachine:~# ip a
1: 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:8b:a3:d8 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 86250sec preferred_lft 86250sec

root@virtualmachine:~# nslookup archive.ubuntu.com
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: archive.ubuntu.com
Address: 91.189.88.142
Name: archive.ubuntu.com
Address: 91.189.88.152
Name: archive.ubuntu.com
Address: 2001:67c:1562::15
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::23
Name: archive.ubuntu.com
Address: 2001:67c:1562::18
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::24

root@virtualmachine:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists...
Building dependency tree...
Reading state information...
180 packages can be upgraded. Run 'apt list --upgradable' to see them.

Thank you.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by fth0 »

I don't see anything indicating the cause for your problems. Can you install Wireshark on the host and on the guest, and capture the network traffic in both cases?
dhwconnection
Posts: 6
Joined: 8. Oct 2020, 03:22

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by dhwconnection »

Hi,

Please find attached the file.

Thank you.
Attachments
Wireshark.zip
(50.87 KiB) Downloaded 10 times
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Cannot update Ubuntu Guest using Bridge Mode network

Post by fth0 »

In the Wireshark traces when using Bridged Mode, the guest (192.168.2.204) and the host (192.168.2.202) are using the same MAC address (28:3a:4d:92:ea:2b, CloudNet). TCP connections originating from the host succeed, while TCP connections originating from the guest fail. This looks like the router (192.168.2.1) (or a network switch before the router) doesn't allow two local IP addresses (192.168.2.0/24) using the same MAC address and discards the packets. Can you verify this inside your router? What router model do you have? Does the router have the MAC address 04:d9:f5:75:81:b8 (ASUSTek)? Are you connected via WiFi or via Ethernet?

In the Wireshark traces when using NAT Mode, the guest uses 192.168.4.51 as the DNS server (instead of 1.1.1.3 in the Bridged Mode case). Do you have two local IP networks (192.168.2.0/24 and 192.168.4.0/24), or did I guess the network mask wrong?
Post Reply