[Lxc-users] Howto detect the containers host

Ulli Horlacher framstag at rus.uni-stuttgart.de
Thu May 26 08:52:19 UTC 2011


On Thu 2011-05-26 (09:34), Jäkel, Guido wrote:

> something related to the "Howto detect we're a LXC Container" is the
> question: "Howto detect from inside a container the name (or something
> equivalent) of the machine we're hosted on?"

My lxc meta-script creates /lxc/hostname inside the container at startup:

root at vms2:/lxc# lxc -b vmtest8
root at vms2:/lxc# lxc -x vmtest8 "uname -a; cat /lxc/hostname"
Linux vmtest8 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux
vms2

-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/




More information about the lxc-users mailing list