Cloning a Virtual Machine in VirtualBox

Update: As of version 4.1.0 and above, VirtualBox GUI has support for cloning a virtual machine. The following method still applies to older versions, however, you are encouraged to upgrade to the latest version for best experience.

VirtualBox has emerged as a viable free alternative to the popular vmware virtualization platform. While it contains less features than vmware, it still is very good at running virtual machines at fast speed without much problem, allowing you to test your software and perform lots of other useful experiments inside virtual machines without affecting your main system.

VMWare has a very nice feature that allows you to ‘clone’ a virtual machine easily from its main interface. It takes a few minutes depending on the size of harddisk, and gives you a copy of the machine at the end of the process. VirutalBox, while being pretty neat at doing other stuff, has no such option in its GUI. Here’s how you can clone a machine for VirtualBox with the minimal effort.

The cloning process involves these steps:

  1. Open a command prompt on your system.
  2. Navigate to the folder where the harddisk of the source vm resides
  3. Clone the virtual disk file into a new one
  4. Create a new machine with the new hard disk and same specs as the source machine

Open a command prompt and use the following commands to complete the second and third step.

cd E:\VM\VBOX\

set path=%path%;C:\Program files\Oracle\VirtualBox

vboxmanage clonehd MYXP.vdi MYXP_2.vdi

In the above, replace E:\VM\VBOX\ with the path where your virtual machines are stored. This can be found by going to VirtualBox preferences. The second line contains the installation path for VirtualBox (the one presented here is the default for VirtualBox 4.xx installation)

vboxmanage is the actual goodie that comes with VirtualBox and can be used for lots of neat stuff once you get hold of it. The last command creates a copy of the harddisk file as another virtual harddisk. This is MUST, because simply copying the hard disk file from explorer will not allow you to use that file as a valid hard disk.

Once you run the last command, it will show some progress and once complete, you will have a copy of the old hard disk file as a new one by the name MYXP_2.vdi

There is only one thing left to do now. Open Virtual box GUI and create a new virtual machine with the same specs as the one you created for the first machine (I am sorry, but at the moment this is the fastest and neatest way to do this step)
Select the hard disk you created by cloning earlier above and you will have a new machine with the same configuration and hard disk state as the previous one.

How to clear Facebook Share’s Cache

Facebook share is good, simple, lets us share almost everything on web in seconds. But Facebook caches already shared urls/pages for better performance. This causes issues at time when we update the title, picture being shared or the description of the page because Facebook still shows the older version of the page.

For modifying which image, title and description FB chooses, read this

I will discuss three simple ways to force facebook to go and fetch the latest stuff from the page being shared.

Method 1 :

Facebook treats each url as unique and caches the page based on that url, so if you want to share the latest url the simplest solution is to add a query string with the url being shared. In simple words just add ?v=1 at the end of the url. Any number can be used in place of 1,

This method is fairly simple but it doesn’t retain the share count for this page, as it treats this page as a different url hence the count for this url will be restarted from 0. Plus if someone else shares the original url without the querystring the information will still be the old one.

Method 2:

Using url shortner services like shorten your url form and then use the new url for Facebook share. This too is a simple and quite popular method but has the same issues as the first one.

Method 3:

Facebook has a tool called Debugger (formerly known as URL Linter). This tool gives us an idea about how a url will be shared on Facebook, what content, which image will be fetched. Further details about this tool can be found here.

We can use this tool for any url and it fetches the latest title, description, excerpt and other stuff that will be shown while sharing the link. If you use an already shared URL with this tool then Facebook fetches the latest content, and also updates it cache with the latest content.

With this methos the url remains the same hence the share count will persist and the content will be updated. Someone else sharing the url will also see the latest content now. So this method is of course the best.

The Debugger tool can be accessed here.

Found this post helpful? Want to return the favor? Use the button below :)

How to clear your DNS Cache in Windows

Windows usually caches the DNS records for faster resolution of web pages, at some point one needs to refresh that cache, this is how you do it,

Open the Command Line Interface of Windows, (Run -> type cmd)

and run the following command

ipconfig /flushdns