perf – Performance analysis tools for Linux

Please go ahead and help yourself by using your favorite os’s package manager to get it installed in the system.

I am gonna play with it bit more to show you how you can manipulate the kernel internal to get the actual picture. But why I said “actual picture“? Because many of userspace tool missed the little stuff underneath to give you a clear view what is going on inside the system.

Well, first thing first (assuming you get over the triviality of installing the tool!),we need to capture the internal state of a running command.How do we do that? But before that, look at the man pages of this tool,it is short and precise,so it won’t take you too much time go through it. It looks something like this if you do man perf on the terminal window.


Then, you need to run perf –help to find out the options it provide and how to use it properly!


Well, now you need to do something (I mean some activity) and impose perf to get the internals for you.The easiest way,I think to run a command on one terminal and run the perf related command on others terminal window! just like below:

Running top -c on one screen window!


Another screen window I ran  sudo perf record –all-cpus and wait for few seconds and press CTRL-C to terminate the data capture. In this case, I am trying to capture the all CPU related stats, that is why I passed that argument to perf record.


This captured data is saved in current directory with a name . Now , I am going to run other perf utility on this file to show . I ran perf script, which show traced data inside that file :


Okay, that’s a fragment of the output ,as I tried to capture the screenful only. But that is good enough to know what it is spitting out.

Then ,again I ran perf stat to find out the measure of any command pass along with it. The double dash (–) is for standard output.


For system profiling I ran perf top –all-cpus to get the enlisting of the current events.


Fine, I need to know what is stored in previously captured file,kinda report of perf events. For that I ran perf report -i (this file sits on the directory ,where I am firing this command)


Now, I am gonna capture some memory events in the file and then display it in below two screenshots. For the first screenshot, I ran perf mem record



And now you can see below the memory get consumed or distributed.


Next, I ran perf annotate , which basically show the codes of the along with assembly code ,next two screenshots are for that..


And look at how firefox’s code getting disassembled!


How to enlist the events captured by perf ? Simple, run perf evlist


Cool, now measuring the kernel memory properties, we need to run perf kmem record and perf kmem stat …..I have captured it in a single screenshot.



If we want to know any specific tool system behaviour on load time with some nice stat and graph ,then perf timechart is your friend. I tried to capture it in below screenshot, I ran perf timechart record top


Now I ran perf timechart and it saves the captured state in a svg file ..


How to see it? Simply open the file in the browser and you can see something similar like this :


And this :


Well, I believe this is enough to gives you heads up about performance measurement.If you are still interested to dig deep and know more about it. Please follow  Branden Gregg of Netflix as he is maintaining and doing the bulk of  work related to it.

Hope this helps.



How to fix wlanO not found

The problem statement is while doing an *ip a* on the terminal and its output doesn’t show the wireless device, like below:


The dmesg says like this below:


Let me cross check that file is present in the system or not,  just like below:


So, it is very much seated there, where it suppose to be  Well, that trigger me trip to visit some kernel config variables, like below:


It looks fine, then?? well, that warrant few more checks, well I made some trip to *gentoo forum* to know what is missing. And someone in the closed thread mentioned that The variable in question is CONFIG_IWLWIFI which is recommended =m and that necessarily meant I have to recompile the kernel one more time with that variable set to the module in the kernel.

Next, I went ahead and compile the kernel with that mentioned variable as the module. Okay, I have rebooted my machine and here is the outcome,


Cool, but why we have to turn it to a module within the kernel than just straight built into the kernel not showing the device ?? The reason, by the time kernel boot and the firmware file, reside on the filesystem not yet read so it was missing.

Hope this will help.





How to sign your git commit?

First thing first,you are supposed to have a digital key. Haven’t you?? Get one!, but how? Here is how to create gpg key from command line.

I am assuming( o yeah I can’t help myself about that! thinking of you being smart enough to figure it out) ,if  you haven’t already installed GNUPG yet , read it here about it and take advantage of your OS’s package manager to install the package .

Again, once you setup your gpg key and uploaded it into the one of the keyserver and it will sync with other keyservers too.  Mind you, only share your public key , the private key should be reside with you.

Heads up! for heaven’s sake please remember the passphrase you enter while creating the key and do not forget to create a revocation certificate too.

Another way , you might start using keybase ,which quite new ,but has promise and will take over gnupg soon( thinking in that direction) . If you want to use , please let me know, I have few invite left with me. But please disclose your original identity .

