How to share data with an instance

See also: mount, umount, transfer.

The recommended way to share data between your host and an instance with Multipass is the mount command:

$ multipass mount $HOME keen-yak
$ multipass info keen-yak
…
Mounts:         /home/michal => /home/ubuntu

From this point on /home/ubuntu will be available inside the instance. Use umount to unmount it again and you can change the target by passing a specified target after the instance name:

$ multipass umount keen-yak
$ multipass mount $HOME keen-yak:/some/path
$ multipass info keen-yak                
…
Mounts:         /home/michal => /some/path

You can also use transfer to just copy files around - prefix the path with <name>: if it’s inside an instance:

$ multipass transfer keen-yak:/etc/crontab keen-yak:/etc/fstab /home/michal
$ ls -l /home/michal/crontab /home/michal/fstab
-rw-r--r-- 1 ubuntu ubuntu 722 Oct 18 12:13 /home/michal/crontab
-rw-r--r-- 1 ubuntu ubuntu  82 Oct 18 12:13 /home/michal/fstab
$ multipass transfer /home/michal/crontab /home/michal/fstab keen-yak:
$ multipass exec keen-yak -- ls -l crontab fstab
-rw-rw-r-- 1 multipass multipass 722 Oct 18 12:14 crontab
-rw-rw-r-- 1 multipass multipass  82 Oct 18 12:14 fstab

Last updated a day ago.