How to increase the size of your VirtualBox HDD WITHOUT losing any Data

Has it ever happened that you are working on a dev Virtual Machine and suddenly you realised that you have run out of hard disk space ? And then, you had to do the tedious job of manually transferring all your changes, repos, config files, etc. to a new VM ? Well, in this post, I am going to tell you how to increase the size of your Virtual HDD, whether the HDD is in the native VDI format or a different format like VMDK, without losing ANY data and continue your work.

Virtualbox Logo

The steps mentioned in this post are for *NIX OSes like Linux and Mac OS. I have personally performed this on the Mac OS X 10.9 (Mavericks), but the exact same steps are applicable for Linux. I guess, there should not be any different for Windows either.

A quick background : The reason I wanted to increase my Virtual HDD size is because I ran out of space trying to download the Android source code. That’s right, I am trying to build Android from scratch and after downloading 17GB  of source code from the Cyanogenmod github repos, over a period of 5 days, I suddenly ran out of disk space. The Android story is for another day, another post.

As mentioned earlier, I have performed this on a Mac OS X Host machine with Ubuntu 12.04.3 (32-bit) as my Guest OS. The VM had a mere 20GB HDD and that too I had configured as a VMDK disk as opposed to the native VDI (Don’t ask!!)

So, without further ado, here’s how the magic happens :

Step 1a) : Backup your disk

Can’t stress this enough. Always, …. Always backup your disk. If I had to download 17GBs again, I would have to kill someone first to justify the action.

Now, you can’t just “cp” your virtual HDD file and hope it will work with your VM. There’s a whole lot of UUID issues with VirtualBox. To cut a long story short, don’t “cp”. Execute the following command instead :

$ VBoxManage clonehd <path to>old_ubuntu_hdd.vdi <path_to>backup_ubuntu_hdd.vdi

With this, VirtualBox assigns a different UUID to the backed up vdi and you can use this HDD as if it were your old one.

Now, if I were you, I would do just that. To be on the safe side, Release your current HDD from the Virtual Media Manager GUI tool.

VirtualBox Media Manager

 

Then go to your VM’s settings and add the newly backed-up VDI as the HDD for your VM. Then boot into it and verify that everything looks good.

Ok, We’re done backing-up. Unless, you are like me and had configured your virtual HDD in Vmware’s VMDK format.In that case, you need to execute Step 1b) below rather than Step 1a) above.

Step 1b) Convert your disk to VDI and backup your disk

Actually, it’s exactly like Step 1a) above ,except that you have an additional parameter to VBoxManage. Execute the following command :

$ VBoxManage clonehd <path to>old_ubuntu_hdd.vmdk <path_to>ubuntu_hdd.vdi --format VDI

Again, as above and especially after the conversion, make sure that you bootup the backed-up HDD and ensure that you can everything is working.

With our HDD safely backed up, lets tread on to more dangerous waters !!

Step 2) Increase the size of your Virtual HDD

This step is actually the easiest step. Just execute the following command :

$ VBoxManage modifyhd <path_to>Ubuntu_Hdd.vdi --resize <size in MB>

For example, in my case , I wanted to increase the size to 100GB, so the command was something like this :

$ VBoxManage modifyhd ./AndroidDev.vdi --resize 102400

That’s it !! We are done increasing the HDD. You can check this my opening the VirtualBox GUI tool , selecting your VM, clicking on Settings, then Storage and checking-out the value of the “Virtual Size:”

In my case it shows 100GB.

Forward march !!!

Step 3) Increase the size of the Linux Guest OS partition

With the above step, if you try to boot, you might either get an error, or see the same disk size from the Guest OS. What we need to do is resize the filesystem of the GuestOS to match the size of the partition or HDD we just increased.

For this, you need another Live Linux CD/DVD/iso like Ubuntu or GParted. Actually, we are going to use the gparted utility to do the resizing. So, as long as you have any OS which has this tool, it’s ok.

Now, add the Live Linux CD/DVD/iso to your VM and boot into.

Fire up Gparted session and resize your filesystem

GParted

That’s it !! That’s truly, finally it !!!

