[lxc-users] Howto/Tutorial wanted: Running an application inside a container

Johannes Kastl mail at ojkastl.de
Sat May 10 18:18:06 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

I thought running a single application inside a container was one of
the main advantages of lxc over 'full'virtualization like KVM. But it
seems I fail to find a nice tutorial how to do this. Any hints?

I found some sites, but the pages I found were pretty old (2012?
2011?), so I am not sure if they are still valid.

I got this far with running apache inside the container:
Create a rootfs containing empty directories for proc, sys, ...
Copy over apache's config into the rootfs
Create a config file that says:

> lxc.network.type = veth lxc.network.flags = up lxc.network.link =
> virbr0 lxc.network.hwaddr = 02:00:e4:28:dd:77 lxc.network.name =
> eth0 lxc.rootfs = /some/path/to/Apache_Test4 lxc.utsname =
> Apache_Test4

I can then run
lxc-execute -n Apache_Test4 -f /path/to/the/config -- /usr/sbin/httpd2

And I get:
> lxc-execute: Failed to find an lxc-init lxc-execute: invalid
> sequence number 1. expected 4 lxc-execute: failed to spawn
> 'Apache_Test4' lxc-execute: Device or resource busy - cgroup_rmdir:
> failed to delete /sys/fs/cgroup/hugetlb/lxc/Apache_Test4 
> lxc-execute: Device or resource busy - cgroup_rmdir: failed to
> delete /sys/fs/cgroup/perf_event/lxc/Apache_Test4 lxc-execute:
> Device or resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/blkio/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/net_cls/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/freezer/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/devices/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/memory/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/cpu,cpuacct/lxc/Apache_Test4 lxc-execute: Device or
> resource busy - cgroup_rmdir: failed to delete
> /sys/fs/cgroup/cpuset/lxc/Apache_Test4

And all the links I found for the "failed ...lxc-init" point me to
installing lxc inside the container. Which is not possible, as it is
no 'complete' OS inside. I also failed to find a file called lxc-init
on my openSUSE host where I installed lxc 1.0.3.

So, what to do? Outdated howtos? Errors on my side (I would not be
surprised)? Did I understand something wrong?

Thanks in advance!

Regards,
Johannes
- -- 
Coming back to where you started is not the same as never leaving.
(Terry Pratchett)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/

iEYEARECAAYFAlNubV4ACgkQzi3gQ/xETbLwHwCgmxy1EepZKJq++AuH4riXTPqW
UvsAn27zXIfJlJPYVcUu2PHvDVjAaSMh
=h5lp
-----END PGP SIGNATURE-----



More information about the lxc-users mailing list