Multipass Cheatsheet

If you install Multipass on Windows, you should first install Hyper-V (you could install VirtualBox instead, but Hyper-V is recommened).

Some Links:

Multipass Reference

To see all the images that are avaialble (notice that docker is one of them):

multipass find

Create a vm with from an image:

multipass launch jammy --name somenameforthevm

Note that 'jammy' is one of the images you can choose from, it's Ubuntu 22.04.

To inspect the details of a vm:

multipass info vmnamegoeshere

To create a vm and specify the ram, disk size, and cpus

multipass launch docker --name somevmname --memory 2G --disk 4G --cpus 2

To stop/start a vm:

multipass stop vmname
multipass start vmname

To delete a vm:

multipass delete vmnamegoeshere

Deleted vms can be restored with multipass recover vmname.

To permanently remove deleted vms: multipass purge

To login to a shell on a vm:

multipass shell vmnamegoeshere

Use exit to exit the shell.

Note that the username will be ubuntu but there is no password for this user

To list all vms:

multipass list

Copying/Sharing Files

Use the transfer command.

To copy a file from the host to an instance (this copies to the home dir of the vm):

multipass transfer some_file.txt vmname:.

To copy a folder recursively (copies myfolder to the home directory on the instnace):

multipass transfer --recursive --parents "C:\Users\YourUsername\Documents\myfolder" vmname:myfolder

Note that the --parents will create the myfolder dir on the instance if it is not already there.

You can mount a folder on the host to a vm like so (I'm not sure about how to replace the ~ for windows hosts)

multipass mount ~/folderName vmname

To make sure the mount was successfull:

multipass info vmname

You should see the mount listed and the path on how to navigate into it after you shell into the vm.

To unmount the folder:

multipass unmount vmname

Snapshots

To create a snapshot of a vm (the vm must not be running when you take the snapshot):

multipass snapshot vmname -c "some comment about the snapshot"

The output will be something like: vmname.snapshot1.

To see the snapshots created for a vm:

multipass info vmname --snapshots

To restore the snapshot:

multipass restore vmname.snapshot1