What I've tried:
$ vagrant up --no-provision Bringing machine 'default' up with 'lxd' provider... ==> default: Machine has not been created yet, starting... ==> default: The host machine does not support LXD synced folders. ==> default: ==> default: To use this feature, you must first configure ID mappings for the ==> default: current user in /etc/subuid and /etc/subgid. For more information, ==> default: refer to `vagrant lxd shadow --help`. ==> default: ==> default: Importing LXC image... [fails]
OK, let's try the advice:
$ vagrant lxd shadow --help In order to use shared folders, you must first add the effective user and group ID (which are currently 1000 and 985) to the host machine's subuid(5) and subgid(5) files: $ echo root:1000:1 | sudo tee -a /etc/subuid $ echo root:985:1 | sudo tee -a /etc/subgid For more information about these commands, and user/group ID mapping in general, refer to this article: https://insights.ubuntu.com/2017/06/15/custom-user-mappings-in-lxd-containers/ $ echo root:1000:1 | sudo tee -a /etc/subuid root:1000:1 $ echo root:985:1 | sudo tee -a /etc/subgid root:985:1 $ vagrant up --no-provision Bringing machine 'default' up with 'lxd' provider... ==> default: Machine has not been created yet, starting... ==> default: Importing LXC image... ==> default: Failed to create container The provider was unable to create a container for the 'default' VM. The underlying error message was: Create container: Create LXC container: LXD doesn't have a uid/gid allocation. In this mode, only privileged containers are supported The LXD logs may contain more information about the cause of this failure.
Let's try a bunch of suggestions from all over the place (1, 2, 3). No luck. In all cases I get one of the two above messages. The messages are also weird, because to me they look like they mean the exact same thing, so I don't know which of the solutions get "further" than the other. Especially since the advice all over the place for both messages seem to be the same thing I've tried a dozen times by now, including at least:
printf "%s:100000:65536\n" lxd root | sudo tee /etc/subgid /etc/subuid
printf "%s:1:65536\n" lxd root | sudo tee /etc/subgid /etc/subuid
printf "%s:1:65536\n" root vagrant $USER | sudo tee /etc/subgid /etc/subuid
I've made sure to
sudo systemctl restart lxd before every
printf "%s:1000:65536\n" lxd root | sudo tee /etc/subuid && printf "%s:985:65536\n" lxd root | sudo tee /etc/subgid gave me an interestingly different error message:
Create LXC container: Host id is in the range of subids
No idea why that is an error or how to fix it.
The vagrant user on the box is UID/GID 1000/1000 (after starting it with VirtualBox).