vijayaragavalu
August 20th, 2016, 03:05 PM
Hello Everyone,
I am new to LXC containers. I started experimenting LXC containers from few days on ubuntu 16.04 which is systemd based init system.
i have experimented without much of issue for most of the config in privilege LXC container. now i just started unprivilage LXC.
As i dont find exact steps for 16.04 for LXC un priv conatiner creation i just followed below link steps which is for 14.04 LTS
http://www.cyberciti.biz/faq/how-to-...-ubuntu-linux/ (http://www.cyberciti.biz/faq/how-to-create-unprivileged-linux-containers-on-ubuntu-linux/)
when i do LXC-create i faced below error
vijayusrlxc@test:~$ lxc-create -t busybox -n vijayunpriv
lxc-create: conf.c: chown_mapped_root: 3340 No mapping for container root
lxc-create: lxccontainer.c: do_bdev_create: 1047 Error chowning /home/vijayusrlxc/.local/share/lxc/vijayunpriv/rootfs to container root
lxc-create: conf.c: suggest_default_idmap: 4444 You must either run as root, or define uid mappings
lxc-create: conf.c: suggest_default_idmap: 4445 To pass uid mappings to lxc-create, you could create
lxc-create: conf.c: suggest_default_idmap: 4446 ~/.config/lxc/default.conf:
lxc-create: conf.c: suggest_default_idmap: 4447 lxc.include = /etc/lxc/default.conf
lxc-create: conf.c: suggest_default_idmap: 4448 lxc.id_map = u 0 165536 65536
lxc-create: conf.c: suggest_default_idmap: 4449 lxc.id_map = g 0 165536 65536
lxc-create: lxccontainer.c: do_lxcapi_create: 1511 Error creating backing store type (none) for vijayunpriv
lxc-create: lxc_create.c: main: 318 Error creating container vijayunpriv
Can you please let me know whether i am missing any steps for creating unpriv LXC container
or please suggest exact steps for creating un-priv LXC on ubuntu 16.04
Kindly note below my environment , please let me know if you need any more information to support me.
(I have also posted same query at https://ubuntuforums.org/showthread.php?t=2321302)
cat /etc/subgid
vijayusrlxc@test:~$ cat /etc/subgid
test:100000:65536
test:100000:65536
vijayusrlxc:165536:65536
/etc/subuid
vijayusrlxc@test:~$ cat /etc/subuid
test:100000:65536
test:100000:65535
vijayusrlxc:165536:65536
/etc/network/interfaces
vijayusrlxc@test:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
default.config
vijayusrlxc@test:~$ cat ~/.config/lxc/default.config
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e : xx : xx : xx
lxc.id_map=u 0 165536 65536
lxc.id_map=g 0 165536 65536
lxc-checkconfig
vijayusrlxc@test:~$ lxc-checkconfig
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.4.0-34-generic
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled
--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
FUSE (for use with lxcfs): enabled
--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
I am new to LXC containers. I started experimenting LXC containers from few days on ubuntu 16.04 which is systemd based init system.
i have experimented without much of issue for most of the config in privilege LXC container. now i just started unprivilage LXC.
As i dont find exact steps for 16.04 for LXC un priv conatiner creation i just followed below link steps which is for 14.04 LTS
http://www.cyberciti.biz/faq/how-to-...-ubuntu-linux/ (http://www.cyberciti.biz/faq/how-to-create-unprivileged-linux-containers-on-ubuntu-linux/)
when i do LXC-create i faced below error
vijayusrlxc@test:~$ lxc-create -t busybox -n vijayunpriv
lxc-create: conf.c: chown_mapped_root: 3340 No mapping for container root
lxc-create: lxccontainer.c: do_bdev_create: 1047 Error chowning /home/vijayusrlxc/.local/share/lxc/vijayunpriv/rootfs to container root
lxc-create: conf.c: suggest_default_idmap: 4444 You must either run as root, or define uid mappings
lxc-create: conf.c: suggest_default_idmap: 4445 To pass uid mappings to lxc-create, you could create
lxc-create: conf.c: suggest_default_idmap: 4446 ~/.config/lxc/default.conf:
lxc-create: conf.c: suggest_default_idmap: 4447 lxc.include = /etc/lxc/default.conf
lxc-create: conf.c: suggest_default_idmap: 4448 lxc.id_map = u 0 165536 65536
lxc-create: conf.c: suggest_default_idmap: 4449 lxc.id_map = g 0 165536 65536
lxc-create: lxccontainer.c: do_lxcapi_create: 1511 Error creating backing store type (none) for vijayunpriv
lxc-create: lxc_create.c: main: 318 Error creating container vijayunpriv
Can you please let me know whether i am missing any steps for creating unpriv LXC container
or please suggest exact steps for creating un-priv LXC on ubuntu 16.04
Kindly note below my environment , please let me know if you need any more information to support me.
(I have also posted same query at https://ubuntuforums.org/showthread.php?t=2321302)
cat /etc/subgid
vijayusrlxc@test:~$ cat /etc/subgid
test:100000:65536
test:100000:65536
vijayusrlxc:165536:65536
/etc/subuid
vijayusrlxc@test:~$ cat /etc/subuid
test:100000:65536
test:100000:65535
vijayusrlxc:165536:65536
/etc/network/interfaces
vijayusrlxc@test:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
default.config
vijayusrlxc@test:~$ cat ~/.config/lxc/default.config
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e : xx : xx : xx
lxc.id_map=u 0 165536 65536
lxc.id_map=g 0 165536 65536
lxc-checkconfig
vijayusrlxc@test:~$ lxc-checkconfig
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-4.4.0-34-generic
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled
--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
FUSE (for use with lxcfs): enabled
--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig