Incorrect syntax in LXC user config file to create unprivileged containers

Bug #1785523 reported by Eric Newberry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
New
Undecided
Unassigned

Bug Description

In the 18.04 Server Guide, the reader is told to create a file at ~/.config/lxc/default.conf containing the following values (with their equivalent subuid and subgid values) to allow the use of unprivileged containers:

lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
lxc.network.type = veth
lxc.network.link = lxcbr0

However, when I attempt to run this (with a higher log level than default), LXC outputs syntax errors. After a quick search online, it appears that the correct configuration key is "lxc.idmap" instead of "lxc.id_map". Additionally, after correcting this issue, I also received another error message about the network configuration in ~/.config/lxc/default.conf. The official LXC documentation (https://linuxcontainers.org/lxc/getting-started/) states to copy the config file from /etc/lxc/default.conf and use it as a base for the user default.conf, appending the "lxc.idmap" values. This original file on my system contained the following lines, as opposed to the network configuration lines in the Server Guide's suggested configuration:

lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx

After doing the above steps, unprivileged LXC contains can now be created on my system. I am running Ubuntu 18.04 with the latest lxc version from apt (3.0.1-0ubuntu1~18.04.1).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.