Now, you need to tell git to use your private key to encrypt your commits ,but how? Here is how you should do on:

I think, this page is very well explained. Give some effort to read it and understand it.

I believe you understood the previous link to gpg signing(again assuming you did!). Once you properly done with it . You can verify like below :

bhaskar@ArchLinux_17:34:07_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git log –show-signature -1
commit a825344b39e962dcf3df91a276cfb53fd57db4dc
gpg: Signature made Sun 20 Nov 2016 04:27:44 PM IST
gpg:                using RSA key B23A9DB7114B2915
gpg: Good signature from “Bhaskar Chowdhury (Musing_with_GNU/Linux!!) <>” [ultimate]
gpg:                 aka “[jpeg image of size 62428]” [ultimate]
Author: Bhaskar Chowdhury <>
Date:   Sun Nov 20 16:27:33 2016 +0530

modified few sentences

Signed-off-by: Bhaskar Chowdhury <>


But hey! how do you sign the commit??  Two ways:

  1. You need to pass -S  along the line with commit command and give the key hash.This is the laborious way to do thing and soon become very cumbersome.

Of course there is better way and that is second way of doing it:

2. You need to put in the global section of the git config (by doing git config add ) or by placing it for any project specific way . Like below ,I am having this configuration for this project.

bhaskar@ArchLinux_17:41:10_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git config –list Chowdhury
user.signingkey=**Long hash for key**(hsg23ljfgdrtu456)
pretty.fixes=Fixes: %h (“%s”)
alias.logline=log  –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit


You are good enough to read it through ..aren’t you? By the way , those are git config options ,you need to tell git to use it by providing the key value at the git command line ,like this :

bhaskar@ArchLinux_17:41:26_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git config add

If you did that with your mail id for a the specific project ,it can how you the first line of output shown above. Likewise ,you need to do that for other options too.

Did you notice there is “singed-off-by” ? It can be achieved by using -s (small ess) along the commit message or automate it like other options mentioned above.Why that is there ? Because ,oftentimes ,commiter and the author of the patch is not the same person. Plus for reviewing purpose.So, both author and commiter get credit for the submission 🙂 .

This post is very rudimentary and assuming the reader is capable enough to do lot of research .BTW if you have any genuine query about it ,please do let me know.




GNU/Linux container internals aka Cgroups and Namespaces

In this post, I will shed some light on the GNU/Linux container internals.Basically, what is underlying technology driving that. Here we go,without much ado:

What is GNU/Linux Container?

Is an operating system-level virtualization method for running multiple isolated GNU/Linux systems (containers) on a single control host (LXC host). It does not provide a virtual machine, but rather provides a virtual environment that has its own CPU, memory, block I/O, network, etc. space. This is provided by cgroups ( we will give details about it later) features in Linux kernel on LXC host. It is similar to a chroot, but offers much more isolation.
Before I give you the information about LXC , let me make you aware of the two crucial aspect of it ,namely cgroups and namespace.

Cgroups AKA Control Group:

It is a Linux kernel feature to limit, police and account the resource usage of certain processes (actually process groups).

  • Create and manage them on the fly using tools like cgcreate, cgexec, cgclassify etc
  • The “rules engine daemon”, to automatically move certain users/groups/commands to groups (/etc/cgrules.conf and /usr/lib/systemd/system/cgconfig.service)
  • Through other software such as (LXC) virtualization
  • (control groups) subsystem is a Resource Management solution providing a generic process-grouping framework
  • Cgroups provide resource management solution (handling groups)

For Cgroups implementation need a few simple hook into rest of the kernel,namely :

a) For each process :/proc/pid/cgroup

b) System-wide: /proc/cgroup
But we are lucky enough that, newer distribution running systemd comes along with all those tweak by default,so don’t sweat.

A little internals does not harm!! here we go :

First,cgroups use VFS(virtual file systems),all entries created in it ,are not persistent,means deleted on reboot.

Second, all cgroups actions are performed via file systems actions(create/remove directory,reading/writing to the files in it,mounting/mount options).

For example :

cgroup inode_operations for cgroup mkdir/rmdir.

cgroup file_system_type for cgroup mount/unmount.

cgroup file_operations for reading/writing to control files.

Systemd uses control groups only for the process grouping ;not for anything else like allocating resources like block io, bandwidth,etc.

