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

3 comments:

  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.

    http://www.globalwarmingweb.com/

    ReplyDelete
  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
    http://www.jual-jaring.blogspot.com/
    http://www.agen-jaring.blogspot.com/
    http://www.pancasamudera-safetynet.blogspot.com/
    http://www.toko-jaring.blogspot.com/
    http://www.pusat-jaring.blogspot.com/
    http://jualjaringpengaman.blogspot.com/
    https://pancasamudera.wordpress.com/
    https://pasangjaringfutsal.wordpress.com/
    https://jualtambangmurah.wordpress.com/
    https://tokojaring.wordpress.com/
    https://jualjaringfutsal.wordpress.com/
    https://jaringfutsal.wordpress.com/


    ReplyDelete