meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ubiquiti:controller [2020/09/07 17:01] – niziak | ubiquiti:controller [2021/03/20 20:41] (current) – niziak | ||
---|---|---|---|
Line 4: | Line 4: | ||
* Works correctly only with host type networking = no network separation | * Works correctly only with host type networking = no network separation | ||
- | ===== In unprivileged LXC ===== | ||
- | ==== Preparation ==== | ||
- | |||
- | [[https:// | ||
- | |||
- | <code bash> | ||
- | apt-get install lxc | ||
- | </ | ||
- | |||
- | Create user: | ||
- | <code bash> | ||
- | <code bash> | ||
- | |||
- | Find subuids and subgids for created user | ||
- | <code bash> | ||
- | < | ||
- | / | ||
- | / | ||
- | </ | ||
- | |||
- | Allow new user create network interfaces: | ||
- | <file | / | ||
- | unifi veth br-lan 10 | ||
- | </ | ||
- | [[https:// | ||
- | |||
- | Now login as new user (using ssh or su). | ||
- | Create default lxc configureation in user directory: | ||
- | <code bash> | ||
- | mkdir -p ~/ | ||
- | cp / | ||
- | </ | ||
- | |||
- | Edit file below and put subuid and subgid: | ||
- | <file | ~/ | ||
- | lxc.include = / | ||
- | |||
- | lxc.idmap = u 0 1738400 65536 | ||
- | lxc.idmap = g 0 1738400 65536 | ||
- | |||
- | # " | ||
- | lxc.mount.auto = proc:mixed sys:ro cgroup: | ||
- | |||
- | lxc.net.0.type = veth | ||
- | lxc.net.0.link = br-lan | ||
- | lxc.net.0.flags = up | ||
- | lxc.net.0.hwaddr = 00: | ||
- | |||
- | # Disable AppArmor confinement for containers started by non-root | ||
- | # See https:// | ||
- | # https:// | ||
- | |||
- | lxc.apparmor.profile = unconfined | ||
- | # Unprivileged containers started by ROOT can use lxc.apparmor.profile = generated | ||
- | |||
- | / | ||
- | / | ||
- | </ | ||
- | |||
- | Create container: | ||
- | <code bash> | ||
- | * Distribution: | ||
- | * Release: '' | ||
- | * Architecture: | ||
- | |||
- | <code bash> | ||
- | lxc-start -n unifi | ||
- | lxc-ls -f | ||
- | NAME STATE | ||
- | unifi RUNNING 0 | ||
- | </ | ||
- | |||
- | <code bash> | ||
- | cat .ssh/ | ||
- | lxc-attach -n unifi | ||
- | passwd | ||
- | ... | ||
- | < | ||
- | < | ||
- | |||
- | </code bash> | ||
- | lxc-console -n unifi | ||
- | apt-get install openssh-server gnupg2 sudo ca-certificates apt-transport-https wget | ||
- | < | ||
- | </ | ||
- | |||
- | Add autostarting: | ||
- | <file ini ~/ | ||
- | lxc.start.auto = 1 | ||
- | lxc.start.delay = 5 | ||
- | lxc.start.order = 100 | ||
- | lxc.group = onboot | ||
- | </ | ||
- | |||
- | |||
- | Edit cron <code bash> | ||
- | < | ||
- | @reboot / | ||
- | </ | ||
- | |||
- | |||
- | |||
- | === Issues === | ||
- | |||
- | === lxc-start: unifi: tools/ | ||
- | |||
- | <code bash> | ||
- | lxc-start -n unifi -l DEBUG -o debug.log | ||
- | cat debug.log | ||
- | |||
- | ... | ||
- | lxc-start unifi 20200720135645.187 ERROR start - start.c: | ||
- | ... | ||
- | |||
- | sudo setfacl -m u:1738400:x . .local .local/ | ||
- | </ | ||
- | |||
- | |||
- | === Error: lxc-create: unifi: confile.c: set_config_net: | ||
- | |||
- | LXC3 is using different config keys. Easiest way is to convert config file: | ||
- | <code bash> | ||
- | |||
- | === lxc-create: unifi: conf.c: chown_mapped_root: | ||
- | <code bash> | ||
- | sysctl kernel.unprivileged_userns_clone | ||
- | kernel.unprivileged_userns_clone = 0 | ||
- | |||
- | sudo echo " | ||
- | sysctl -p | ||
- | </ | ||
==== Install MongoDB < 4.0.0 ==== | ==== Install MongoDB < 4.0.0 ==== |