View: 24319|Reply: 15

Running lxc containers on the Loboris Debian

[Copy link]

2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
Published in 2015-11-6 19:09:01 | Show all floors |Read mode
Hi All,

It seems we are missing some kernel options regarding cgroups and veth which are needed to run lxc.

CONFIG=/home/build/OrangePI-Kernel/linux-3.4/.config lxc-checkconfig

--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: missing
Cgroup cpuset: missing

--- Misc ---
Veth pair device: missing
Macvlan: missing
Vlan: missing
File capabilities: enabled


I managed to build the veth out of tree, but I do not seem to be able to cross compile the kernel from Loboris'  github on my Debian 7  desktop.

Maybe these can be included in the next kernel Loboris releases as running lxc containers is quite a nice thing to be able to do.

Thanks.

2

threads

34

posts

421

credits

Intermediate member

Rank: 3Rank: 3

credits
421
Published in 2015-11-10 15:38:16 | Show all floors
I second this! Containers would open a whole new lot of experiences with those little boards.

10

threads

448

posts

5115

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
5115
Published in 2015-11-10 18:17:12 | Show all floors
Edited by loboris at 2015-11-10 11:18

I've updated the kernel you can try it.

Download update_kernel.sh script:
  1. wget http://loboris.eu/update_kernel.sh
  2. sudo mv update_kernel.sh /usr/local/bin
  3. sudo chmod +x /usr/local/bin/update_kernel.sh
Copy code
To update the kernel to the new (test) version run:
  1. sudo update_kernel.sh test
Copy code
boris@UbuntuMate:/home/LoBo2_Razno/OrangePI/kernel_3.4.9/linux-3.4$ CONFIG=./.config lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled                                                                                                                       
Ipc namespace: enabled                                                                                                                           
Pid namespace: enabled                                                                                                                           
User namespace: enabled                                                                                                                          
Network namespace: enabled                                                                                                                       
Multiple /dev/pts instances: enabled                                                                                                            
                                                                                                                                                
--- Control groups ---
Cgroup: enabled
Cgroup clone_children flag: enabled                                                                                                              
Cgroup device: enabled                                                                                                                           
Cgroup sched: enabled                                                                                                                           
Cgroup cpu account: enabled                                                                                                                     
Cgroup memory controller: enabled                                                                                                               
Cgroup cpuset: enabled                                                                                                                           
                                                                                                                                                
--- Misc ---
Veth pair device: enabled
Macvlan: enabled                                                                                                                                 
Vlan: enabled                                                                                                                                    
File capabilities: enabled                                                                                                                       
                                                                                                                                                
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig


2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
 Author| Published in 2015-11-11 19:14:36 | Show all floors
Hi Loboris,

  1. root@lxc-host:~# lxc-ls --fancy
  2. NAME           STATE    IPV4           IPV6  AUTOSTART  
  3. ------------------------------------------------------
  4. webmon-jessie  RUNNING  192.168.99.21  -     YES        
Copy code


This works great , now I can move some of my Banana Pi containers over to the Orange Pi Pc.

The test container already feels much more responsive .

Thank you Loboris.

0

threads

3

posts

52

credits

Registered member

Rank: 2

credits
52
Published in 2015-11-12 02:05:10 | Show all floors

Hi, retroman.

I have ubuntu vivid mate image on OrangePi PC and make:

  1. wget http://loboris.eu/update_kernel.sh
  2. sudo mv update_kernel.sh /usr/local/bin
  3. sudo chmod +x /usr/local/bin/update_kernel.sh
  4. sudo update_kernel.sh test
Copy code
then

  1. apt-get install lxc
  2. lxc-create -t fedora -n my-container
  3. lxc-start -n my-container -d
Copy code
and have error:
  1. root@OrangePI:~# lxc-start -n my-container
  2. lxc: cgmanager.c: lxc_cgmanager_escape: 330 call to cgmanager_move_pid_abs_sync(blkio) failed: A proxy is req uired
  3. lxc-start: lxc_start.c: main: 344 The container failed to start.
  4. lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
  5. lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpr iority options.

  6. root@OrangePI:/var/log/lxc# cat /var/log/lxc/my-container.log
  7. lxc-start 1447264970.980 ERROR lxc_conf - conf.c:run_buffer:325 - Script exited with status 1
  8. lxc-start 1447264970.981 ERROR lxc_conf - conf.c:lxc_setup:3853 - failed to run mount hooks for container 'my-container'.
  9. lxc-start 1447264970.981 ERROR lxc_start - start.c:do_start:699 - failed to setup the container
  10. lxc-start 1447264970.981 ERROR lxc_sync - sync.c:__sync_wait:51 - invalid sequence number 1. expected 2
  11. lxc-start 1447264971.273 ERROR lxc_start - start.c:__lxc_start:1164 - failed to spawn 'my-container'
  12. lxc-start 1447264976.280 ERROR lxc_start_ui - lxc_start.c:main:344 - The container failed to start.
  13. lxc-start 1447264976.280 ERROR lxc_start_ui - lxc_start.c:main:346 - To get more details, run the container in foreground mode.
  14. lxc-start 1447264976.281 ERROR lxc_start_ui - lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.
Copy code
How do you start container ?

0

threads

10

posts

78

credits

Registered member

Rank: 2

credits
78
Published in 2015-11-12 04:25:19 | Show all floors
Does anybody tried Docker? The daemon fails with this error:

  1. docker.service - Docker Application Container Engine
  2.    Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  3.    Active: failed (Result: exit-code) since sze 2015-11-11 21:19:34 CET; 3min 27s ago
  4.      Docs: http://docs.docker.com
  5.   Process: 882 ExecStart=/usr/bin/docker daemon $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
  6. Main PID: 882 (code=exited, status=1/FAILURE)

  7. nov 11 21:19:33 narancs systemd[1]: Starting Docker Application Container Engine...
  8. nov 11 21:19:34 narancs docker[882]: time="2015-11-11T21:19:34.341206175+01:00" level=warning msg="You are running linux kernel version 3.4.39-02-lobo, which might be unstable running docker. Please upgrade your kernel to 3.10.0."
  9. nov 11 21:19:34 narancs docker[882]: time="2015-11-11T21:19:34.363118122+01:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
  10. nov 11 21:19:34 narancs docker[882]: time="2015-11-11T21:19:34.414013405+01:00" level=error msg="[graphdriver] prior storage driver "devicemapper" failed: Error running DeviceCreate (CreatePool) dm_task_run failed"
  11. nov 11 21:19:34 narancs docker[882]: time="2015-11-11T21:19:34.414582764+01:00" level=fatal msg="Error starting daemon: error initializing graphdriver: Error running DeviceCreate (CreatePool) dm_task_run failed"
  12. nov 11 21:19:34 narancs systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
  13. nov 11 21:19:34 narancs systemd[1]: Failed to start Docker Application Container Engine.
  14. nov 11 21:19:34 narancs systemd[1]: Unit docker.service entered failed state.
  15. nov 11 21:19:34 narancs systemd[1]: docker.service failed.
Copy code


2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
 Author| Published in 2015-11-12 16:46:56 | Show all floors
kpox replied at 2015-11-12 02:05
Hi, retroman.

I have ubuntu vivid mate image on OrangePi PC and make:

Hi Kpox,

I just did a test lxc creates a ubuntu container just fine on debian.

Are you sure you did a modprobe as  provided in the post of Loboris.

Below a short excerpt of how I installed the Ubuntu container.
# uname -a
Linux lxc-host 3.4.39-02-lobo #1 SMP PREEMPT Tue Nov 10 10:37:50 CET 2015 armv7l GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID:        Debian
Description:        Debian GNU/Linux 8.2 (jessie)
Release:        8.2
Codename:        jessie

# dpkg -s lxc|grep Version

# apt-get install -y ubuntu-archive-keyring

# lxc-create --name ubuntu -t ubuntu
Checking cache download in /var/cache/lxc/precise/rootfs-armhf ...
Installing packages in template: ssh,vim,language-pack-en
Downloading ubuntu precise minimal ...
--- A lot bla bla bla

When finished just start it
# lxc-start -n ubuntu

# lxc-ls --fancy|grep ubuntu
ubuntu         RUNNING  192.168.99.23  -     YES


2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
 Author| Published in 2015-11-12 17:11:28 | Show all floors
Drakoh replied at 2015-11-12 04:25
Does anybody tried Docker? The daemon fails with this error:

Hi Drakoh,

The Orange Pi provided kernel is just too old for docker, as at minumun a 3.10 kernel is required, we will need to wait (a long time) until the h3 support is mainlined.

Or buy one of the boards which do already have a more modern kernel support.

Such as the boards already supported by Debian natively.

https://wiki.debian.org/InstallingDebianOn/Allwinner

or

https://wiki.debian.org/ArmHardFloatPort/CuBox-i

As I have both boards I know these are well supported.



0

threads

3

posts

52

credits

Registered member

Rank: 2

credits
52
Published in 2015-11-12 18:23:52 | Show all floors
retroman replied at 2015-11-12 16:46
Hi Kpox,

I just did a test lxc creates a ubuntu container just fine on debian.


  1. root@OrangePI:/# uname -a
  2. Linux OrangePI 3.4.39-02-lobo #1 SMP PREEMPT Tue Nov 10 10:37:50 CET 2015 armv7l armv7l armv7l GNU/Linux
  3. root@OrangePI:/# lsb_release -a
  4. No LSB modules are available.
  5. Distributor ID: Ubuntu
  6. Description:    Ubuntu 15.04
  7. Release:        15.04
  8. Codename:       vivid
  9. root@OrangePI:/# dpkg -s lxc|grep Version
  10. Version: 1.1.2-0ubuntu3.2
  11. root@OrangePI:/# lxc-checkconfig
  12. Kernel configuration not found at /proc/config.gz; searching...
  13. Kernel configuration found at /boot/config-3.4.39-02-lobo
  14. --- Namespaces ---
  15. Namespaces: enabled
  16. Utsname namespace: enabled
  17. Ipc namespace: enabled
  18. Pid namespace: enabled
  19. User namespace: enabled
  20. Network namespace: enabled
  21. Multiple /dev/pts instances: enabled

  22. --- Control groups ---
  23. Cgroup: enabled
  24. Cgroup clone_children flag: enabled
  25. Cgroup device: enabled
  26. Cgroup sched: enabled
  27. Cgroup cpu account: enabled
  28. Cgroup memory controller: enabled
  29. Cgroup cpuset: enabled

  30. --- Misc ---
  31. Veth pair device: enabled
  32. Macvlan: enabled
  33. Vlan: enabled
  34. File capabilities: enabled

  35. Note : Before booting a new kernel, you can check its configuration
  36. usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
Copy code


0

threads

10

posts

78

credits

Registered member

Rank: 2

credits
78
Published in 2015-11-13 02:27:16 | Show all floors
retroman replied at 2015-11-12 17:11
Hi Drakoh,

The Orange Pi provided kernel is just too old for docker, as at minumun a 3.10 kernel  ...

Hi retroman!

I've read the warning in the log, but I hoped there is a way to make it work.
Guess I have to learn the usage of LXC.

You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list