You have successfully resized your virtual hard disk keeping intact all your data.

I, have successfully resumed downloading the Android source.

Virtualisation | No Comments

What are the SDN simulators currently available?

Like Stanford's Mininet.

View Question on Quora

Uncategorized | No Comments

Flashing the Android Revolution HD ROM on HTC One X (Endeavoru)

As I promised myself earlier, I’m back to flashing ROMs on Android devices.

And as the saying goes “Charity begins at Home”, I have decided to flash my HTC One X with the HTC Stock ROM-based Android Revolution HD ROM.

I have read some excellent things about this ROM on the XDA-Developer forums and the fact that I still get to have my beloved HTC SenseUI 5.0 makes it any easy choice for me.

Here are the links to some of the files that need to be downloaded.

Steps Zero to Three are to be performed once only. Then, going ahead, you just need to install the different ROMs, so Step Four is good enough.

Step Zero : Backup

Always, Always … Always , Backup !!! I can’t stress this enough. Well, unless, you don’t care if you loose all the data on your phone. But even then, maybe you will Flash one ROM today use it and after some time want a new ROM. And then you might have some data that you DO care about. So, please, do yourself a favour and BACKUP !!

Choose your own poison, but I would recommend SuperBackup and Titanium Backup (You won’t be able to use Titanium Backup until you Root your device).

First : Unlocking the Bootloader

First things first! Let’s void my warranty (Psst !!! I have already done it a year ago)

But here’s another thing I love about HTC. They allow you to officially unlock the bootloader. Just register yourself with HTCDev.com and they guide you through a step-by-step process of unlocking your bootloader. A certain Mr. Ashish Mundhra has an excellent screenshots based guide of the unlocking process here.

Just one heads up here for HTC One X owners. The “Supported Devices” drop-down on the “Unlocking bootloader” page does not list the HTC One X. In this case, just select “All Other Supported Models”

Second : Installing a modified Recovery image

Since I want to eventually multi-boot my device, I was giving a thought to installing the TWRP recovery rather than the Clockworkmod Recovery, but for some reason, which I can’t remember, I gave up on the idea and decided to go ahead with the Clockworkmod Recovery itself.

I have downloaded the recovery-clockwork-touch-5.8.4.0-endeavoru.img and the Fastboot binary for my Mac, i.e., fastboot-mac from the above links.

The installation procedure is pretty standard :

1) Copy the recovery image to the top folder of your Internal Storage. Actually, you can copy it anywhere on the Internal Storage. It’s just that the deeper inside folders you copy, the more cumbersome it will be to select the image later from Recovery mode.

2) Reboot phone into “Fastboot mode” by first switching it off, then holding the Volume-Down button and then the Power button.

Heads Up : If you see a USB error message, ignore it. It comes only if you try to go to Flash or Recovery mode without unplugging the USB cable.

3) Choose Fastboot from the Menu

4) Connect USB cable, if you have not already done it.

5) From a Terminal window on your Mac :

./fastboot-mac flash recovery recovery-clockwork-touch-5.8.4.0-endeavoru.img
./fastboot-mac erase cache

6) Done. You have installed a modified Recovery image. Do your happy dance !!!

 Third : Rooting

1) Copy the SuperSU zip to the top folder of your Internal storage.

2) Reboot to Fastboot, only this time select “Recovery” instead of  “Fastboot”. You will see the HTC logo briefly and then presented with the ClockworkMod Recovery menu.

Remember, you navigate with the Volume-Up and Volume-Down buttons and select/choose with the Power button.

3) Select “Install from zip”

4) The Select “Choose zip from SD Card”

5) Browse to your SuperSU.zip file

6) Select it and install it.

7) Done. Keep “Go Back”ing till you see “Reboot”.

8) Ensure you have successfully Rooted by opening Titanium backup App. Previously it would have given an error that “your device does not support root”. Now it will open without the error.

9) Done. Do the Happy dance again.

Fourth : Flashing the Android Revolution HD ROM

Things don’t get easier than this.

1) Copy the Android Revolution HD ROM zip file to the top folder of your Internal storage

