Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active August 21, 2023 21:04
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zulhfreelancer/12817fa5d1579bb640ed00dff8327a4a to your computer and use it in GitHub Desktop.
Save zulhfreelancer/12817fa5d1579bb640ed00dff8327a4a to your computer and use it in GitHub Desktop.
How to fix Multipass stuck at "Starting" state on Mac OSX?
# Step 1: see the status of VMs
$ multipass ls
Name   State          IPv4           Image
vm1    Stopped        --             Ubuntu 20.04 LTS <-- this one is OK, stopped in previous command
vm2    Starting       --             Ubuntu 20.04 LTS <-- this one is not OK, why it's stuck?



# Step 2: apply the fix
$ ps -ef | grep -i multipass | awk '{print "sudo kill -9 "$2}' | sh
# Enter your password or PIN



# Step 3: see the status of VMs again
$ multipass ls
Name   State          IPv4           Image
vm1    Stopped        --             Ubuntu 20.04 LTS <-- no changes for this vm
vm2    Stopped        --             Ubuntu 20.04 LTS <-- OK, it's stopped now
# You can also put this inside your ~/.bashrc, ~/.bash_profile or ~/.zshrc file
# so you can just run `mpkill` when you need it
function mpkill() {
echo "[1/3] Killing Multipass process..."
ps -ef | grep -i multipass | awk '{print "sudo kill -9 "$2}' | sh
echo "[2/3] Sleeping..."
sleep 3
echo "[3/3] Launching new Multipass process..."
open -a Multipass
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment