claudyus / LXC-Web-Panel

LXC Web Panel improved for lxc 1.0+
http://claudyus.github.io/LXC-Web-Panel/
Other
221 stars 68 forks source link

Unprivileged containers #85

Closed arocnies closed 9 years ago

arocnies commented 9 years ago

Edit: Figured it out, found another issue, see below.

I am unable to create unprivileged containers. All of my containers are owned by root and I can't find an option to specify another user in the UI or configuration files. Based on a commit message from googley's repo stating LWP supports unprivileged containers, I assume the feature in included in this fork. Am I missing something?

arocnies commented 9 years ago

I'm an idiot.

For anyone else: Simply create a user with the same credentials as your desired linux user and login to the webui as that user.

I was originally confused when I created a test user. The user didn't match a proper user on my server and no error was given on Test's creation or login. When I logged in as Test, I found the same view as the admin (root) account. I've since repeated this experiment after creating a proper user; this time the view my test user showed at login was that of my proper user.

It looks like improper users login as the last proper used logged in.

cronner commented 9 years ago

It uses another command:

$ lxc-create -n server1 -t debian

This template can't be used for unprivileged containers. You may want to try the "download" template instead. lxc-create: lxccontainer.c: create_run_template: 1197 container creation template for avs failed lxc-create: lxc_create.c: main: 274 Error creating container avs

$ lxc-create -t download -n server1 -- -d debian -r jessie -a amd64

works in console, but lwp can't see them or start

claudyus commented 9 years ago

@arocnies I don't really understand in your second message if there is still a problem or if it was fixed. If so please close the issues

I reproduce your problem @cronner and I believe that it is a configuration issue inherith by default /etc/lxc/default.conf .

$ lxc-start -n server1 --logfile /tmp/log.txt
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
(lxc)cmignanti@cmignanti-asus:~/code/LXC-Web-Panel$ cat /tmp/log.txt 
      lxc-start 1437140286.115 ERROR    lxc_start - start.c:lxc_spawn:1000 - failed to create the configured network
      lxc-start 1437140286.150 ERROR    lxc_start - start.c:__lxc_start:1164 - failed to spawn 'server1'
      lxc-start 1437140291.156 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.
      lxc-start 1437140291.156 ERROR    lxc_start_ui - lxc_start.c:main:346 - To get more details, run the container in foreground mode.
      lxc-start 1437140291.156 ERROR    lxc_start_ui - lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.

The error "failed to create the configured network" could be due to lxc.include in your ~/.config/lxc/default.conf

Anyway this is not a LXC-Web-Panel issues.