.:: CODE SNIPPET ::.

"Your time is limited, so don't waste it living someone else's life"

How to face with cannot load hard drive error of VirtualBox


Oracle Virtual Box is a very famous visualizer application with user and programmer in particular. As you know, one virtual machine has its own at least one virtual hard disk named with extension VDI located wherever on your real hard disk, supposed /home/thminh/tools/VirtualMachines as my case. One day, you start Virtual Box application as usual, you are taken notice with a pop-up like

VirtualBox warning


Then you can over read and press Ignore button to continue starting the machine. In most cases, you will receive the error message:

hard disk can not be loaded


You might get anxious about this and can not remember what happen to your virtual machine. Now, we jump to the resolution for this problem.
It costs about five minutes to figure out the root cause is virtual hard disk file is not mapped correctly in the Virtual Box application. This maybe your current file is moving to somewhere else, or be deleted out of your real disk.
Firstly, you come to directory where your virtual HD originally located. You can recognize that the file is not there any more. Now, remember what you have done for your VDI file or related directories. You could move any its parent folder into or out of another one, rename the folder or even delete the directories. Check them out and find the file. Since you can locate where your file is, copy the absolute path to your virtual hard disk to clipboard (now is /home/thminh/working/tools/VirtualMachines). Then, do the following editing(assume the virtual machine named “VMWindow7” ).
Secondly, in the Virtual Box Manager window, go to File > Preferences…, in the General category, you can see the Default Machine Folder directory. Open it in your file manager, then open the folder corresponding to your virtual machine (VMWindow7). Edit the configuration file (VMWindow7.vbox) with any text editor.

** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
  <Machine uuid="{...}" name="VMWindow7" OSType="Windows7_64" snapshotFolder="Snapshots" lastStateChange="2014-10-06T02:28:46Z">
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{...}" location="/home/thminh/tools/VirtualMachines/VMWindow7.vdi" format="VDI" type="Normal"/>
      </HardDisks>

The tag <HardDisk uuid=… dictates the full path to your virtual machine which is not correct right now. Fix this path with your new absolute path in clipboard (/home/thminh/working/tools/VirtualMachines) as following snippet:

** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
  <Machine uuid="{...}" name="VMWindow7" OSType="Windows7_64" snapshotFolder="Snapshots" lastStateChange="2014-10-06T02:28:46Z">
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{...}" location="/home/thminh/working/tools/VirtualMachines/VMWindow7.vdi" format="VDI" type="Normal"/>
      </HardDisks>

Final step is save this file and start your machine again.

In case you indicate that the hard disk file is permanently deleted, you explicitly create or import a new machine. hihi.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: