About using guests from an external HDD: Things to consider

This is for discussing general topics about how to use VirtualBox.
Post Reply
ercoskunk
Posts: 1
Joined: 20. Nov 2011, 23:18
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP(x86), Windows 7(x64), Linux(Mandriva, Debian, CentOS), Oracle Solaris

About using guests from an external HDD: Things to consider

Post by ercoskunk »

I have comments and a case scenario to improve Virtualbox manager application:

Suppose you are a power user and need seperate VMs for Multimedia applications, CAD applications, Office applications for daily work etc. Such configuration is useful to consolidate the load over Windows registry and make it easier to migrate from one computer to another. Besides I am a web developer and have a Windows based VM for .NET & AJAX as well as a Linux host running CentOS for PHP development. I also have a few more Linux hosts and a MacOS X lion machine (still trying to install) for cross platform check of my applications as well as to learn and evaluate such distributions.

I have a SSD so limited space to run all guests from local partitions...

Since the USB3.0 HDDs entered to the market, running VMs from an external drive is a workaround if you have limited space on your local storage. USB 3.0 promises adequate performance for disk IO.

Most important and severe risks and issues for such configuration are:
  • 1 - An accidental removal of the external HDD is very likely to happen during daily operation (bugs in HDD firmware - a soft reset, accidental fall or cable failure).
    2 - If I put the laptop into sleep while guests were running. Then remove the HDD and attach it again "before" waking up the computer, everything runs smoothly... Though it is always more reliable to pause guests before sleep.
    3 - If I forget to plug in HDD before waking up the computer. The Virtualbox manager crashes and kills all the running guests. It is possible to start guests from scratch. Guest OS assumes there was a power loss. Though it is very likely that some of your work and data is lost inside the machines.
If somehow external HDD is removed while guest OSes were active, one of the three happen:
  • Best case: The Virtualbox manager crashes and kills all the running guests. It is possible to start guests from scratch. Guest OS assumes there was a power loss. Though it is very likely that some of your work and data is lost inside the machines.
  • Bad case: The Guest VM file gets corrupt. Guest VM is lost. Possible to recover if you have a backup of the virtual machine disk file.
  • Worse case: The HDD gets corrupt. All guest OSes lost. Possible to recover VMs with chkdsk or third party software. But it is very likely that one or more Guest VMs get corrupt - lost.
  • Worst case: A disaster (very unlikely tough). You have no back-up. Partition table is damaged. Unable to recover "all" data, the VM files were fragmented and all lost.
My measures for data safety:
  • Each VM stores working files in a shared folder of the actual HDD (so no data related with my works remain in guest OSes)
  • All downloads are also stored in a shared folder of the actual HDD as well as specific settings and configurations. In case programs do not allow such configuration, I bypass such issue with junctions (in Windows OS).
  • All data and VM disk files have at least three backups.
    • a - Data files are backed up daily (A third party program is necessary for syncronised and incrimental backups). Two versions exist: Version automatically backed up with a scheduled third party backup software; and a manual direct copy AS-IS backup for updated and active files.
      b - VM files are backed up once a month or every six month depending on configuration, software installations and upgrades.
Request/Suggestion: Taking backups are the smart way for data and VM safety. Though adding a functionality to Virtualbox manager to make it aware for external storages would be really smart and convenient as well. It is enough to start with "searching for original VM disk file location" before resuming guests from a pause state and prevent resume; warn the user with a request to restore VM disk file location, thus preventing a crash. I am pretty sure that It wouldn't be so hard to make Virtualbox an external storage aware hypervisor. I unfortunaly don't know C++ so cannot write such code for the moment; I will try though...

I would like to express my thanks in advance to every developer who would develop a workaround for such incidence...

With my sincere regards,
Post Reply