It look something like this :

#subsys_name hierarchy    enabled

cpuset  8    1    1

cpu 3    2    1

cpuacct 3    2    1

blkio   4    2    1

memory  7    2    1

devices 2    41   1

freezer 5    1    1

net_cls 6    1    1

Below are few things you can do with cgroup,provided the library is installed:


cgcreate -g cpuset:/test

cgset -r cpuset.cpus=1 /test

cgset -r cpuset.mems=0 /test

cgexec -g

I have touched the tip of ice-burg ,if you are really interested to explore more , then you should follow the below mentioned link.

To use the effect of it ,you got to install libcgroup. The best place to know about cgroups is here and here and here  . Please read those mentioned link before to get a thorough understanding of cgroups.


a)It is light weight process virtualization.

b) Isolation : enable a process or group of process to view the system in different perspective.

c)Much like zones in Solaris.

d)No hypervisor layer(as in OS virtualization like kvm and xen)

There are currently 6 namespaces,those are:

  • mnt(mount points and filesystems)
  • pid(processes)
  • net(network stack)
  • ipc(system v ipc)
  • uts(hostname)
  • user(UIDs)

Namespace first appear in Linux kernel 2.4.19,way back in 2002!!

** Each namespace has a unique inode number.

You need to know which config options are get effected ,while manipulating it(namespace). Here are those :

Kernel config items:







Each and every option doing the specific duty,as mentioned earlier. And in user space you have two package to play with it,those are :

iproute and util_linux 

Please explore those package in and the offering in detail to work with the above.Plus one has care about below findings:

How to find all existing namespace in GNU/Linux?

If you execute as root,you get the list of attached namespaces of the init process using PID=1.

In order to find other namespaces with attached processes in the system, we use these entries of the PID=1 as a reference. Any process or thread in the system, which has not the same namespace ID as PID=1 is not belonging to the DEFAULT namespace.

Additionally, you find the namespaces created by “ip netns add ” by default in /var/run/netns/ .

Okay, credit has to be given where it’s due……

Rami Rosen was kind enough to provide lots of information about those and most importantly share with public.Thanks Rami!  Here is his paper about it.

Check out this wonderful guide about it at LWN. Equally well written blog about it on opencloudblog and  here .

How docker use namespace,specifically about mount namespace.

Justin Weissig written a wonderful article about cgroups.

A must view place is kernel documentation about cgroups.

Ginny Henningsen and Lenz Grimmer written a magnificent blog at Oracle site.

Hope this will give you heads up.


Experimentation with Docker!!

Something very rudimentary!! Doing it on Fedora 20…


sudo docker run -i -t ubuntu /bin/bash
Unable to find image ‘ubuntu’ locally
Pulling repository ubuntu
c4ff7513909d: Pulling image (latest) from ubuntu, endpoint:


 sudo docker run -i -t ubuntu /bin/bash
Unable to find image ‘ubuntu’ locally
Pulling repository ubuntu
c4ff7513909d: Download complete
511136ea3c5a: Download complete
1c9383292a8f: Download complete
9942dd43ff21: Download complete
d92c3c92fa73: Download complete
0ea0d582fd90: Download complete
cc58e55aa5a5: Download complete



sudo usermod -a -G docker $USER


docker ps -a
2014/09/03 10:34:00 Get http:///var/run/docker.sock/v1.13/containers/json?all=1: dial unix /var/run/docker.sock: permission denied
bchowdhury@LAP-02-1755_10:34:00_Wed Sep 03:~> sudo !!
sudo docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                      PORTS                     NAMES
0ca15a2562d2        ubuntu:latest                       /bin/bash              4 minutes ago       Exited (0) 18 seconds ago                             suspicious_ardinghelli   
55ff2eb67efa        openshift/centos-rockmongo:latest   /usr/sbin/httpd -D F   7 weeks ago         Exited (0) 7 weeks ago                                rockmongo-1              
e35bc98b4e54        openshift/centos-rockmongo:latest   /bin/true /usr/sbin/   7 weeks ago         Exited (0) 7 weeks ago                                rockmongo-1-data         
105ebab5aea8        openshift/centos-mongodb:latest     /usr/bin/mongod –co   7 weeks ago         Up 9 minutes      >27017/tcp   mongodb-1                
bf3bfb0340c6        openshift/centos-mongodb:latest     /bin/true /usr/bin/m   7 weeks ago         Exited (0) 7 weeks ago                                mongodb-1-data


