I'm trying to free up space on my root drive on my ubuntu system.
One thing that is consuming about 12G is multipass. I want to move it to the more spacious /home
directory.
So I followed the instructions here and created the new directory /home/multipass
.
However, I do multipass list and no instances are found. How do I get back my instances? Are there things I should be looking for in the journal that show why it's not working?
EDIT: requested details of what I have done:
root@homebuild:/var/snap/multipass# mkdir /home/multipass
root@homebuild:/var/snap/multipass# snap stop multipass
2023-10-11T13:55:54-04:00 INFO Waiting for "snap.multipass.multipassd.service" to stop.
Stopped.
root@homebuild:/var/snap/multipass# snap connect multipass:all-home
root@homebuild:/var/snap/multipass# mkdir /etc/systemd/system/snap.multipass.multipassd.service.d
root@homebuild:/var/snap/multipass# tee /etc/systemd/system/snap.multipass.multipassd.service.d/override.conf <<EOF
> [Service]
> Environment=MULTIPASS_STORAGE=/home/multipass
> EOF
[Service]
Environment=MULTIPASS_STORAGE=/home/multipass
root@homebuild:/var/snap/multipass# sudo cp -r /var/snap/multipass/common/data/multipassd /home/multipass/data
root@homebuild:/var/snap/multipass# sudo cp -r /var/snap/multipass/common/cache/multipassd /home/multipass/cache
root@homebuild:/var/snap/multipass/common/data# snap start multipass
Started.
# in other window
steves@homebuild:~$ multipass list
No instances found.
Not sure what else needs to be done? I think these are all the instructions in the link.
So the answer is, the MULTIPASS_STORAGE instructions are missing some crucial steps. I solved it by performing these steps.
See my bug report: https://github.com/canonical/multipass/issues/3254
This is a log of all the relevant commands I ran:
At this point, my instances still work. But let's move the original data away
The instance fails to start. If I reboot at this point, the image disappear from the listing!
Now, what I found is that there are 2 configuration files that need updating. One config file multipass-vm-instances.json which has the absolute path of the instance images in the "arguments" key for each instance, and the config file vault/multipassd-instance-image-records.json which has it listed as a "path" key for each instance. These also need to point at the correct directories, or the instance fails to start!
If these are updated, the instances start correctly.