Cheat Sheets › Multipass

Multipass on a Mac

Running Ubuntu virtual machines on your Mac: creating them, getting in, moving files, keeping them safe, and fixing them when they won't start.

READ-ONLY only looks; safe CHANGES THINGS be careful ON YOUR MAC type it in Terminal on your Mac IN THE VM type it inside the virtual machine $ = you type this

Getting started

#1What Multipass is

Multipass runs complete Ubuntu computers, called virtual machines (VMs) or instances, inside your Mac. Each one has its own disk, memory, and network address. Handy for practicing server work safely, away from real client servers.

YOUR MAC multipass what you type multipassd background helper ubuntu1 Ubuntu 24.04 VM test2 another VM If the helper isn't running, every multipass command fails (section 8).
Words you'll see
InstanceOne virtual machine, like ubuntu1. Same thing as "VM."
ImageThe Ubuntu version a new instance starts from, like 24.04.
multipassdThe background helper that actually runs the VMs. The multipass command is just its remote control.
PrimaryA default instance Multipass can create for you. You don't have to use it.
GOOD TO KNOWOn an Apple Silicon Mac, the VMs run the ARM version of Ubuntu (arm64). Almost everything works the same as on an AWS server; a few downloaded programs come in separate ARM and Intel versions.
↑ Back to top

#2Install & update (with Homebrew)

CHANGES THINGSON YOUR MAC

Multipass is a Homebrew cask. If Homebrew isn't set up yet, see the Homebrew sheet first.

Check what you have (read-only)
multipass version multipass 1.16.4+mac multipassd 1.16.4+mac

The first line is the command; the second is the background helper. If the second line is missing, the helper isn't running (section 8).

Install (new Mac)
brew install --cask multipass

Asks for your Mac password partway through. Ends with multipass was successfully installed!

Update
brew upgrade --cask multipass
  • Asks for your Mac password. Your VMs and their files are kept.
  • Run multipass version afterward; both lines should show the new number.
⚠ BEFORE UPDATINGStop your VMs first (multipass stop --all), so none is left suspended. A VM suspended under an older version may refuse to resume after the update. That's the "stuck resume" in Troubleshooting.
↑ Back to top

Using it

#3Everyday commands

CHANGES THINGSON YOUR MAC

All typed on your Mac. Replace ubuntu1 with your instance's name.

