Error when run inside a VM without --use-lxd
Metadata
Current evaluation
Resolved by improving error messages and making LXD the default build environment. Snapcraft now handles nested VM scenarios without requiring the --use-lxd flag.
Suggested action: —
No scores available.
Issue body
snapcraft 3.5
Snapcraft tries to set up and use multipass when already inside a VM. It should error and tell the user they must run with --use-lxd as snapcraft cannot run its build VM nested inside another VM.
evan@evan-VirtualBox:~$ which snapcraft
evan@evan-VirtualBox:~$ snap list
No snaps are installed yet. Try "snap install hello-world".
evan@evan-VirtualBox:~$ sudo snap install --classic snapcraft
[sudo] password for evan:
2019-05-24T13:43:37+01:00 INFO Waiting for restart...
snapcraft 3.5 from 'canonical' installed
evan@evan-VirtualBox:~$ mkdir example
evan@evan-VirtualBox:~$ cd example/
evan@evan-VirtualBox:~/example$ snapcraft init
Created snap/snapcraft.yaml.
Go to https://docs.snapcraft.io/the-snapcraft-format/8337 for more information about the snapcraft.yaml format.
evan@evan-VirtualBox:~/example$ cat snap/snapcraft.yaml
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
my-part:
# See 'snapcraft plugins'
plugin: nil
evan@evan-VirtualBox:~/example$ snapcraft
Using 'snap/snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Support for 'multipass' needs to be set up. Would you like to do that it now? [y/N]: y
snapd is not logged in, snap install commands will use sudo
multipass (beta) 0.6.1 from Canonical✓ installed
Waiting for multipass...
Launching a VM.
launch failed: CPU does not support KVM extensions.
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.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Resolved by improving error messages and making LXD the default build environment. Snapcraft now handles nested VM scenarios without requiring the --use-lxd flag. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
100
Complexity:
10
Confidence:
95
Support Request:
0
|
close stale | Snapcraft 3.5 fails inside a VM due to missing KVM support; suggests early error with --use-lxd guidance. Unlabeled, zero comments, inactive for seven years. Clearly irrelevant to modern snapcraft versions. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
20
Confidence:
85
Support Request:
10
|
close stale | Snapcraft 3.5 fails with a KVM error when running inside a VM and attempting to use multipass. Requests an early error message directing users to --use-lxd. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
15
Confidence:
85
Support Request:
10
|
close stale | Snapcraft 3.5 fails with a KVM error when running inside a VM without --use-lxd. Unlabelled, no maintainer response, inactive for ~7 years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
15
Confidence:
95
Support Request:
10
|
close stale | Report that snapcraft fails with a cryptic KVM error when run inside a VM and requests a graceful error message directing users to use --use-lxd. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1689695 Make the error message when LXC is not found a bit better | snapcraft (launchpad) | closed | Improved LXC not found error messaging for snapcraft cleanbuild was closed without implementation. Zero comments and no associated pull requests indicate the enhancement was abandoned or resolved without code changes. |