environment-setup.sh fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
Following the instructions at HACKING.md:
git clone https:/
cd snapcraft
sudo snap install lxd
sudo lxd init --auto --storage-
The following commands seem to be unnecessary in a fresh Ubuntu VM from a cloud
image as the ubuntu user is already a member of the lxd group as confirmed by
"groups".
# sudo adduser "$USER" lxd
# newgrp lxd
Then:
$ ./tools/
Creating snapcraft-dev
Error: Failed to run: /usr/lib/lxd/lxd forkstart snapcraft-dev /var/lib/
Try `lxc info --show-log snapcraft-dev` for more info
$ lxc info --show-log snapcraft-dev
Name: snapcraft-dev
Remote: unix://
Architecture: x86_64
Created: 2019/10/11 14:00 UTC
Status: Stopped
Type: persistent
Profiles: default
Log:
lxc snapcraft-dev 20191011140030.686 ERROR conf - conf.c:
lxc snapcraft-dev 20191011140030.686 ERROR start - start.c:
lxc snapcraft-dev 20191011140030.706 WARN network - network.
lxc snapcraft-dev 20191011140030.706 ERROR lxccontainer - lxccontainer.
lxc snapcraft-dev 20191011140030.707 ERROR start - start.c:
lxc 20191011140030.720 WARN commands - commands.
Expected: container successfully created
Actual: lxd error on the uid mapping
I don't understand why this isn't working. Here's the problem reduced to just
lxd: https:/
It isn't clear to me if this is a problem with the instructions in HACKING.md, with your
setup script, or an lxd bug. However this is a great big obstacle in getting a
development environment set up for snapcraft, so I'm filing it here.
Thanks to albert23 in #lxcontainers
The following additional entries were required to be added manually:
/etc/subuid:
root:1000:1
/etc/subgid:
root:1000:1
(where 1000 is, I think, $UID on the host).
I guess this needs adding to HACKING.md? Note: I haven't tried this through yet, but the above fix seems to get around the immediate problem.