I have a config file created for an unprivilaged container
lxc.idmap = u 0 231072 1002
lxc.idmap = g 0 231072 1003
lxc.idmap = u 1002 1002 1
lxc.idmap = g 1003 1003 1
lxc idmap = u 1004 232075 64533
lxc.idmap = g 1005 232076 64532
The container starts when i login with the user of the above uid and gid mapping and then i call lxc-starts.
Now i want to start this container as systemd service. Im facing some problems in that. so it would be helpful if i get the below clarifications
My questions are:
-
Is it possible to start the unprivilaged container without logging in as the unprivilaged user?
-
Where do i have to keep the systemd service file for the container. is it in /etc/systemd/system or /lib/systemd/system?
-
this config file is placed now placed in some folder inside the unprivilaged user login. if i have to start the container as systemd service, where should i place the config file
I used
lxc-start -n app -f config command to start the container after logging in as unprivilaged user, which is working fine
if i give ExecStart = /usr/bin/lxc-start -n app -f config, i dont think the container config and container name will be resolved
Could you please guide me on how to do this