canonical / canonical/multipass

instance.multipass domain names do not resolve

Open
#1,830 28 comments 3 reactions 0 assignees View on GitHub
wishlist
Dominant language
C++
Stars
9.2k
Forks
829
Avg merge
3d 2h
Merged PRs (30d)
45

Description

**Describe the bug**
Instance names don't resolve on the host as `instance-name.multipass` (but they do within instances).

**To Reproduce**
Launched an instance with `multipass launch example`, verified it was running with `multipass list`, and then ran `host example.multipass` and `ping example.multipass`.

**Expected behavior**
`example.multipass` resolves to the instance IP and ping succeeds.

**Logs**
Logs starting from `multipass launch` and covering until the failed `ping` (as above).

-- Logs begin at Wed 2019-09-18 17:00:27 PDT. --

Nov 05 11:01:51 whunk multipassd[506]: Checking for images to update…
Nov 05 11:02:28 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604602948, "microseconds": 522995}, "event": "RTC_CHANGE", "data": {"offset": 1}}
Nov 05 11:13:38 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604603618, "microseconds": 507805}, "event": "RTC_CHANGE", "data": {"offset": 1}}
Nov 05 11:24:50 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604604290, "microseconds": 507926}, "event": "RTC_CHANGE", "data": {"offset": 1}}
Nov 05 11:25:31 whunk multipassd[506]: starting: qemu-img info /var/snap/multipass/common/cache/multipassd/vault/images/focal-20201102/ubuntu-20.04-server-cloudimg-amd64.img
Nov 05 11:25:31 whunk multipassd[11969]: Applying AppArmor policy: multipass.qemu-img
Nov 05 11:25:31 whunk multipassd[506]: starting: qemu-system-x86_64 --version
Nov 05 11:25:31 whunk multipassd[506]: starting: qemu-img resize /var/snap/multipass/common/data/multipassd/vault/instances/example/ubuntu-20.04-server-cloudimg-amd64.img 5368709120
Nov 05 11:25:31 whunk multipassd[11978]: Applying AppArmor policy: multipass.qemu-img
Nov 05 11:25:31 whunk multipassd[506]: starting: qemu-img snapshot -l /var/snap/multipass/common/data/multipassd/vault/instances/example/ubuntu-20.04-server-cloudimg-amd64.img
Nov 05 11:25:32 whunk multipassd[506]: process working dir '/snap/multipass/2857/qemu'
Nov 05 11:25:32 whunk multipassd[506]: process program 'qemu-system-x86_64'
Nov 05 11:25:32 whunk multipassd[506]: process arguments '--enable-kvm, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/snap/multipass/common/data/multipassd/vault/instances/example/ubuntu-20.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 1, -m, 1024M, -device, virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:81:da:13, -netdev, tap,id=hostnet0,ifname=tap-34560714794,script=no,downscript=no, -qmp, stdio, -cpu, host, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/snap/multipass/common/data/multipassd/vault/instances/example/cloud-init-config.iso'
Nov 05 11:25:32 whunk multipassd[506]: starting: qemu-system-x86_64 -nographic -dump-vmstate /tmp/multipassd.oNb506
Nov 05 11:25:32 whunk multipassd[506]: qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
Nov 05 11:25:32 whunk multipassd[506]: starting: qemu-system-x86_64 --enable-kvm -device virtio-scsi-pci,id=scsi0 -drive file=/var/snap/multipass/common/data/multipassd/vault/instances/example/ubuntu-20.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 1 -m 1024M -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:81:da:13 -netdev tap,id=hostnet0,ifname=tap-34560714794,script=no,downscript=no -qmp stdio -cpu host -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/snap/multipass/common/data/multipassd/vault/instances/example/cloud-init-config.iso
Nov 05 11:25:32 whunk multipassd[12127]: Applying AppArmor policy: multipass.example.qemu-system-x86_64
Nov 05 11:25:32 whunk multipassd[506]: process started
Nov 05 11:25:32 whunk multipassd[506]: QMP: {"QMP": {"version": {"qemu": {"micro": 1, "minor": 11, "major": 2}, "package": "(Debian 1:2.11+dfsg-1ubuntu7.32)"}, "capabilities": []}}
Nov 05 11:25:32 whunk multipassd[506]: QMP: {"return": {}}
Nov 05 11:25:34 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604604334, "microseconds": 326892}, "event": "RESET", "data": {"guest": true}}
Nov 05 11:25:34 whunk multipassd[506]: VM restarting
Nov 05 11:25:34 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604604334, "microseconds": 333014}, "event": "RESET", "data": {"guest": true}}
Nov 05 11:25:43 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604604343, "microseconds": 672581}, "event": "NIC_RX_FILTER_CHANGED", "data": {"name": "net0", "path": "/machine/peripheral/net0/virtio-backend"}}
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPDISCOVER(mpqemubr0) 52:54:00:81:da:13
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPOFFER(mpqemubr0) 10.84.39.36 52:54:00:81:da:13
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPDISCOVER(mpqemubr0) 52:54:00:81:da:13
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPOFFER(mpqemubr0) 10.84.39.36 52:54:00:81:da:13
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPREQUEST(mpqemubr0) 10.84.39.36 52:54:00:81:da:13
Nov 05 11:25:46 whunk dnsmasq-dhcp[875]: DHCPACK(mpqemubr0) 10.84.39.36 52:54:00:81:da:13 example
Nov 05 11:25:47 whunk multipassd[506]: Trying SSH on 10.84.39.36:22
Nov 05 11:26:18 whunk multipassd[506]: QMP: {"timestamp": {"seconds": 1604604378, "microseconds": 634637}, "event": "RTC_CHANGE", "data": {"offset": 1}}