TaskCommandSafe?
List VMs, their state and addressmultipass listREAD-ONLY
Details: CPU, memory, disk usemultipass info ubuntu1READ-ONLY
Open a command line inside itmultipass shell ubuntu1READ-ONLY
Run one command inside itmultipass exec ubuntu1 -- df -hREAD-ONLY
Startmultipass start ubuntu1CHANGES THINGS
Stop (clean shutdown)multipass stop ubuntu1CHANGES THINGS
Restartmultipass restart ubuntu1CHANGES THINGS
Which Ubuntu versions can I create?multipass findREAD-ONLY
What multipass list shows
multipass list Name State IPv4 Image ubuntu1 Running 192.168.252.5 Ubuntu 24.04 LTS test2 Stopped -- Ubuntu 24.04 LTS
  • State: Running, Stopped, Suspended, or Unknown (something's wrong; see section 9).
  • IPv4: the VM's address on your Mac's private network. Use it in your ssh config (section 5). -- when stopped.

To create a new VM, see section 4.

Delete a VM
multipass delete test2Moves it to a "deleted" state. Can still be brought back with multipass recover test2.
multipass purgePermanently erases every deleted VM and its disk. No undo.
multipass delete --purge test2Both at once: gone immediately, no undo.
⚠ CAREFULDouble-check the name before delete. Nothing inside a VM is backed up anywhere unless you did it yourself (section 7 covers snapshots).
↑ Back to top

#4Set up a new VM

CHANGES THINGSON YOUR MAC

One command creates a VM: multipass launch. Everything else is choosing its options. Decide them up front; CPU, memory, and disk can be changed later, but some only with the VM stopped.

Step 1: pick the Ubuntu version (read-only)
multipass find Image Aliases Version Description 22.04 jammy 20251016 Ubuntu 22.04 LTS 24.04 noble,lts 20251020 Ubuntu 24.04 LTS …
  • Image or any Alias can be used in the launch command: 24.04, noble, and lts all mean the same here.
  • LTS = Long Term Support (5 years of updates). Use 24.04 to match your new servers.
Step 2: choose the options
OptionWhat it setsDefault
24.04 (first word)Ubuntu version, from step 1latest LTS
--name test2What to call it. Short, no spaces.random words
--cpus 2Processor cores1
--memory 4GRAM (M or G)1G
--disk 20GDisk size. Can grow later, never shrink.5G
--cloud-init FILEA setup file run on first boot: add your ssh key, install software (step 4)none
--mount ~/sites:/home/ubuntu/sitesShare a Mac folder inside the VM from the start (more in section 6)none
--network en0Also put the VM on your home network, so other devices can reach it. Most people don't need this.private network only
How big? Suggested sizes
Quick test (try a command, then delete)--cpus 1 --memory 1G --disk 10G
Practice Moodle server (Apache, PHP, a test site)--cpus 2 --memory 4G --disk 20G
Heavier testing (big course restores, upgrades)--cpus 4 --memory 8G --disk 40G

The VM borrows these from your Mac while it's running. Leave at least half your Mac's memory for the Mac itself.

Step 3: launch it
multipass launch 24.04 --name test2 --cpus 2 --memory 4G --disk 20G Retrieving image: 100% Configuring test2 / Starting test2 | Launched: test2
  • The first launch of a version downloads it (a few minutes). Later launches reuse the download.
  • Launched: test2 = ready. Check it with multipass list.
  • A message saying it timed out = it may still be finishing. Wait a minute and run multipass list; often it's Running after all.
Step 4 (optional): a setup file for first boot

A cloud-init file is a short text file of instructions the VM follows the first time it starts. Handy for adding your ssh key and installing software, so every new VM starts ready to use.

Make a folder for it, then create the file:

mkdir -p ~/multipass
nano ~/multipass/basic.yaml
⚠ Example only: replace the key line with YOUR public key (from cat ~/.ssh/key-name.pub)
#cloud-config ssh_authorized_keys: - ssh-ed25519 AAAAC3Nza…your-whole-key… me@mac package_update: true packages: - tree - unzip

What each part does: #cloud-config must be the very first line. ssh_authorized_keys adds your key for the ubuntu user. package_update refreshes Ubuntu's software list. packages installs each listed program. Spacing matters: use spaces, not tabs, and keep the dashes lined up as shown.

Save (Ctrl+O, Enter), exit (Ctrl+X), then launch with it:

multipass launch 24.04 --name test2 --cpus 2 --memory 4G --disk 20G --cloud-init ~/multipass/basic.yaml
  • Installing packages makes the first launch slower. A timeout message usually just means it's still working.
  • The file only runs on the first boot. Editing it later doesn't change existing VMs.
  • Then add the VM to ~/.ssh/config (section 5, step 3) and ssh test2 works right away.
Step 5: first things inside a new VM
multipass shell test2
sudo apt update
sudo apt upgrade

Brings Ubuntu fully up to date. upgrade asks Do you want to continue? [Y/n]; press Y. (More on apt on the installing-software sheet.)

Changing size later

Stop the VM first, change the setting, then start it again. One command per box:

multipass stop test2
multipass set local.test2.cpus=4
multipass set local.test2.memory=8G
multipass set local.test2.disk=40G
multipass start test2
  • Use only the lines you need. To see a current value (read-only): multipass get local.test2.memory.
  • Disk can only grow. Asking for a smaller size gives an error.
TIPBefore a risky experiment in a VM, take a snapshot so you can roll back (section 7). It's faster than building a new VM.
↑ Back to top

#5Log in with ssh and your 1Password key

CHANGES THINGSON YOUR MACIN THE VM

multipass shell ubuntu1 always works and needs no setup. Setting up ssh is worth it too: it lets you use scp, rsync, and the same habits as with your AWS servers.

Step 1: copy your public key (on your Mac)
pbcopy < ~/.ssh/key-name.pub
Step 2: open authorized_keys inside the VM
multipass shell ubuntu1
nano ~/.ssh/authorized_keys

Go to the end with the down arrow, onto a new empty line, and paste with Cmd+V. Save: Ctrl+O, Enter. Exit: Ctrl+X. Then exit to leave the VM.

⚠ DON'T DELETE THE EXISTING LINEThe key already in that file belongs to Multipass itself. It's how multipass shell gets in. Remove it, and multipass shell stops working.
Step 3: add the VM to your ssh config (on your Mac)

Get the address from multipass list, then add an entry with nano ~/.ssh/config, set up the same way as in SSH sheet section 4:

Host ubuntu1 HostName 192.168.252.5 User ubuntu IdentityFile ~/.ssh/key-name.pub IdentitiesOnly yes IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

The user is always ubuntu on Multipass VMs.

Step 4: test
ssh ubuntu1

Approve the 1Password prompt and you're in.

When the address changes

A VM can get a new address after a restart or a Multipass update. If ssh ubuntu1 sits there and times out:

  1. Check the VM is Running and note its address: multipass list.
  2. Update the HostName line in ~/.ssh/config to match.
  3. If you then see REMOTE HOST IDENTIFICATION HAS CHANGED, another VM used that address before. Clear it with ssh-keygen -R 192.168.252.5 (see SSH sheet 6a).
FOR NEW VMsYour key can be added automatically at launch, so steps 1 and 2 aren't needed. See the setup file in section 4.
↑ Back to top

#6Moving files between your Mac and a VM

CHANGES THINGSON YOUR MAC

Two ways: copy files across (they're then separate copies), or mount a Mac folder so the VM sees it live (one folder, two views).

Copy files with multipass transfer
multipass transfer notes.txt ubuntu1:/home/ubuntu/Upload a file from the folder you're in on your Mac into the VM's home folder
multipass transfer ubuntu1:/home/ubuntu/report.csv .Download into the folder you're in on your Mac (. = here)
multipass transfer --recursive ~/site ubuntu1:/home/ubuntu/Copy a whole folder (--recursive is needed for folders)
  • The VM side always starts with its name and a colon: ubuntu1:.
  • No output = done. It replaces a file with the same name without asking.
  • Once ssh is set up (section 5), scp and rsync work too, exactly as on the SSH sheet.
Share a folder live with multipass mount
mkdir -p ~/vm-shared
multipass mount ~/vm-shared ubuntu1:/home/ubuntu/shared
  • The first makes a folder on your Mac; the second shows it inside the VM at /home/ubuntu/shared.
  • Edit a file on your Mac and the VM sees the change instantly, and the other way around.
  • See current mounts (read-only): multipass info ubuntu1, under Mounts.
  • Remove the mount (your files stay on the Mac): multipass umount ubuntu1:/home/ubuntu/shared.
⚠ CAREFULA mount is the same folder, not a copy. Deleting a file inside the VM deletes it from your Mac. Only mount a folder made for the purpose, never your whole home folder.
TIPUse a folder directly in your home folder, like ~/vm-shared. Folders inside Desktop, Documents, or Downloads are protected by macOS privacy settings and may fail to mount.
↑ Back to top

Keeping it healthy

#7Stop vs suspend, and snapshots

CHANGES THINGSON YOUR MAC
Stop or suspend?
Use this

Stop: multipass stop ubuntu1

A clean shutdown, like turning a computer off properly. Next start boots fresh. Takes a little longer to start again, but always works, even after updates.

Suspend: multipass suspend ubuntu1

Freezes the VM's memory to disk, like closing a laptop lid. Resumes exactly where it left off. But that saved memory can fail to load after a Multipass or macOS update, leaving the VM stuck (section 9).

Stop everything at once
multipass stop --all

Do this before updating Multipass, updating macOS, or restarting your Mac. If Multipass shuts down with VMs running, it may suspend them on its own.

Snapshots: a save point you can roll back to

A snapshot records the VM's disk at one moment. Take one before something risky (an upgrade, a big config change); if it goes wrong, restore and you're back to that moment. The VM must be stopped first.

1. Stop the VM
multipass stop ubuntu1
2. Take the snapshot
multipass snapshot ubuntu1 --name before-upgrade --comment "Before PHP upgrade" Snapshot taken: ubuntu1.before-upgrade
3. Start it again and do the risky thing
multipass start ubuntu1
Managing snapshots
TaskCommandSafe?
List all snapshotsmultipass list --snapshotsREAD-ONLY
Roll back (VM stopped first)multipass restore ubuntu1.before-upgradeCHANGES THINGS
Delete a snapshot you no longer needmultipass delete --purge ubuntu1.before-upgradeCHANGES THINGS
  • restore asks whether to snapshot the current state first. Say yes unless you're sure you won't want it.
  • Restoring throws away everything done in the VM since that snapshot.
  • Note the dot: ubuntu1.before-upgrade = VM name, dot, snapshot name.
⚠ NOT A BACKUPSnapshots live inside the VM's own files. If the VM is deleted (or its disk is damaged), its snapshots go with it. For anything you can't lose, also copy the files out (section 6).
↑ Back to top

#8The helper (multipassd)

CHANGES THINGSON YOUR MAC

multipassd runs in the background and does the real work. macOS starts it when your Mac starts, and restarts it if it crashes. If it's not running, every multipass command fails with cannot connect to the multipass socket.

Is it running? (read-only)
sudo launchctl list | grep -i multipass 86950 -11 com.canonical.multipassd
First column: a numberRunning now; that's its process ID.
First column: -Not running at the moment.
Second column: 0Last time it stopped, it stopped cleanly.
Second column: any other numberLast time it stopped, it crashed (-11 above). If it keeps crashing, read the log.
No line at allNot loaded. Start it (below).
Read its log (read-only)
sudo tail -n 30 /Library/Logs/Multipass/multipassd.log

The last 30 lines. Look for lines with error, failed, or warning; they usually name the problem and the VM involved, like [ubuntu1].

Restart it
sudo launchctl kickstart -k system/com.canonical.multipassd

Your VMs' files aren't touched. Wait 20 seconds, then try multipass list.

Fully stop it (so nothing touches the VM files)
sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist

Stays stopped until you start it again or restart the Mac. Needed for the repair in section 9.

Start it again
sudo launchctl load -w /Library/LaunchDaemons/com.canonical.multipassd.plist

Load failed: 5: Input/output error usually just means it was already running. Check with the first command above.

↑ Back to top

When it doesn't work

#9Troubleshooting

CHANGES THINGSON YOUR MAC
Common problems
cannot connect to the multipass socketThe helper isn't running, or keeps crashing. Check it and read the log (section 8). If the log shows a VM failing to resume, see Stuck resume below.
ssh ubuntu1 just sits there, then times outThe VM is stopped, or its address changed. Run multipass list and see section 5.
REMOTE HOST IDENTIFICATION HAS CHANGEDA different VM used that address before. ssh-keygen -R ADDRESS (see SSH sheet 6a).
State shows UnknownThe helper lost track of it. Try multipass start ubuntu1; if that fails, restart the helper (section 8).
Launch says it timed outOften still finishing. Wait, then multipass list.
multipass shell no longer works, but the VM runsMultipass's own key was removed from authorized_keys inside the VM (see the warning in section 5).

Stuck resume: a suspended VM that won't start

How you'll know: every multipass command says cannot connect to the multipass socket, and the helper's log shows lines like these, mentioning the VM:

[ubuntu1] Resuming from a suspended state [ubuntu1] qemu-system-aarch64: error while loading state for instance 0x0 of device 'cpu' [ubuntu1] qemu-system-aarch64: Error -1 while loading VM state

What's happening: the VM was suspended, and its saved memory no longer loads (often after an update). The helper keeps trying, fails, and crashes. The VM's disk and files are fine.

The fix: delete the saved memory (stored as a save point named suspend inside the VM's disk file), so the VM boots fresh. Its files stay; only what was "open" at the moment of suspending is lost.

⚠ ADVANCED: READ FIRSTThis edits Multipass's own files as root. Do it in order, one command at a time, and stop if any output differs from what's described. Replace ubuntu1 with your VM's name everywhere.
1. Stop the helper
sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
2. Confirm nothing is running (read-only)
pgrep -fl multipassd
pgrep -fl qemu

Both must show nothing. If either lists something, wait 30 seconds and check again. Don't continue until both are empty.

3. Find the VM's disk file (read-only)
sudo ls "/var/root/Library/Application Support/multipassd/qemu/vault/instances/ubuntu1/" cloud-init-config.iso ubuntu-24.04-server-cloudimg-arm64.img

The file ending in .img is the disk. In the next commands, replace IMAGE.img with that exact name.

4. Confirm the "suspend" save point is there (read-only)
sudo "/Library/Application Support/com.canonical.multipass/bin/qemu-img" snapshot -l "/var/root/Library/Application Support/multipassd/qemu/vault/instances/ubuntu1/IMAGE.img"

Shows a small table. Look for a line whose TAG is suspend. If there's none, this isn't the problem; stop here and start the helper again (step 6).

5. Delete the "suspend" save point (the fix)
sudo "/Library/Application Support/com.canonical.multipass/bin/qemu-img" snapshot -d suspend "/var/root/Library/Application Support/multipassd/qemu/vault/instances/ubuntu1/IMAGE.img"

No output = it worked. Only the suspend save point is removed; any snapshots you took yourself (section 7) stay.

6. Start the helper again
sudo launchctl load -w /Library/LaunchDaemons/com.canonical.multipassd.plist
7. Wait about 20 seconds, then check (read-only)
multipass list

The VM should show Running, or Stopped (then multipass start ubuntu1). Its address may have changed (section 5).

PREVENTIONStop VMs instead of suspending them, and always multipass stop --all before updating Multipass or macOS (section 7).
↑ Back to top