sudo docker rm 55ff2eb67efa


 sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
0ca15a2562d2        ubuntu:latest       /bin/bash           7 minutes ago       Exited (0) 2 minutes ago                       suspicious_ardinghelli  


sudo docker ps -l
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
0ca15a2562d2        ubuntu:latest       /bin/bash           7 minutes ago       Exited (0) 3 minutes ago                       suspicious_ardinghelli


sudo docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu                       latest              c4ff7513909d        3 weeks ago         213 MB
openshift/centos-mongodb     latest              b3da2228dc84        3 months ago        744 MB
openshift/centos-rockmongo   latest              0e2207bb1643        3 months ago        596.7 MB


sudo docker rmi b3da2228dc84
Untagged: openshift/centos-mongodb:latest
Deleted: b3da2228dc846dafe8718fdad94449dd2a133f17e50e445b07f9c13aac579eb0
Deleted: b570ddbe86f1bf14051412cbf710b7f8d57f1b5ecf37f5121563b94dc31b8b75
Deleted: dce232c3029e693ce84d390de54cdaa2536a2b43a1885c4630e12ebd1bff6ed0
Deleted: 612756b4e936116cd24613db2f5e142a7d0b088749f8dab0e512e5636eaa7ca4
Deleted: d82ac5fe3751f0f5cd23decb2c79adb2d5ef34fc02f215df2d3dc47fe99e9931
Deleted: ac66670e7e67e5e553335c376e58d4c794ac716758baa0c6ccd89794280d1a02
Deleted: 78158d78b8677da9da19fd367ae19978c1ef46c2cb1775e23eb43f6ca20cf98c
Deleted: fd76af8d14398b341bad403a7fcb042270f537dd41908fb7384e530f5d2a9c53



sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              latest              c4ff7513909d        3 weeks ago         213 MB


Cross check this wonderful article :


Hope this will help.




How to experiment with LXC on Debian

Okay LXC is hot and getting widely used by different stack in the infrastructure.So I decided to play with it little bit and show you how you can actually do it yourself with minimal fuss.

I am sitting on Debian Wheezy and I will get debian lxc container to run it on top of host os.First thing first…..let get the lxc package from debian repo…

You don’t have to sweat a bit ,because debian package maintainers do all the hard work for you.So,just go ahead and type in console like below:


apt-get install lxc lxcctl


The outcome will lot of packages if not all the dependency already installed in your system.But, nevermind ,as I said early..all will be downloaded if you say “y” on the prompt.

Like I have mine like this :


