Multipass/VMs by default discourages newcomers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
Snapcraft by default will try to install and use multipass to build snaps. This is for reproducibility of the build, as to ensure the rootfs and the kernel are well defined when building a snap.
I'm regularly introducing snapcraft to new persons and had a series of newcomers that struggled creating their first snap because of the multipass by default behavior.
Recently, I had two persons on macOS running Ubuntu in a VM that spent hours figuring out why things were not working from their Ubuntu VM because they hadn't enabled nested virtualization and multipass couldn't create a nested VM in their manually managed VM. Today, a new snapcraft user running an Ubuntu VM under Windows was hit by the same thing. I also had a person in my team iterating over snap builds that found the builds super slow because he hadn't noticed that snapcraft switched from LXD to multipass behind the scenes.
How could snapcraft do a better job?
⋅ snapcraft could make a prominent statement about the fact it's about to use multipass
⋅ snapcraft could detect availability of KVM extensions before trying to launch multipass or availability of a working multipass setup, or could fallback on LXD
⋅ documentation could be changed to explain the differences between running snapcraft natively vs running it in a VM and requirements for that VM setup
⋅ more ambitiously, snapcraft could distinguish between release and non-release builds and give a default fast/debug debug good for iterations with a fat warning that --release should be used for a release build
Best,
- Loïc Minier
For the record, outside of another bug with automatic install of multipass (bug #1859427), this is what happens if I try building a snap under a VM that doesn't support nesting (a multipass provided vm): tireless- panther: ~/s$ snapcraft
ubuntu@
Launching a VM.
launch failed: The following errors occurred:
snapcraft-webface: shutdown called while starting
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.