Welcome to the Linux Foundation Forum!

Lab 3.2 - lxc-start -n unpriv-cont-user

When we are trying to spin up a container using LXC, it it says to:

  1. There was no setfacl so I did 'sudo apt install acl'
  2. Use setfacl on .local (setfacl -R -m u:231072:x ~/.local). There was no .locaI directory so I created it (touch ~/.local).

student@ubuntu:~$ ll
total 44
drwxr-xr-x 8 student student 4096 Sep 22 01:21 ./
drwxr-xr-x 3 root root 4096 Sep 21 02:40 ../
-rw-r--r-- 1 student student 220 Feb 25 2020 .bash_logout
-rw-r--r-- 1 student student 3771 Feb 25 2020 .bashrc
drwx------ 2 student student 4096 Sep 21 02:47 .cache/
drwxrwxr-x 3 student student 4096 Sep 22 01:12 .config/
drwxrwxr-x 2 student student 4096 Sep 21 03:35 dir1/
drwxrwxr-x 2 student student 4096 Sep 21 03:36 dir2/
-rw-rwxr--+ 1 student student 0 Sep 22 01:31 .local*
-rw-r--r-- 1 student student 807 Feb 25 2020 .profile
drwx------ 2 student student 4096 Sep 21 02:40 .ssh/
-rw-r--r-- 1 student student 0 Sep 21 02:49 .sudo_as_admin_successful
drwxrwxr-x 1 student student 4096 Sep 21 03:35 union/
student@ubuntu:~$ rm .local
student@ubuntu:~$ touch .local
student@ubuntu:~$ setfacl -R -m u:100000:x ~/.local
student@ubuntu:~$ lxc-create --template download --name unpriv-cont-user
lxc-create: unpriv-cont-user: utils.c: mkdir_p: 234 Not a directory - Failed to create directory "/home/student/.local/share/"
student@ubuntu:~$

I follow the instructions and the container installs fine but won't start:

student@ubuntu:~$ lxc-start -n unpriv-cont-user -d
lxc-start: unpriv-cont-user: lxccontainer.c: wait_on_daemonized_start: 877 Received container state "ABORTING" instead of "RUNNING"
lxc-start: unpriv-cont-user: tools/lxc_start.c: main: 306 The container failed to start
lxc-start: unpriv-cont-user: tools/lxc_start.c: main: 309 To get more details, run the container in foreground mode
lxc-start: unpriv-cont-user: tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options

Could this be because the .local file directory didn't exist? I created my VM using VM Workstation but everything appears to be smooth.

Comments

  • Hi @axa0176,

    .local is expected to be a directory, not a file.
    The touch command creates a file.
    The mkdir command creates a directory.

    Regards,
    -Chris

  • Hi Chris,

    Thanks for the response. I realized the .local directory wasn't being created because I made a typo when I was adding the student to a configuration file. Once I fixed that typo the .local directory was automatiically created:

    student@ubuntu:~$ sudo bash -c 'echo student veth lxcbr0 10 >>
    /etc/lxc/lxc-usernet'

    I was typing lxbr0

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training