Page 1 of 1

Virtual machine won't boot..

Posted: 19. Oct 2009, 04:42
by hikerguy
After having played around with my .vdi files (and putting them back like they were), I initially could boot my
WinXP virtual machine, but the couple of times it loaded, it would crash while I was viewing a PDF file (something
about an explorer error).

Now, each time I start the VM, it looks like it's going to load, and even displays the WinXP splash screen, but then
goes away (and goes right back to the main VBox screen where you launch your VMs). Any ideas what's going on?

Like I said above, I did muck around with my .vdi files and hosed things up pretty good, but I copied my .vdi files
back to their original location and was able to run the VM a couple of times before this latest problem. I'm using the
same primary .vdi file I've been using for several months now.

The following is the Vbox.log file. Maybe that will help isolate the problem.
WindowsXP-2009-10-18-22-37-53.log
VirtualBox log file
(67.09 KiB) Downloaded 196 times
Thanks,

Andy[

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 05:25
by Perryg
Andy,

This is what the logfile shows.

Code: Select all

00:00:15.931 PIIX3 ATA: LUN#0: disk read error (rc=VERR_EOF iSector=0x7b98cf cSectors=0x80)
00:00:15.931 PIIX3 ATA: LUN#0: disk read error (rc=VERR_EOF iSector=0x7b9af7 cSectors=0x10)
00:00:15.932 PIIX3 ATA: LUN#0: disk read error (rc=VERR_EOF iSector=0x7b9e1f cSectors=0x8)
It is all over the place and more than likely the file is corrupt. The worst case scenario your hard drive could be starting to have problems.
I would Install a new clean copy and see if it works. If so then it is probably just a corrupt VDI.

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 15:42
by hikerguy
Well, I poked around some more and someone suggested using the VBoxManage clonehd command. I did that, and it did
allow me to boot with no problem (NOTE: when you do this, the cloned image is placed in ~/.VirtualBox/HardDisks/ directory).

However, now when I run VirtualBox and go into Settings, then Hard Disks), I don't see any snapshots there. I verified that the path for snapshots is correct (and the snapshots exist). I tried using my old .vdi file (that was causing the WinXP VM to not boot), and now it is working. BUT, here again, the snapshots don't show up under the Hard Disks section (when modifying the Settings of VirtualBox).

Is there a way to "re-attached" / "re-associate" a snapshot with the working .vdi file (the one you set up in Settings | Hard Disks)?
If I can't get the .vdi and snapshots re-linked, I'm going to have to do a lot of software re-installing (e.g. Adobe Acrobat, OpenOffice, ZOC, etc.). I REALLY want to avoid doing that.

If you look at the image below, before I mucked everything up, I was seeing a "plus symbol" beside WinXP.vdi. Clicking on it showed two snapshots. Now, I don't see that.

Image


Thanks,

Andy

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 17:32
by mpack
What you are seeing is normal I think: I believe "VBoxManage clonehd" clones the current state of the disk drive, not just one of the VDIs in the chain. In which case it would be an error to see any snapshots associated with the cloned file. Did you actually try using the clone? And is it missing any data?

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 18:15
by hikerguy
Yes, I used the clone, and that's when I discovered the problem. When I saw the WinXP desktop, I knew immediately
it wasn't using the snapshots (and programs I had installed before, such as OpenOffice and Adobe Acrobat) were gone.
Any ideas?

Thanks,

Andy

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 19:12
by Perryg
Did you delete the original VDI and thus the snapshots?
I believe I instructed to install a new copy to see if it worked and then we could deal with the corruptions.
AFAIK cloning does not include the snapshots and clones the base VDI.
If however you had merged the snapshots then they would also be included in the base VDI.

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 21:27
by hikerguy
Perryg wrote:Did you delete the original VDI and thus the snapshots?
I believe I instructed to install a new copy to see if it worked and then we could deal with the corruptions.
AFAIK cloning does not include the snapshots and clones the base VDI.
If however you had merged the snapshots then they would also be included in the base VDI.
Perry, I kept a copy of my original .vdi file. After trying various things, I went back to that original .vdi file.
However, now when I use my original .vdi file, I see NO snapshots associated with it (as shown in my previous
post). I'm confused why, if I'm using my original .vdi file, that I don't see the snapshots. Any thoughts?