**Additional info**
- OS: Ubuntu 18.04.5 LTS
- multipass 1.5.0
- multipassd 1.5.0
- `multipass info example`

```
Name: example
State: Running
IPv4: 10.84.39.36
Release: Ubuntu 20.04.1 LTS
Image hash: ebf8e70c17b9 (Ubuntu 20.04 LTS)
Load: 0.00 0.02 0.02
Disk usage: 1.2G out of 4.7G
Memory usage: 135.1M out of 981.2M
```

**Additional context**
I was able to make this work by manually configuring DNS for the multipass interface with `systemd-resolve`:

```
sudo systemd-resolve --interface mpqemubr0 --set-dns $(ip -4 -br address show dev mpqemubr0 | perl -anE 'say((split "/", $F[2])[0])') --set-domain=multipass
```

When I then `ping example.multipass`, it's successful, and I see some log lines from dnsmasq:

Nov 05 11:27:04 whunk dnsmasq[875]: reading /etc/resolv.conf

Nov 05 11:27:04 whunk dnsmasq[875]: using local addresses only for domain multipass
Nov 05 11:27:04 whunk dnsmasq[875]: using nameserver 127.0.0.53#53
Nov 05 11:27:04 whunk dnsmasq[875]: reading /etc/resolv.conf
Nov 05 11:27:04 whunk dnsmasq[875]: using local addresses only for domain multipass
Nov 05 11:27:04 whunk dnsmasq[875]: using nameserver 127.0.0.53#53
Nov 05 11:27:04 whunk dnsmasq[875]: reading /etc/resolv.conf
Nov 05 11:27:04 whunk dnsmasq[875]: using local addresses only for domain multipass
Nov 05 11:27:04 whunk dnsmasq[875]: using nameserver 127.0.0.53#53

The multipass network is 10.84.39.1/24 and my home network is 10.0.0.1/24. I wonder if the problem arises because my home network is also under the 10/8 space?

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `multipass launch example`, `host example.multipass`, and `ping example.multipass`, then inspect how the multipass interface, dnsmasq, and systemd-resolve are configured. Compare the failed setup with the manual `systemd-resolve --interface mpqemubr0 --set-domain=multipass` workaround; done means host-side `example.multipass` resolves to the instance IP and ping succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.