Multipass instances cannot access http/https

Hello,

I launched a Multipass instance with:

multipass launch -c 6 -m 10G -d 50G --name markTest

Then inside it e.g a git clone fails or apt update fails:

git clone https://github.com/cvmfs/cvmfs.git
Cloning into ‘cvmfs’…
fatal: unable to access ‘https://github.com/cvmfs/cvmfs.git/’: gnutls_handshake() failed: The TLS connection was non-properly terminated.

OR

sudo apt update
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Connection failed [IP: 198.18.2.6 80]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Connection failed [IP: 198.18.2.6 80]
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Connection failed [IP: 198.18.2.6 80]
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Connection failed [IP: 198.18.2.6 80]
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease Connection failed [IP: 198.18.2.6 80]
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/InRelease Connection failed [IP: 198.18.2.6 80]
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-backports/InRelease Connection failed [IP: 198.18.2.6 80]
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease Connection failed [IP: 198.18.2.6 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

I worked through:

and seem to get all the expected output, so am at a loss as to how further diagnose the issue. Do you have any suggestions?

Here is the output I get from the suggested diagnostic tests inside the instance (accessed via “multipass shell markTest”)

ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=19.5 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=12.1 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=12.4 ms
— 1.1.1.1 ping statistics —
10 packets transmitted, 10 received, 0% packet loss, time 9447ms
rtt min/avg/max/mdev = 12.128/15.356/19.502/3.169 ms

dig google.ie

; <<>> DiG 9.16.1-Ubuntu <<>> google.ie
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20802
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.ie. IN A

;; ANSWER SECTION:
google.ie. 3600 IN A 198.18.2.8

;; Query time: 12 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sun Jul 24 21:48:56 BST 2022
;; MSG SIZE rcvd: 54

dig @1.1.1.1 google.ie

; <<>> DiG 9.16.1-Ubuntu <<>> @1.1.1.1 google.ie
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53071
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;google.ie. IN A

;; ANSWER SECTION:
google.ie. 3600 IN A 198.18.2.8

;; Query time: 4 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sun Jul 24 21:49:14 BST 2022
;; MSG SIZE rcvd: 52

Then locally on my Mac I checked whilst the instance is running in another terminal:

sudo lsof -iTCP:53 -iUDP:53 -n -P
Password:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mDNSRespo 453 _mdnsresponder 57u IPv4 0x893411bddad0c2c3 0t0 UDP *:53
mDNSRespo 453 _mdnsresponder 58u IPv6 0x893411bddad0c5d3 0t0 UDP *:53
mDNSRespo 453 _mdnsresponder 60u IPv4 0x893411cc3e3df8b3 0t0 TCP *:53 (LISTEN)
mDNSRespo 453 _mdnsresponder 61u IPv6 0x893411cc3e43a203 0t0 TCP *:53 (LISTEN)

Thanks,

Mark

Update:

I failed to spot the DNS resolution is going wrong. Every website tried has an IP starting 198.18.2.* rather than the actual correct IP that the macbook would see. So it’s something to do with the DNS resolution inside the VM

Mark