Andy

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 21:46
by Perryg
Well probably because you moved the location? I don't know but You can look in the files structure and see if they are still there.
The corruption that you experienced is probably in the last snapshot, I don't know for sure since I am not there to test it.
There are (2) control files that VirtualBox uses to keep track of the VM's and program files.
(1) is the virtualbox.xml and the other is the machine xml. I have totally stopped using snapshots so I can not tell you which of the two has the actual information. Reading the file however it will be clear that it is the snapshot and the location of where it should be, but I believe it was the machines xml.
If you can find these files it may be possible to rebuild this, but I emphasize the word might. I have done it once but it was really hard due to the naming routine that VBox uses.

PS: just keeping a copy of the VDI is not going to bring back the snapshots, since the vdi is the base and the snapshots are what you are using. Since they were not merged they would not be included in the VDI.

PPS: If you really want to protect the VM from a major failure, you will use a snapshot to hold the machine in time, and then once you know it is working properly, merge the snapshot with the original. Then use the CloneVDI Tool to do a real time backup. That way you can always revert to a working VM. (Of course this is just my opinion). Keeping all of the snapshots for me was causing problems and actually took more drive space then cloning and then replacing. I clone every week and discard the old one to conserve space.

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 22:12
by hikerguy
Perry, great info!! Thanks very much. I'm going to chalk this one up to experience, move forward, and start rebuilding my VM. At least I didn't have to re-installed Windows!.

I'll have to think twice about using snapshots after the headache I've just gone through.

That clone tool you mentioned looks like it's for Windows. Is that correct? I'm currently running a Linux host with a WinXP guest (via VBox). Is there a simple way I can backup all the important files I would need should I ever need to restore a VM?


Thanks,

Andy

Re: Virtual machine won't boot..

Posted: 19. Oct 2009, 22:38
by Perryg
The CloneVDI tool works really well in wine. So it can in fact work in Linux. Just install wine and there you go.
I use it in both actually. My desktop is Vista Business and my laptop is Ubuntu. It really is a remarkable tool.

The way it work is it takes what you have and makes a complete copy (excluding snapshots) and stores it. It also compacts and a few other features, but you can read about that.

Re: Virtual machine won't boot..

Posted: 20. Oct 2009, 02:34
by MarkCranness
VBoxManage clonehd can be used to clone a snapshot, or clone the Current State.
It can create a new flattened VDI file containing the base VDI merged with the differencing VDIs.

Your snapshot/ differencing disk may be corrupt and the clone may fail, or by now maybe your config has changed and VB has lost track of what differencing disk is attached to what base hard disk...

See here: http://forums.virtualbox.org/viewtopic. ... 99#p103299

Re: Virtual machine won't boot..

Posted: 21. Oct 2009, 04:12
by hikerguy
Well, I ended up going back to an older image (basically it was the one I had been using, minus the snapshots). All I really needed to reload was Adobe, OpenOffice and a few programs for work.

I did take time to figure out how to back up (clone) my vdi file in case I mess things up going forward. The following are the steps I used (think I'll stay away from snapshots for now, since this is just a home systsem):
==============================================

1.Start VirtualBox
2.Click Settings
3.Click Hard Disks
4.Highlight the VM you want to clone, and click the icon to detach this VM image. Click OK.
5.Close VirtualBox completely.
6.Open a terminal window.
7.Go to the directory containing the image (the .vdi file) you want to clone.
8.Now, when using the following command, note that you must provide the absolute path to the source VDI and target VDIs (leaving the path off the target will put the image in ~/.VirtualBox/HardDisks by default). If you don't provide the absolute path, you get an error message telling you the UUID is already registered. This may take some time, depending on the file size.

Here's how my command looked: user@host: /windows$ VBoxManage clonehd /windows/WinXP.vdi /music/cloneXP.vdi
In the above example, the source file is WinXP.vdi (located in the /windows direcotry) and the destination (cloned) file is cloneXP.vdi (located in the /music directory).

To test the cloned image
1.Restart VirtualBox.
2.Click Settings
3.Click Hard Disks
4.Click the Add Attachment icon.
5.Click Add and select the path where the cloned VM is located.
6.Add it, then click Select, then OK.
7. Highlight the cloned VM and click start.
8. Verify the desktop, files, etc match up with the original vdi file.

Thanks to everyone for their suggestions. Definitely a lessoned learned, but better now than later. I'm kinda glad it happened, cause it made me get off my arse and learn how to make a backup of my vdi file.

Andy