docs/how-to-guides/troubleshoot/troubleshoot-launch-start-issues.md
(how-to-guides-troubleshoot-troubleshoot-launch-start-issues)=
This topic addresses common issues when launching or starting instances, such as timeouts or "unknown state" errors.
These problems can occur for a few different reasons. Since Multipass relies on instances having an IP address on the default interface to establish an SSH connection, they are often (but not always) linked to IP assignment or connectivity issues.
The possible reasons that can lead the launch or start commands to fail are:
Follow these steps to diagnose your issue and identify the most likely scenario:
If the multipass launch command fails with the message "Downloaded image hash does not match", see {ref}launch-start-issues-stale-network-cache.
(Windows, Hyper-V driver) Inspect the file C:\WINDOWS\System32\drivers\etc\hosts.ics and see if there is more than one entry with your instance name in it. If that's the case, see {ref}launch-start-issues-stale-sharing-lease.
(Linux/macOS, QEMU driver) Inspect the Multipass logs and look for a message mentioning NIC_RX_FILTER_CHANGED. This message indicates that the network interface has been initialised.
launch-start-issues-vm-boot-failure.(Linux/macOS, QEMU driver) Check DHCP traffic from your host to the instance, to find out if there are requests and replies. Adapt and run the following command right after starting/launching the instance:
sudo tcpdump -i <bridge> udp port 67 and port 68
You will need to replace <bridge> with mpqemubr0 on Linux and with bridge100 on macOS.
Note that, on macOS, `bridge100` is a virtual network interface that only appears when at least a VM is running.
NIC_RX_FILTER_CHANGED, you should also see DHCP requests. If you don't, see {ref}launch-start-issues-vm-boot-failure and please let us know.launch-start-issues-no-ip-assigned.Look for messages regarding SSH in Multipass's logs. The instance may have obtained an IP and/or be properly connected, but still refuse Multipass when it tries to SSH into it.
Look for the message in the CLI or GUI spinner. Once it reads "Waiting for initialisation to complete", Multipass will have succeeded SSH-ing into the instance but remain waiting for cloud-init to finish.
(launch-start-issues-vm-boot-failure)=
To find out if something is failing during boot, you'd need to attach to the VM's console/serial and observe the output and try to find out where the VM is getting stuck. Here is how you can do that, depending on the driver:
(Linux/macOS, QEMU driver) Relaunch QEMU manually:
qemu-system-* command line corresponding to the failing VM in Multipass logs.-serial chardev:char0 -nographic.Application Support should become Application\ Support).sudo. Here is an example:/Library/Application\ Support/com.canonical.multipass/bin/qemu-system-aarch64 -machine virt,gic-version=3 -accel hvf -drive file=/Library/Application\ Support/com.canonical.multipass/bin/../Resources/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on -cpu host -nic vmnet-shared,model=virtio-net-pci,mac=52:54:00:e2:30:dd -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application\ Support/multipassd/qemu/vault/instances/superior-chihuahua/ubuntu-22.04-server-cloudimg-arm64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 4096M -qmp stdio -cdrom /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/superior-chihuahua/cloud-init-config.iso
This will open a QEMU window where you can see the boot output. You may need to select the correct display output (Serial or VGA) from the QEMU menu.
(macOS/Windows, VirtualBox driver) Observe the output in the VirtualBox GUI:
sudo VirtualBoxpsexec.exe as explained in {ref}launch-start-issues-windows-run-virtualbox.multipass start|launch.(Windows, Hyper-V driver)
multipass start|launch.Boot failures are often caused by VM image corruption, which can happen when the VM is killed without a proper shutdown.
Here are some options to attempt recovery:
If you took a snapshot before incurring this issue, you could try to restore it. However, snapshots are typically stored layers against an original image file, so they may not be enough.
Run fsck in the Serial Console:
The fsck tool (short for "file system consistency check") is used to scan the file system for errors and attempt repairs.
To use it, access the VM’s console as described above and follow these steps:
Access the VM's Console
launch-start-issues-vm-boot-failure section.Interrupt the Boot Process
Esc key repeatedly during the VM's startup until the GRUB menu appears.Shift key instead.Enter Recovery Mode
Enter.(recovery mode) appended and press Enter.Run fsck from Recovery Menu
fsck and press Enter.fsck and attempt to repair any detected issues.Alternatively, Drop to a Root Shell
fsck manually:
From the recovery menu, select root to drop to a root shell prompt.
At the prompt, run the following commands:
mount -o remount,ro /
fsck -f /
After fsck completes, remount the filesystem in read/write mode:
mount -o remount,rw /
Type exit to return to the recovery menu.
Resume Normal Boot
resume to continue with the normal boot process.fsck was able to repair the filesystem.(Linux/macOS) Alternatively, run fsck over a mounted image on the host (see {ref}launch-start-issues-reading-data-from-an-image).
Run qemu-img check -r on the image.
qemu-img, shipped with Multipass, can also be used to check and repair disk images.launch-start-issues-locate-multipass-binaries below.launch-start-issues-locate-multipass-images below./Library/Application\ Support/com.canonical.multipass/bin/qemu-img check -r /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/<instance>/
If none of the above works, you can still try to mount the image manually to recover data (see {ref}launch-start-issues-reading-data-from-an-image).
(launch-start-issues-no-ip-assigned)=
Sometimes VMs request an IP address, but don't obtain one. That can happen because of interference from other software, VPNs, network misconfiguration and, firewall settings.
bootpThe macOS firewall is known to cause vmnet to malfunction, because it blocks Apple's own bootp from giving out IPs. The effect of this problem on Multipass is tracked in this issue, which we internally call the dreaded firewall issue.
You may be able to work around it by disabling the firewall entirely, or executing
/usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
/usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd
We are aware that this requires administrative privileges, which managed Macs won't have. We unfortunately don't have a better fix for those cases. We continue hoping that Apple will eventually fix the problem which, to the best of our knowledge, affects all products using vmnet. Chances of that happening will probably increase if enough people report it to them.
See also: How to troubleshoot networking.
bootp not coming upThe DHCP server should be launched automatically when there is a request, but you can also launch it manually if needed. To do so, run:
sudo launchctl start com.apple.bootpd
If that doesn't work for you, try :
sudo launchctl load -w /System/Library/LaunchDaemons/bootps.plist
(launch-start-issues-stale-sharing-lease)=
Another possible reason for instance timeouts is a problem with the Internet Connection Sharing hosts file. This file sometimes gets corrupted, with jumbled or incomplete text. Other times, it contains duplicate or stale IP addresses.
Using Administrator privileges, edit the file C:\WINDOWS\System32\drivers\etc\hosts.ics and look for any corruption or entries that have your instance name in it. If there is more than one entry, remove any of them except for the first one listed. Save the file and try again. If that does not work, stop any running instances, delete the file, and reboot.
If SSH doesn't function properly in the VM, or Multipass is blocked from accessing it, your instance may need to be reconfigured or repaired.
If the default user is not ubuntu, Multipass cannot connect. If you used a custom cloud-init config file, make sure that the default user is ubuntu.
if SSH keys are missing or incorrect, you will have to add your public SSH key from ~/.ssh/id_rsa.pub on the host to ~/.ssh/authorized_keys in the instance. To do so you may need to gain access to the instance through a method besides SSH.
To gain access to an instance without SSH you can try the following methods.
Mount the instance's image file on your host (see {ref}launch-start-issues-reading-data-from-an-image) and make necessary changes through the filesystem.
Run the instance VM directly. This will require a username and password to log in. The username is the default user, ubuntu, and the password is what was set in cloud-init if you used a custom cloud-init config. If you do not have a password you can modify the instance's cloud-init-config.iso file to change it. One way to do so is as follows.
cloud-init-config.iso.multipass launch --cloud-init config.yaml, the contents config.yaml are shown below.cloud-init-config.iso with the newly generated cloud-init-config.iso.ubuntu. The instance's password will remain ubuntu unless it is changed again#cloud-config
password: ubuntu
chpasswd: { expire: false }
When launching a new instance, once Multipass obtains an SSH session to the instance, it will wait for cloud-init to complete. During this phase, the CLI/GUI spinner reads "Waiting for initialisation to complete".
At this point, the initialisation continues in the background, even if you interrupt the launch command or if it times out.
So if you wait for a little while longer, your instance may eventually finish setting up. When it does, it will have this file: /var/lib/cloud/instance/boot-finished.
launch command. For example, multipass launch --timeout 1000 sets the launch timeout to 1000 seconds.multipass shell to get a shell in the instance when Multipass is waiting for cloud-init to finish. To diagnose problems, inspect cloud-init's logs in /var/log/cloud-init*log.(launch-start-issues-windows-run-virtualbox)=
To run the VirtualBox GUI with the system account, you will need a Windows tool called PsExec:
PATH.psexec.exe -s -i "C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" (adapt the path to the VirtualBox executable as needed).When successful, you should see Multipass's instances in VirtualBox
(launch-start-issues-stale-network-cache)=
This can be caused by a known Qt bug (see issue #1714 on our GitHub).
A workaround to resolve this issue is to run the command multipass find --force-update, which forces downloading the image information from the network. As a result, if the download is successful, the network-cache will be overwritten.
Alternatively, try deleting the network-cache folder and restart the Multipass service:
sudo snap stop multipass
sudo rm -rf /var/snap/multipass/common/cache/multipassd/network-cache/
sudo snap start multipass
sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
sudo rm -rf /System/Volumes/Data/private/var/root/Library/Caches/multipassd/network-cache
sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist
C:\ProgramData\Multipass\cache\network-cache and restart the Multipass service.(launch-start-issues-reading-data-from-an-image)=
The images that Multipass uses with the QEMU driver follow a standard format — QCOW2 — which other tools can read.
One example is qemu-nbd, which allows mounting the image. This tool is not shipped with Multipass, so you would need to install it manually.
Once you have it, you can search the web for recipes to mount a QCOW2 image. For example, here is a a recipe.
(launch-start-issues-locate-multipass-binaries)=
You may need to locate where Multipass is installed. There are several ways to do so, depending on your platform:
(on Linux)
which multipass or whereis multipass./snap/bin folder.(on Windows)
where.exe multipass.C:\Program Files\Multipass\bin folder.(on macOS)
readlink -f $(which multipass)/Library/Application\ Support/com.canonical.multipass/bin/ folder.(launch-start-issues-locate-multipass-images)=
You may need to locate where Multipass is storing instances. The location changes depending on your platform:
(Linux) /root/.local/share/multipassd/vault/instances/<instance/
(Windows) C:\ProgramData\Multipass\data\vault\instances\<instance>\
(macOS) /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/<instance>/