root@Debian_09:59:55_Sat Feb 22:/usr/share/lxc/templates # apt-get install lxc lxctl
Reading package lists… Done
Building dependency tree
Reading state information… Done
lxc is already the newest version.
lxctl is already the newest version.
The following packages were automatically installed and are no longer required:
anthy-common aumix aumix-common bsh bsh-gcj dasher dasher-data db4.8-util dmz-cursor-theme dvd+rw-tools ekiga emacs espeak etherboot-qemu foomatic-filters-ppds freedesktop-sound-theme
freeglut3 fuse-utils g++-4.4 genisoimage gnome-desktop-data gnome-doc-utils gnome-media-common gnome-office gnome-session-canberra gnome-themes gnome-themes-extras gnome-themes-more
growisofs gstreamer0.10-fluendo-mp3 gtk2-engines-pixbuf gtk2-engines-smooth guile-1.8-libs javascript-common kaboom libanthy0 libart2.0-cil libaudiofile0 libavahi-ui0 libavcodec52
libavdevice52 libavfilter0 libavformat52 libavutil49 libbabl-0.0-0 libboost-date-time1.42.0 libboost-python1.42.0 libboost-python1.49.0 libboost-signals1.42.0 libboost-thread1.42.0
libcamel1.2-14 libcapi20-3 libcdio-cdda0 libcdio-paranoia0 libcdio10 libcdt4 libcelt0-0 libchamplain-0.4-0 libchamplain-gtk-0.4-0 libcheese-gtk18 libclutter-gtk-0.10-0 libcryptui0
libdb4.7-java libdb4.7-java-gcj libdvbpsi6 libebackend1.2-0 libebml0 libedataserver1.2-13 libeggdbus-1-0 libegroupwise1.2-13 libevince2 libexiv2-9 libexo-0.3-0 libfreerdp-plugins-standard
libfreerdp0 libfreerdp1 libgalago3 libgcr0 libgdata-google1.2-1 libgdata1.2-1 libgdata7 libgegl-0.0-0 libgexiv2-0 libgirepository1.0-0 libglade2.0-cil libglademm-2.4-1c2a libgmime-2.4-2
libgmime2.4-cil libgmp3c2 libgnome-bluetooth7 libgnome-desktop-2-17 libgnome-media0 libgnome-menu2 libgnome-vfs2.0-cil libgnome-window-settings1 libgnome2-canvas-perl libgnome2-perl
libgnome2-vfs-perl libgnome2.24-cil libgnomekbd4 libgp11-0 libgraph4 libgraphicsmagick3 libgraphite3 libgs8 libgssdp-1.0-2 libgtkglext1 libgtkhtml-editor-common libgtkhtml3.14-19
libgtkimageview0 libgtksourceview2.0-0 libgtksourceview2.0-common libgucharmap7 libgupnp-1.0-3 libgupnp-igd-1.0-3 libgvc5 libgweather1 libhunspell-1.2-0 libicu44 libimobiledevice1
libiso9660-7 libjpeg62 libjs-jquery libkpathsea5 libkprintutils4 libkutils4 liblapack3gf libmagick++3 libmagickcore3 libmagickcore3-extra libmagickwand3 libmatroska0 libmono-cairo2.0-cil
libmono-corlib2.0-cil libmono-i18n-west2.0-cil libmono-posix2.0-cil libmono-security2.0-cil libmono-sharpzip2.84-cil libmono-system2.0-cil libmozjs17d libmozjs2d libmusicbrainz3-6
libmusicbrainz4c2a libmysqlclient16 libndesk-dbus-glib1.0-cil libndesk-dbus1.0-cil libnet1 libnice0 libnm-glib2 libnm-util1 libntfs10 liboil0.3 liboobs-1-4 libopal3.10.4 libopal3.6.8
libopenspc0 libpathplan4 libpolkit-qt-1-0 libpoppler-glib4 libpoppler5 libpostproc51 libpt2.10.4 libpt2.6.7 libpython2.6 libqt4-webkit libraptor1 librasqal2 librpmio1 libserf-0-0 libslab0a
libsoundtouch1c2 libsrtp0 libstdc++6-4.4-dev libswscale0 libsysfs2 libtcltk-ruby libtcltk-ruby1.8 libtextcat-data-utf8 libthunar-vfs-1-2 libthunar-vfs-1-common libtracker-client-0.8-0
libunique-1.0-0 libvncserver0 libvpx0 libwebkit-1.0-2 libwebkit-1.0-common libwpd8c2a libwpg-0.1-1 libwps-0.1-1 libxcb-atom1 libxcb-aux0 libxcb-event1 libxcb-render-util0 libxdot4
libxfce4menu-0.1-0 libxine1 libxine1-bin libxine1-console libxine1-ffmpeg libxine1-misc-plugins libxine1-plugins libxine1-x liferea liferea-data menu-xdg min12xxw mono-2.0-gac ntfsprogs openvpn-blacklist phonon-backend-xine pnm2ppa postgresql-contrib-8.4 python-axiom python-bugbuddy python-clientform python-coherence python-configobj python-crypto
python-epsilon python-gdata python-gmenu python-gnomedesktop python-gtkglext1 python-gtksourceview2 python-lazr.restfulclient python-lazr.uri python-louie python-mechanize python-nevow
python-oauth python-opengl python-openssl python-pam python-pyasn1 python-pysqlite2 python-rdflib python-rsvg python-serial python-simplejson python-tagpy python-twisted-bin
python-twisted-conch python-twisted-core python-twisted-web python-wadllib python-webkit python-zope.interface remmina remmina-common remmina-plugin-rdp remmina-plugin-vnc ruby-elisp
ruby1.8-elisp rubygems1.8 software-center tcptraceroute ttf-lyx ttf-opensymbol ttf-sil-gentium update-manager-core update-manager-gnome update-notifier update-notifier-common xli xsltproc
xulrunner-1.9.1 xulrunner-10.0 xulrunner-17.0
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

See,I have already got those packages …nothing to be done in my case.But if you don’t have you will be prompted for install ,probably along with the dependency.