2) Reboot into Recover mode

3) Select “Install from zip”

4) Select “Choose zip from SD card”

5) Browse to the location of your ROM zip file

6) Select the ROM and proceed to install it.

7) Reboot

8) Done. Do a very vigorous version of the Happy Dance !!!

Fifth : The AROMA installer

I gotta admit. The AROMA installer’s lack of touchscreen support did make all 3 minutes of my life miserable.

But after I figured out the sequence of Volume Up/Down buttons to navigate, it was fairly straightforward.

 

But other than that everything works !! I know, I’m using it.

Well.. The Sense 5 Toolbox did not work. I was getting an error about not installing the “Xposed Framework” properly.

So, here is the link that will help you to resolve the Sense 5 Toolbox issue :

http://htc-one.wonderhowto.com/how-to/install-xposed-framework-your-htc-one-easily-mod-your-phone-0148580/

 

That’s it then !! Enjoy the Android Revolution HD experience. And remember to restore your backups from Titanium or SuperBackup.

Extra Resources  :

Android Revolution HD , XDA developer link

Sense 5 toolbox

 

 

 

Android | No Comments

Flashing my Android devices

It’s been quite some time since I played around with my phone’s internals.

I remember trying out different ROMs and tweaks when I first bought it , a year and a half ago. But for some reason, which I can’t remember, I went back and flashed the stock images and even went so far ahead as to un-Root and Lock the bootloader.

Well, I’m back to tinkering with the phone again.

And this time, I even have my Nexus 7 to screw around with. The only problem is, my 2 and a half year old son uses it too. He needs it for his daily fix of Hulk and Play-doh videos and his Dinosaur Apps. I know, …. Don’t ask !!!

Well, nonetheless, I’ll figure out some way to flash the tablet later. For now, I’m going to start playing around with my HTC One X (International edition, codenamed : Endeavoru)

Here are some of my goals in flashing different ROMs :

  • Get used to basic device Rooting procedure
  • Get familiarized with procedure to Flash different ROMs
  • Try out different Recovery Mods : Clockword as well as TWRP
  • Install Android Revolution HD ROM , since it’s very much like the stock HTC ROM, which I am quite fond of.
  • Install Cyanogenmod ROMs
  • (Ultimate Goal 1) Build a Cyanogenmod ROM , first using a Kitchen, then man-up and compile it by hand
  • (Ultimate Goal 2)Multiboot ROM
  • (Ultimate Goal 3) Dual boot with Ubuntu

 

The first in this series is going to be creating custom ROM using some Kitchen, followed by Flashing the Android Revolution HD.

Stay tuned !!

Android | No Comments

Ubuntu For Android

This is like a dream gadget for me.

Android phone with an Ubuntu Add-on that also has a TV interface ? Are you kidding me ?

The beauty of this is that not 0nly can you see you media content on a big screen TV or LCS screen, but you can also run the Android applications in an Ubuntu environment.

For example, you can use the Wifi radio of your phone to detect Wifi networks and connect to them using the familiar Ubuntu Network Manager.

Or get notified of an SMS on Ubuntu’s desktop notification service.

Enough said, check out the video

I have two questions that were unanswered in the video above :

  • Will this work on any smart Android phone ?
  • How much does the dock cost ?

I just can’t wait to get my hands on this.

Open Source | No Comments

Unboxing My Samsung Galaxy Tab

I finally got my Samsung Galaxy Tab today !!!
F@#$ You Bluedart for making me wait two days in anxiety and then making me come to your shit-hole warehouse.

Kudos to Flipkart for shipping my order on the same day.

And now, without further delay, here are the Samsung Galaxy Tab’s Unboxing photos :










Gadgets | No Comments

Blackberry Playbook demo at CES 2011

I’ve known about the Blackberry Tablet, Playbook, for a long time now.

Don’t know why I never blogged about it, especially considering the fact that it’s the only non-Android, non-iOS , tablet out there.

What reminded me was this video of the Playbook demo at  CES 2011.

The display looks great, the form-factor seems about the right size and it has compatibility with the Blackberry Enterprise Server.

