Can I backup the multipass image?

Hello, Is there a way to backup the multipass image and move it to another machine ? , I am using multipass on macos m1.

Hi @garichd. Not currently, I am afraid. We’ll start work on snapshots soon, which will be a stepping stone to cloning VMs and, eventually, transferring to a different machine. But it is going to be a while before we can get to that point.

3 Likes

Hello,
is there an update on this request? I will be moving to a new Mac soon and don’t want to go through the pain of setting up my VM from scratch…!

Hi @garichd, we have been making very good progress on snapshots, but we are not just there yet. We are working on a new release with finished features and bug fixes now. Snapshots will hopefully come in the release following that. Cloning VMs is longer term though.

What you could do today is just copy your multipassd directory to the new machine. If the architecture is the same, that should work. It will not work if you are moving from an Intel to an ARM-based Mac (nor would cloned VMs).

wouldn’t the builtin snap snapshot feature of the multipass snap already give you a way to backup/restore your data on a package level ?

Hi @ogra, Multipass is also on Windows and Mac.

Even on Linux, snap snapshots are at a different level. I don’t think they are a good fit (despite the name being the same):

  • They are all or nothing (that is, assuming the relevant data directories would be covered, which I am not sure of).
  • I imagine they would copy images and thus take a lot more space? (image duplication vs. CoW)
  • You would not be able to interrogate those snapshots in a way that is meaningful for VMs (e.g. what state were the VMs on).

Thanks, @ricab, It’s the same architecture ( arm ), I will try the directory method.

yeah, it will only back up SNAP_DATA/SNAP_COMMON (and the respective USER dirs) and indeed it is all or nothing, but if you want to migrate between machines (or do a re-install) it is a suitable way of handling that data … and indeed i didn’t mean MAC or Windows :slight_smile: where we do not use snaps

1 Like

I backup the vault on MacOS as follows, not sure if this is correct though, I am testing the restore part:

> multipass stop --all
> sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist

You have to install gnutar as the tar that comes with MacOS is the BSD tar and it seems to have some sort of issue with links. I am using the multipass version in the backup name for my own purposes:

> sudo su
> gtar -cvpzf /yourbackuplocation/YOUR-HOST-NAME-Multipass-1.12.0+mac-backup.tar.gz /var/root/Library/Application\ Support/multipassd/qemu/vault

To Restore:

> multipass stop --all
> sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
> sudo gtar -xvpzf /yourbackuplocation/YOUR-HOST-NAME-Multipass-1.12.0+mac-backup.tar.gz -C / --numeric-owner