Now,lets check what it bring down with those package ,we are going to use! fist thing you need to run this to know how lxc inflated in your host system:


root@Debian_12:02:13_Sat Feb 22:~ # lxc-checkconfig
Kernel config /proc/config.gz not found, looking in other places…
Found kernel config file /boot/config-3.2.0-4-686-pae
— Namespaces —
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

— Control groups —
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

— Misc —
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig


I added a line like this on my host debian /etc/fstab

cgroup  /sys/fs/cgroup  cgroup  defaults  0   0


O BTW when you install lxc ,it will ask you where to store your container,the default path /var/lib/lxc, but I decided to installed it on one of my lvm partition ,nothing just because of more space and out of root file system.It all depends on you where you want to put up those…mine is here

/lvm/lxc/ .


root@Debian_10:02:56_Sat Feb 22:~ # whereis lxc
lxc: /usr/bin/lxc /etc/lxc /usr/bin/X11/lxc /usr/share/lxc /usr/share/man/man1/lxc.1.gz /usr/share/man/man7/lxc.7.gz
root@Debian_10:03:00_Sat Feb 22:~ # cd /usr/share/lxc
root@Debian_10:03:18_Sat Feb 22:/usr/share/lxc # ls
cache  packages  templates
root@Debian_10:03:19_Sat Feb 22:/usr/share/lxc # cd templates/
root@Debian_10:03:21_Sat Feb 22:/usr/share/lxc/templates # ls
lxc-altlinux  lxc-archlinux  lxc-debconf  lxc-debconf.d  lxc-debian  lxc-fedora  lxc-opensuse  lxc-progress  lxc-progress.d  lxc-sshd  lxc-ubuntu-cloud

The bold section in the above is the predefined lxc template come along with the package you download .In this example I will deal with lxc-debian

How to create lxc template with userspace tools:


root@Debian_11:43:47_Sat Feb 22:~ # lxc-create -n debian-lxc -t debian
Note: Usually the template option is called with a configuration
file option too, mostly to configure the network.
For more information look at lxc.conf (5)

debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/debian/rootfs-wheezy-i386 …
Copying rootfs to /var/lib/lxc/debian-lxc/rootfs…
Copying rootfs to /var/lib/lxc/debian-lxc/rootfs…Generating locales (this might take a while)…
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
*** update-locale: Error: invalid locale settings:  LANG=en_IN
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
update-rc.d: using dependency based boot sequencing
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
update-rc.d: using dependency based boot sequencing
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
update-rc.d: using dependency based boot sequencing
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
update-rc.d: using dependency based boot sequencing
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = “en_IN:en”,
        LC_ALL = (unset),
        LANG = “en_IN”
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Current default time zone: ‘Asia/Kolkata’
Local time is now:      Sat Feb 22 11:44:48 IST 2014.
Universal Time is now:  Sat Feb 22 06:14:48 UTC 2014.

Root password is ‘root’, please change !
‘debian’ template installed
‘debian-lxc’ created

Whoa! so it was not at first time! because I have done it in the past on this same machine ,so the packages are cached so it get from there.I just destroy my previous container of debian and recreate it for the sake of showing you.But if it hand’t been done before it will simply pull all the required package and verify then show the last section of the above code!!

Now,time to get into the console and change the root passwd first.But,please take a note that when you get into the lxc console always use screen or some other tool to get in.Because CTRL-c ,CTRL-d doesn’t work properly.So , the console can hung and you can no way terminate it normally.

So here is the procedure to get into the lxc debian(in this case) console,but before that you need to start the container like below:


root@Debian_11:52:01_Sat Feb 22:~ # lxc-start -n debian-lxc -d

Make sure you use “d” or daemonize option to send it to background…not doing so has other effect ..which I will point out with a pointer in the below resource section.

Verify you container is up


root@Debian_11:52:55_Sat Feb 22:~ # lxc-list



Okay, lets get into the container 🙂


root@Debian_11:53:55_Sat Feb 22:~ #lxc-console -n debian-lxc

Here is pic how it look like :




Hope this will help.




PS: I am having trouble to get fedora and opensuse container going on Debian …hopefully it will resolve soon and I will post the content here.

RVM- Ruby Version Manager

Exploring RVM

I am trying get a feel for it …following the documentation …probabaly upate later.I was basically doing everything by gem..lack of awareness..heck…

This was provided by my colleague Brian ..thanks mate…