0

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.

  • Please [edit] your question to include the elements of the solution you've tried in the post itself rather than relying on a link to the guide you followed. We need to understand what steps you took specifically and the error messages you got in the process as they will help us better diagnose your problem. – waltinator Oct 11 '23 at 19:46
  • OK, I've added in a log of the commands I executed. – Steven Schveighoffer Oct 11 '23 at 22:02

1 Answers1

0

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:

steves@homebuild:~$ multipass list
Name                    State             IPv4             Image
nrmbuild                Stopped           --               Ubuntu 18.04 LTS
steves@homebuild:~$ sudo snap stop multipass
2023-10-12T20:58:23-04:00 INFO Waiting for "snap.multipass.multipassd.service" to stop.
Stopped.
steves@homebuild:~$ sudo snap connect multipass:all-home
steves@homebuild:~$ mkdir -p multipass
steves@homebuild:~$ sudo chown root multipass
steves@homebuild:~$ sudo mkdir /etc/systemd/system/snap.multipass.multipassd.service.d/
steves@homebuild:~$ sudo tee /etc/systemd/system/snap.multipass.multipassd.service.d/override.conf <<EOF
[Service]
Environment=MULTIPASS_STORAGE=/home/steves/multipass
> EOF
[Service]
Environment=MULTIPASS_STORAGE=/home/steves/multipass
steves@homebuild:~$ sudo systemctl daemon-reload
steves@homebuild:~$ sudo cp -r /var/snap/multipass/common/data/multipassd /home/steves/multipass/data
steves@homebuild:~$ sudo cp -r /var/snap/multipass/common/cache/multipassd /home/steves/multipass/cache
steves@homebuild:~$ sudo snap start multipass
Started.
steves@homebuild:~$ multipass list
Name                    State             IPv4             Image
nrmbuild                Stopped           --               Ubuntu 18.04 LTS

At this point, my instances still work. But let's move the original data away

steves@homebuild:~$ sudo mkdir /root/multipass
steves@homebuild:~$ sudo mv /var/snap/multipass/common/data/multipassd /root/multipass/data
steves@homebuild:~$ sudo mv /var/snap/multipass/common/cache/multipassd /root/multipass/cache
steves@homebuild:~$ multipass list
Name                    State             IPv4             Image
nrmbuild                Stopped           --               Ubuntu 18.04 LTS
steves@homebuild:~$ multipass shell nrmbuild
start failed: cannot start VM without an image

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.

karel
  • 114,770