Thursday, 18 April 2013

Observing the initial LXC environment using procenv

If you're interested in seeing the initial environment inside an LXC container, here's how:
  1. Install procenv inside the container:

    $ sudo apt-get install -y procenv

  2. Shutdown the container:

    $ sudo shutdown -h now
  3. Boot the container (mine is called "raring" in this example) like this:

    $ sudo lxc-start -n raring --console-log /tmp/lxc-console.log \
        -- /usr/bin/procenv --file=/dev/console --exec \
        -- /sbin/init --debug
  4. View the /tmp/lxc-console.log logfile in the host environment.
Note that those two sets of non-option double-dashes are required; the first tells LXC to treat what follows as a command to run after the container starts (in this case procenv), and the second set tells procenv to treat what follows as a command to run after it has finished running (in this case Upstart (/sbin/init :-))!


  1. I have come to the conclusion that we all have a little blame global warming and its consequences and guilt even more politicians who do not slow down.

  2. Nice article, thanks for the information. It's very complete information. I will bookmark for next reference
    jaring futsal | jaring golf | jaring pengaman proyek |
    jaring pengaman bangunan | jaring pengaman gedung