[lxc-users] how to determine if in LXD

tapczan tapczan at unx.pl
Mon Aug 1 14:01:00 UTC 2016


Hello

There is an easy way to determine if I'm in LXC, content of file
/proc/self/cgroup shows path with /lxc, eg:

2:cpu:/lxc/host

However in LXD this rule is no longer valid:

2:cpu:/

It looks like real host from that point of view.

So tools like chef OHAI have issue in determining virtualisation role
and status.

Is there as easy way to determine if I'm inside LXD container?


More information about the lxc-users mailing list