Skip to content

Commit

Permalink
Fix umbrel-dev for multipass 1.14
Browse files Browse the repository at this point in the history
Multipass dropped support for Ubuntu 23.10 base images which we had
pinned to so the latest version of Multipass gave errors when trying to
provision a VM saying that Ubuntu version didn't exist.

After changing to the latest LTS 24.04 a VM could be created but the
provision script failed to execute with a permission error. It looks
like the way mounts work has totally changed in this version of
Multipass because now all mounts are unable to be read inside the VM.
You can't even fix it with permissions, even root cannot read the files
and you can't chown/chmod etc.

Multipass has another mount type called `native`
(https://multipass.run/docs/mount#native-mounts) which works for me on
Mac, however you can't specify this mount type at VM creation and also
can't create this mount type while the VM is running. So we now, create
the VM, wait for it to boot, then stop it, then setup the native mount,
then start it again, then run the provision script.

The provision script then fails because the version of Docker we use
(25.0.4) does not exist in the Ubuntu 24.04 repos because that Ubuntu
version came out after that Docker version. This was fixed by rolling
the Ubuntu version back to the previous LTS version 22.04.

This is now working for but since we've changed Ubuntu versions every
single package on the system will now be a different version to what
we've tested before. Also the native mount type acts differently on
different systems and doesn't always work if the native platform doesn't
support it. It's unclear how well this will work on other platforms but
it appears to work well for me on arm macOS.
  • Loading branch information
lukechilds authored Aug 14, 2024
1 parent 570acda commit 7103e98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"vm:provision": "multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G --mount $PWD:/opt/umbrel-mount 23.10 && multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision",
"vm:provision": "multipass launch --name umbrel-dev --cpus 4 --memory 8G --disk 50G 22.04 && npm run vm:stop && multipass mount --type native $PWD umbrel-dev:/opt/umbrel-mount && multipass exec umbrel-dev -- /opt/umbrel-mount/scripts/vm provision",
"vm:shell": "multipass shell umbrel-dev",
"vm:exec": "multipass exec --working-directory /home/ubuntu umbrel-dev --",
"vm:logs": "multipass exec umbrel-dev -- journalctl --unit umbreld-production --unit umbreld --unit ui --follow --lines 100 --output cat",
Expand Down

0 comments on commit 7103e98

Please sign in to comment.