Saturday, December 31, 2011

Problem installing Oracle Virtual box extension pack

If you would like to use the USB ports on your virtual machine in virtual box.
You need to install the virtual box extension pack available from the download section at

However opening the downloaded extension pack from virtualbox and clicking the install button, sometimes gives the following error

"Failed to install the Extension Pack Oracle_VM_VirtualBox_Extension_Pack-.vbox-extpack.  The installer failed with exit code 127: The value for the SHELL variable was not found the /etc/shells file    This incident has been reported..  Result Code: NS_ERROR_FAILURE (0x80004005) Component: ExtPackManager Interface: IExtPackManager "

I find that installing the extension pack using the command line fixes this problem.
simply cd into the folder were the extension pack you downloaded resides,
and type the following. replacing the xxxx with the version of the extension pack you downloaded.

 sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-4.1.xxxx.vbox-extpack 

and it will install properly, you should get the following back.

Successfully installed "Oracle VM VirtualBox Extension Pack".

Wednesday, December 7, 2011

Free up space on your hard drive.

ext2/ext3 and ext4, file systems automatically reserve space for themselves. (5% by default)
This is necessary for your root partition, so that  if you fill up the hard drive, Linux will still have space to write to the log files and to allow privileged processes to run so that they can avoid file system fragmentation.
However, if your hard disk is say a 650GB or bigger hard drive, that 5% amounts to a significant amount of disk space, and is a total overkill.
Additionally, you do not need this reserved space on hard drives that are only used for storage (ie are not part of your root partition)
so, how do we take back this valuable hard disk real estate ?
We use tune2fs.

so as an example,  type

tune2fs -m 1 /dev/sda2
to change the 5% to 1% on /dev/sda2

if /dev/sda was a 650GB hard drive this would give you an additional 26 GB Free!

tune2fs -m 0 /dev/sda2
will  reduce the 5% to 0%

to add reserved space for privileged processes back to a  drive
tune2fs -r 20000 /dev/sda2
will give back 20000 blocks, which should be more than sufficient

you can run tune2fs on  Logical volumes as well.

tune2fs -m 1 /dev/mapper/vg-lv_home 
will reclaim space from your logical volume

Just change /dev/mapper/vg/-lv_home to the name of your logical volume.
you can see all your volumes and partitions by typing df -h

Thursday, December 1, 2011

Simple Webserver

python -m SimpleHTTPServer

Will serve your current Directory tree at