Computer
Computer Diary
    RepRap


    "Our greatest fear is not that we are inadequate, but that we are powerful beyond measure."

    Marianne Williamson
    from her book "A Return To Love"

    Here my little rant and praise place, where the daily experiences of my programming work are expressed. I publish them with the idea that others might find it useful and benefit from it.

    Tag <LXC>

    Check also other posts with other tags.

    2012/11/27
    UNIX Man on Windows 7: VirtualBox + Ubuntu + LXC
    last edited 2013/12/14 07:40 (*)

    I code nowadays (2012/11) on a bunch of laptops (with 2nd screens attached) which run on Windows 7 (Win7) mostly - with one keyboard and mouse controlling 2-4 machines using Synergy package.

    Win7 is suitable for basic works, but in the moment serious programming is required, a real UNIX is required. I used to install Cygwin.com (UNIX framework for Windows) but switched now (2012/10) to VirtualBox.org (VB), which I virtualize an entire LINUX/Ubuntu Server Edition (12.10) box with.


    Once it's running and up, I use PuTTY to ssh/login into the virtual machine, and I follow up and install LXC:

    % sudo apt-get install lxc lxc-utils
    % sudo lxc-create -t ubuntu -n ubu00
    % sudo lxc-console -n ubu00
    

    and you will see an actual login:

    Ubuntu 12.10 ubu00 tty1
    

    ubu00 login: |

    Virtual Machines (LXC) within a Virtual Machine (VirtualBox)

    LinuX Containers (LXC) is a lightweight LINUX virtualization approach with little demands on the CPU unlike other approaches such as Xen.org or KVM ; and therefore it is possible to run LXC containers within a VB-box:

    • Windows 7 (e.g. 192.168.0.10)
      • VirtualBox (with "Bridged Network")
        • LXC Host (e.g. 192.168.0.32)
          • LXC machine 1 (e.g. 10.0.3.12)
          • LXC machine 2 (e.g. 10.0.3.20)
          • etc.

    or Windows7(VirtualBox(LXC Host(LXC machine 1, LXC machine 2,..)))

    The computational overhead of LXC containers to its host is minimal, as LXC is just process isolation, all using the same LINUX kernel.

    As a sidenote, VirtualBox.org the Open Source Software (OSS) performs along the commercial competition like VMWare Player , only apprx. 6% difference, VMWare Player slightly faster.

    LXC framework on Ubuntu 12.10 provides various templates:

    • altlinux
    • archlinux
    • busybox: 2MB small functional LINUX system
    • debian: works right away (apprx. 300MB)
    • fedora: requires yum to be installed first (apprx. 485MB)
    • opensuse: requires zypper to be installed, failed to compile due immature 'cmake' mess
    • ubuntu: works flawlessly (apprx. 310MB)
    • ubuntu-cloud: works flawlessly (apprx. 670MB)

    Additionally you can clone existing LXC containers, e.g. I created

    • ubu00 as default Ubuntu, and
    • ubu01, ubu02 are cloned from ubu00,
    • alike with deb00 Debian.org etc.

    I personally prefer Ubuntu.com LINUX flavor due the solid package manager, and installing the usual components is done quickly, e.g.

    % sudo apt-get install screen lighttpd mysql-server mysql-client mongodb samba
    
    With a decent equipped laptop (e.g. 3GB RAM, 2 cores, 2GHz) a reasonable responsive LINUX box with LXC-based virtualized sub-machines is possible, ideal for development (e.g. CMS like Wordpress.org / Typo3.org / Drupal.org or Mediawiki.org ) and testing configurations intensively.

    Update 2012/11/30: I began to work with server hardware, where I was creating 40 LXC machines, and start and stop them in batch, and I noticed larger amount of LXC do not start and stop reliable as of Ubuntu 12.10, e.g. out of 40 about 1-7 machines fail to start or stop (lxc-stop hangs actually) every 2nd or 3rd time of starting or stopping. So, it's good for experimenting, but for production it seems not yet ready. A quick solution is to put a sleep of one second before starting the next container. I will issue a bug report addressing problem.

    Update 2012/12/21: Nested LXC and juju cloud framework: LXC in Ubuntu 12.04 , useful overview and details.



    Check also other posts with other tags.


    [ post new entry ] (only for administators)

    Title:

    Text:

    Tags: (separated by commas)

    Date (optional):

    Password:
     


    .:.




    Copyright 2007-2016, 2020-2024 © by René K. Müller <spiritdude@gmail.com>
    Illustrations and graphics made with Inkscape, GIMP and Tgif