That should be a big deal for existing Blackberry users.

Some of the other features of this tablet are :

  • Multitouch Capacitive touch screen
  • 1 GHz TI OMAP 4430-based ARM Cortex A9 dual-core processor
  • 1 GB RAM
  • QNX-based Blackberry Tablet OS
  • Adobe Flash 10.1
  • Support for HTML5
  • 3G as well as 4G network access
  • 802.11 a/b/g/n
  • 5 MP rear-facing and 3MP front-facing camera
  • 1080p Full HD video output
  • Seamless pairing with your Blackberry smartphone
  • Compatibility with Blackberry Enterprise Server

Here’s another demo by the BGR guys, which shows of the capabilities of the device in more detail.

Gadgets | No Comments

Booting Linux in under one second using swiftBoot

One of my former colleagues and friend, Pranav Peshwe, pointed me out to this company called MPC Data who has developed a solution called swiftBoot.

Using swiftBoot, these people have managed to boot into a fully running Linux OS in under one second.

Take a look at this unbelievable video to check it out for yourself.

The developers claim that there is no other gimmick involved other than optimizations done, as a result of a good understanding of the Linux system.

The demos show that not only does the system soft-boot in within a second but it also function normally after that.

There is a second demo of the same on a TI OMAP3530 based OMAP3530EVM board. This time, they use a stop-watch for monitoring the performance.

I know if makes business sense to use this to provide a service to OEMs and ISVs, but imagine what havoc it would create if they open source their findings and it gets merged into the mainline kernel.

Software | No Comments

Nexus S boots Meego and Ubuntu

Most of you are aware of Google’s Android-based Nexus S smart phone. With sleek looks and feature-packed to the core, it is arguably, the best and one of the most expensive smart phones in the market.

However, having said that, it is really appreciable that it can still be hacked to run other Operating Systems.

Meego, is a Linux based framework for mobile handsets and internet tablets, headed by Intel and Nokia. It is currently still in the development phase, but you can be sure that there will be a lot of devices running Meego in the coming years.

Meego is one of the OSes ported on the Nexus S. This is a huge step for Meego developers as it gives them a validation of their framework on a mainstream device like the Nexus S. The image shown below shows a raw, un-formatted version of Meego dumped on the Nexus S.

Meego running on the Nexus S

Ubuntu , is arguably, the most popular Linux distribution today. Ubuntu’s decision of embracing Unity, a desktop environment designed with a view of running it on Internet tablet devices, certainly seems to have paid off. What you are seeing in the image below is a Nexus S running Ubuntu’s Unity desktop.

Ubuntu's Unity desktop running on the Nexus S

One thing to remember is that these “ports” or hacks are still very developmental in nature. Hope this encourages the developers to port these other open source frameworks on other Android devices as well.

Open Source | No Comments

The Motorola Xoom Tablet with Android 3.0 Honeycomb

CES 2011 is long over and it was raining Tablets this year.

However, there were a couple of tablets which stood out from the rest (that is not to say that the others weren’t good enough).

One of them and by far the most popular amongst all the Tablet demos was Motorola’s Xoom Tablet with. The Motorola Xoom was crowned the best tablet at CES 2011.

Motorola's Xoom Tablet with Android 3.0 Honeycomb
Some of the awesome hardware specs of the Xoom are :

  • 10 inch LCD touch screen with 1280×800 resolution
  • Nvidia Tegra 2, 1GHZ dual-core processor : This is a first in tablet history
  • Support for 3G, LTE and 802.11n Wifi
  • 720p capture and 1080p playback
  • 5 MP rear-facing and 2 MP front-facing camera

To complement this, it will host the Android 3.0 Honeycomb OS which is specifically designed for tablets with features like :

  • Google Maps 5.0 with 3D view
  • Flash 10.1
  • New browser with tabbed-browsing
  • New look and feel for applications like YouTube
  • Scrollable Widgets on the home screens

So without further ado, here’s the  video of the Motorola Xoom with the Android 3.0 ( Honeycomb ) OS :

Gadgets | No Comments