Hi there!
Also you can do this via terminal:
- Stop pct (ex.: vmid is 100):
- Make backup
- Make temp dir (ex.: /tmp/100):
- Mount container
Code:
mount -o loop /path/to/vm-100-disk... /tmp/100
- Run follow commands:
Code:
find /tmp/100 -type f | while read S; do U="$(ls -ln "${S}" | awk '{print$3}')"; G="$(ls -ln "${S}" | awk '{print$4}')"; F=100000; chown "${F:0: -${#U}}${U}:${F:0: -${#G}}${G}" "${S}"; done
find /tmp/100 -type d | while read S; do U="$(ls -lnd "${S}" | awk '{print$3}')"; G="$(ls -lnd "${S}" | awk '{print$4}')"; F=100000; chown "${F:0: -${#U}}${U}:${F:0: -${#G}}${G}" "${S}"; done
[ -e /tmp/100/var/spool/postfix/dev/-random ] && rm -ri /tmp/100/var/spool/postfix/dev/-random
[ -e /tmp/100/var/spool/postfix/dev/-urandom ] && rm -ri /tmp/100/var/spool/postfix/dev/-urandom
- As well if you are using sudo in lxc you should check the 'set owner id on execution' because some time it can be changed:
Code:
[ -e /tmp/100/usr/bin/sudo ] && chmod u+s /tmp/100/usr/bin/sudo
- Unmount container:
- Change config:
Code:
echo -e "\nunprivileged: 1" >> /path/to/lxc100.conf
- Run pct:
Code:
pct start 100
(use --verbose option if you need)
- Enjoy.
Tested on Debian 8, 10 for default subid settings.
Regards!