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 :-))!

Comments

Popular posts from this blog

Procenv 0.46 - now with more platform goodness

Byobu Bling with Unicode Custom Indicators

Upstart User Sessions in Ubuntu Raring