canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.74k stars 642 forks source link

[MacOS] multipass no longer starts successfully #3366

Open MeandNi opened 8 months ago

MeandNi commented 8 months ago

Describe the bug

I can no longer start my virtual machine.

image

To Reproduce

multipass start

Some of my operations in vm:

sudo apt-get update
# Installing tools for PAs
sudo apt-get install build-essential
sudo apt-get install man 
sudo apt-get install gcc-doc
sudo apt-get install gdb 
sudo apt-get install git
sudo apt-get install libreadline-dev
sudo apt-get install libsdl2-dev
sudo apt-get install llvm llvm-dev
sudo apt-get install llvm-11 llvm-11-dev

sudo apt-get install bison
sudo apt-get install flex

sudo apt install ubuntu-desktop xrdp

sudo apt-get install alsa-base alsa-utils
systemctl --user unmask pulseaudio
systemctl --user start pulseaudio

Expected behavior Normal start

Logs

multipassd.log

Additional info

macOS 14.2.1

multipass   1.12.2+mac
multipassd  1.12.2+mac
Name:           mine
State:          Unknown
IPv4:           --
Release:        --
Image hash:     6d6af17f28c8 (Ubuntu 22.04 LTS)
CPU(s):         --
Load:           --
Disk usage:     --
Memory usage:   --
Mounts:         --

qemu

ricab commented 8 months ago

Hi @MeandNi, are you able to launch other instances? I am not sure why the instance suddenly stopped being able to finish booting. This often means that the instance is unable to obtain an IP, but in your log it looks like the instance is not being able to even get to that point. Was the instance forcefully killed at some point?

What happens if you run the following command:

$ sudo /Library/Application\ Support/com.canonical.multipass/bin/qemu-system-x86_64 -accel hvf -drive file=/Library/Application\ Support/com.canonical.multipass/bin/../Resources/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,readonly=on -cpu host -nic vmnet-shared,model=virtio-net-pci,mac=52:54:00:8d:0e:a7 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application\ Support/multipassd/qemu/vault/instances/mine/ubuntu-22.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 3072M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -cdrom /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/mine/cloud-init-config.iso

That should cause a window to pop up. Do you see it reaching to a login prompt, eventually?

thegreatyamori commented 8 months ago

same issue, I've tried to run this command but nothing happens

$ sudo /Library/Application\ Support/com.canonical.multipass/bin/qemu-system-x86_64 -accel hvf -drive file=/Library/Application\ Support/com.canonical.multipass/bin/../Resources/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,readonly=on -cpu host -nic vmnet-shared,model=virtio-net-pci,mac=52:54:00:8d:0e:a7 -device virtio-scsi-pci,id=scsi0 -drive file=/var/root/Library/Application\ Support/multipassd/qemu/vault/instances/mine/ubuntu-22.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 3072M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -cdrom /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/mine/cloud-init-config.iso
katie-m commented 8 months ago

Same issue with the unknown state on Mac M3 running 14.2.1. I ran the "sudo /Library..." command above and got "No such file or directory"

Further info: I first tried installing MultiPass from the .pkg, but couldn't get the launch to work (same errors as below). When that didn't seem to work, I un-installed, then re-installed from HomeBrew. I've shutdown or restarted my laptop at least 10 times, between various of the steps below. The stop and start commands each take around 5 minutes to timeout and then return with the error message about the unknown state of the instance.

multipass version

multipass   1.12.2+mac
multipassd  1.12.2+mac

multipass launch -n maps 22.04

launch failed: instance "maps" already exists

multipass start -vvv maps

[2024-01-12T15:32:16.049] [warning] [daemon] Instance 'maps' is already running, but in an unknown state
start failed: The following errors occurred:
Instance 'maps' is already running, but in an unknown statemaps: timed out waiting for response

multipass stop -vvv maps


[2024-01-12T16:52:16.591] [info] [daemon] Cannot open ssh session on "maps" shutdown: Cannot open dhcpd_leases file: No such file or directory
[2024-01-12T16:52:16.591] [debug] [maps] QMP: {"return": {}}

[2024-01-12T16:52:16.591] [debug] [maps] QMP: {"timestamp": {"seconds": 1705103536, "microseconds": 591574}, "event": "POWERDOWN"}

[2024-01-12T16:52:16.591] [info] [maps] VM powering down


> multipass info --all

Name: maps State: Unknown IPv4: -- Release: -- Image hash: f885a8e8f62a (Ubuntu 22.04 LTS) CPU(s): -- Load: -- Disk usage: -- Memory usage: -- Mounts: --


> multipass delete -vvv -p maps

[2024-01-12T17:04:37.760] [debug] [maps] QMP: {"return": {}}

[2024-01-12T17:04:37.760] [debug] [maps] QMP: {"timestamp": {"seconds": 1705104277, "microseconds": 760381}, "event": "POWERDOWN"}

[2024-01-12T17:04:37.760] [info] [maps] VM powering down [2024-01-12T17:09:37.763] [debug] [maps] QMP: {"return": {}}

[2024-01-12T17:09:37.763] [debug] [maps] QMP: {"timestamp": {"seconds": 1705104577, "microseconds": 763156}, "event": "POWERDOWN"}

[2024-01-12T17:09:37.763] [info] [maps] VM powering down [2024-01-12T17:14:37.729] [warning] [Qt] QProcess: Destroyed while process ("qemu-system-aarch64") is still running. [2024-01-12T17:14:37.732] [info] [maps] process state changed to NotRunning [2024-01-12T17:14:37.732] [error] [maps] error: program: qemu-system-aarch64; error: Process crashed

ricab commented 8 months ago

Hi all, the command that I posted needs to be adapted for each instance. The OP's shows an unexpected shutdown/crash and no indication that the instance gets to the point of asking for an IP. I asked to run the command to see if the instance was booting at all (the suspicion is that it got corrupted when it was killed).

@thegreatyamori, @katie-m, your cases may have different causes/resolutions. Be sure to have a look at https://multipass.run/docs/troubleshoot-networking and workarounds for other reported timeout issues. If you are still unable to get past it, please open a new issue, as this is a common symptom of different conditions.