Stay Safe! Clone that VirtualBox VDI before using it

VirtualBox is an open-source software allowing you to “virtually” run different operating systems within one computer.  For example, if you are running on Windows 7 operating system (considered to be the “host OS”), you can use VirtualBox to install any variety of operating systems (OS) to try them out (considered to be the “guest” OS)

In this article, I will tell you how to install and use a Windows 7 as a guest OS, to be used as a “browser appliance” (browser appliance simply means that you can discard it after certain number of uses to minimize the risk of trojan or virus infections and start anew).

  1. Although it only takes 20 min or so to create a brand new virtual machine, there is an easier and faster way: virtual disk cloning.  This is how you do it:
  2. Create a new virtual machine following the on-screen instructions provided by VirtualBox.  Name the virtual harddisk as “win7pro” (it will have a file extension of .vdi or “win7pro.vdi”).
  3. Install the guest OS & add any extra software you want to use (I installed FireFox and Comodo Internet Security (both are free; you CANNOT install Kaspersky Internet Security as KIS is NOT compatible with VirtualBox)
  4. Close down all guest operating systems, including the VirtualBox Manager window.
  5. Use windows explorer (a.k.a. file manager) to locate your virtual disk (c:\users\kj\VirtualBox VMS\win7pro.vdi”)
  6. Copy and paste the virtual harddisk to the same directory
  7. Rename the duplicated virtual harddisk as “win7pro-copy.vdi”)
  8. Open CMD application (a.k.a. DOS window).  You can open it by clicking on the Windows icon, then type in “cmd” without quotes in the bottom search box.
  9. Find a path where the Oracle VirtualBox is located and type in the following command:

    VBoxManage internalcommands sethduuid “D:\My Virtual Machines\win7pro-copy.vdi”. This step assigned a different UUID so that the duplicated disk can work on its own.  Please note that “setvdiuuid” command IS NO LONGER SUPPORTED.

    Oracle Virtual

    Oracle VirtualBox - CMD commands to assign new UUID

  10. Now all we have to do is create a new profile in the VirtualBox Manager
  11. Launch the VirtualBox Manager.  Click on “NEW” and follow the on-screen instructions.
  12. When you get to the “VIRTUAL HARD DISK” section, check the radio button that says “Use Existing Hard Disk”.  Then using the yellow folder icon on the right, navigate to where the new, cloned VirtualBox hard disk is located.

    Oracle VirtualBox Manager - Cloning

  13. Voila!  Now you have successfully cloned your virtual harddisk.
  14. If your guest OS virtual machine is running slow, or if you suspect that have been infected, simply delete the profile and all related files from the VirtualBox manager and start over, using your “master” copy.
  15. It might be a good idea to launch your master guest OS copy once a week to download any security patches.

You can certainly use VMPlayer (free version from VMware) which is very similar to VirtualBox.  I found that VMplayer is somewhat footprint heavy, which makes your Host and guest OS’s to operate more slowly.

If you have any questions or comments, send me an email!


Leave a Reply