snapcraft --use-lxd should have message about requring sudo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
Running $ snapcraft --use-lxd will set up LXD but it will not connect:
hayden@
Support for 'LXD' 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
lxd 3.21 from Canonical✓ installed
Error: LXD still not running after 30s timeout (Get http://
Timeout reached waiting for LXD to start.
Then, naturally, you try $ sudo snapcraft --use-lxd but get this:
hayden@
The LXD provider is offered as a technology preview for early adopters.
The command line interface, container names or lifecycle handling may change in upcoming releases.
Launching a container.
An error occurred with the instance when trying to launch with 'LXD': No storage pool found. Please create a new storage pool.
Ensure that 'LXD' is setup correctly and try again.
The fix is to $ snap remove lxd --purge and then $ sudo snapcraft --use-lxd.
Because using snapcraft --use-lxd without sudo leaves it in an unusable state, perhaps it should fail and exit if --use-lxd is enabled without sudo.
`sudo` shouldn't be required when invoking snapcraft. As you can see in the log, snapcraft invokes sudo on your behalf when installing LXD.
However, I think we may need to add/check that the user is in the "lxd" group if not run as sudo? Can you verify that your user is not in the "lxd" group?