Page 1 of 3

Disaster after running out of disk space!

Posted: 11. Dec 2009, 17:20
by Quaxo76
I have a Linux host, and a Windows XP SP3 guest. VirtualBox is version 3.0.12. I keep my vdi files in my /home partition. I use the dynamic vdi images.
I had more than 5GB free in my /home, so I was feeling safe; somehow though (I don't know why, I wasn't doing anything special, but the antivirus was scanning... maybe that was it?) the image file grew huge and filled the space in my /home partition. Then Windows crashed with a memory error.
I closed Virtualbox, freed up a few gigabytes of space, and started the virtual machine again. Windows starts, and some programs work, but... most programs, when run, open briefly a DOS window that says "Program too big to fit in memory", then quits. I can't even reinstall most software, because the installers give the same error.
I also get weird errors when doing innocent tasks: i.e. if I right-click on the desktop I get the following error: "C:\Windows\System32\rundll32.exe - The NTVDM CPU has encountered an illegal instruction. Choose "Close" to terminate the application".
I tried chkdsk, and it finds no errors.

What is frustrating is that this is the second time it happens. With the exact same symptoms. The previous time I just wiped Windows and reinstalled it, but this time I have lots of files and configurations I don't want to loose. What happened to the system? Can it get so badly damaged just by running out of disk space? What's the point of having dynamic vdi's if they're so dangerous?

And mostly... Is there any way to fix it?

Thank you in advance,
Cristian

Re: Disaster after running out of disk space!

Posted: 11. Dec 2009, 18:03
by Perryg
Well first you can create another VM of XP and then attach the original as a second drive to be able to retrieve your files. So at least you will not loose your data.
Next thing to figure out is why did it fill up. Are you saying that the max amount of storage you had available on the host was 5Gig?
We need to know how big the virtual HDD was set to and was it dynamic or static?

Windows creates shadow copies while you are using it as well as restore points. These use a lot of drive space as does the swap file. Are you using snapshots? These also take up a lot of drive space.

Re: Disaster after running out of disk space!

Posted: 11. Dec 2009, 18:15
by Quaxo76
Perryg, thank you for your reply!
I know about creating another VM for retrieving the files, but the problem is that I can't later re-import those files when I reinstall the application. It might have to do with copy protection or something like that.
The vdi is dynamic (never more! Only static in the future, even though it's a waste of space).
The free space on the host data partition was about 5GB. The vdi was about 9GB, with a maximum set at 20GB. So if Windows started to fill the virtual drive with "something", it may easily have exceeded the available space. I knew I didn't have enough space for the whole 20GB, but I thought that with 5GB free, I was safe as long as I didn't install anything new.
I also tried running defrag on that vdi: and its size increased of another 2GB! And I can't get that space back! I really don't get it.
The swap file is a possibility. I didn't think of that. Sadly I can't even open the control panel, to check or modify the settings, to get that space back - as the control panel crashes, too.

Re: Disaster after running out of disk space!

Posted: 11. Dec 2009, 18:38
by Perryg
Try to start it in safe mode. That should hold back enough for you to be able to at least get to a command line. Look for temp files and anything that you can safely delete to clean enough space to be able to boot normally. Then you can also remove anything that is not totally necessary. One of the problems (as I see it) is assigning more than the actual free space. Once Windows gets going the space moves all over the place while you are actually using it. Defrag can take as much space as the original file size and if you tell the VM that it can go to 20 Gig and you only have 15 Gig it will fill up and crash.

Re: Disaster after running out of disk space!

Posted: 11. Dec 2009, 18:58
by Quaxo76
The problem right now is not to find some free space. I freed up a few GBs in my host system, and the virtual windows reports about 5GB free.
The problem is that the virtual Windows got damaged pretty badly (but how? Only from running out of disk space?) and now, though it boots without problems, most applications crash at launch.
And it's not the "big" applications; for example, Chromium and Firefox run well, but my TomTom app crashes; Notepad works, but the System app of the control panel crashes; looks like there's something broken at a lower level...

EDIT - I also just noticed that the menu bar in the File Explorer windows (the bar with the "Files - Edit - " and so on) is missing, and is replaced by a small Windows icon... ?!?

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 04:31
by MarkCranness
It is possible that this is what happened:
- VirtualBox translated the host disk full condition into a VM hard disk write error?
- The VM was at the time writing to the paging/swap file for paging memory, so reported to you a memory error.
- The VM having seen a problem with the paging file, disabled the page file.
- Now when you run the VM, it is low on memory (because it does not now have the paging file to provide virtual memory)?

Try:
- Assign more memory to the VM using the VirtualBox settings pages.
- Recreate or reset the Windows page file: http://www.theeldergeek.com/physically_ ... e_size.htm
- Perhaps create a new VDI somewhere you have some space, and set Windows VM to use that other drive for the page file (see the link above).

If/when you have it all recovered, using CloneVDI (see the sticky in the Windows Hosts forum) is any easy way to shrink a VDI file. It will undo the size increase you saw when you defragmented.

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 09:50
by Quaxo76
MarkCranness wrote: - VirtualBox translated the host disk full condition into a VM hard disk write error?
I think that's exactly what happened. How that managed to cripple my system so badly, I don't know. So far I've found and replaced 6 damaged system files, but I still get the same symptoms.
MarkCranness wrote: - The VM having seen a problem with the paging file, disabled the page file.
I don't think this is the case; though I'm unable to enter the page file configuration utility, I tried deleting the page file from within another VM, and the page file is recreated as soon as I run the damaged VM again.
MarkCranness wrote: - Now when you run the VM, it is low on memory (because it does not now have the paging file to provide virtual memory)?
I don't think so (see above): the VM has plenty of physical ram (1.5GB, reported 1GB free); and a freshly-created 2GB swap file.
MarkCranness wrote: Try:
- Assign more memory to the VM using the VirtualBox settings pages.
- Recreate or reset the Windows page file: http://www.theeldergeek.com/physically_ ... e_size.htm
- Perhaps create a new VDI somewhere you have some space, and set Windows VM to use that other drive for the page file (see the link above).
I tried recreating the swap, replacing the registry with backups from a few days ago, nothing helped. I might try a repair installation, to see what happens.
VERY frustrating. Never more a dynamic VDI!

Honestly I think that when this happens (physical HD running out of space for a dynamic VDI) VirtualBOX should pause the emulation, or some other safe action, instead of generating write errors that consistently damage the system...

Cristian

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 11:20
by Quaxo76
I tried doing a "repair install" of Windows over the damaged VM.
Some of the problems are gone (I can now access system tools, control panel, several applications, and the menu bar in File Explorer is back), but I still get the "Program too big to fit in memory" error on some applications, and the antivirus won't run... How can it be that even a repair install doesn't fix the memory problem? :(

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 12:31
by skoehler
Perryg wrote:Well first you can create another VM of XP and then attach the original as a second drive to be able to retrieve your files. So at least you will not loose your data.
Next thing to figure out is why did it fill up. Are you saying that the max amount of storage you had available on the host was 5Gig?
We need to know how big the virtual HDD was set to and was it dynamic or static?

Windows creates shadow copies while you are using it as well as restore points. These use a lot of drive space as does the swap file. Are you using snapshots? These also take up a lot of drive space.
Why do all your fingers point away from VirtualBox?
Has it ever been tested, whether VB behaves well if it encounters a full disk scenario?

There are many things, that VB has to take care of. It must not corrupt the virtual disk, it must report some write errors to the Guest-OS, etc.
Is this working properly?

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 12:35
by skoehler
Quaxo76 wrote:The problem right now is not to find some free space. I freed up a few GBs in my host system, and the virtual windows reports about 5GB free.
The problem is that the virtual Windows got damaged pretty badly (but how? Only from running out of disk space?)
A dynamically growing harddisk does seem like a broken harddisk to the guest OS (or at least should)
The guest OS tries to write something, but the write should fail, just like it does for a broken harddisk, because virtualbox doesn't know where to put stuff that is being written by the guest OS. So IMHO VirtualBox should report an error to the guest OS.

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 12:38
by skoehler
Quaxo76 wrote:I tried doing a "repair install" of Windows over the damaged VM.
Some of the problems are gone (I can now access system tools, control panel, several applications, and the menu bar in File Explorer is back), but I still get the "Program too big to fit in memory" error on some applications, and the antivirus won't run... How can it be that even a repair install doesn't fix the memory problem? :(
Grab a Linux CD (like Knoppix), backup your files and reinstall Windows.

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 13:56
by Quaxo76
skoehler wrote: Grab a Linux CD (like Knoppix), backup your files and reinstall Windows.
I don't need Knoppix for that, I'm on Ubuntu, and I can move files around in the "crippled" VM. The problem is I can't easily re-import the data files if I wipe the system and reinstall. Anyway, after the repair install, things have gotten better, at least now I can use the system tools to try to fix it.

Re: Disaster after running out of disk space!

Posted: 12. Dec 2009, 15:57
by Perryg
skoehler
Why do all your fingers point away from VirtualBox?
Has it ever been tested, whether VB behaves well if it encounters a full disk scenario?
Because in this situation the problem seems to have been brought on by the following.
Quaxo76
I knew I didn't have enough space for the whole 20GB, but I thought that with 5GB free, I was safe as long as I didn't install anything new.
It is the same thing that would have happened if you tried to copy a 10Gig file to a drive that only had 5Gig of available space on any native HDD using any OS software.

Anyway it is good that the original poster has been able to get it to a point that they are able to repair this. Just remember to not set the upper limit to more then the real drive has available, probably a little less.

Re: Disaster after running out of disk space!

Posted: 13. Dec 2009, 20:46
by skoehler
Perryg wrote:
skoehler
Why do all your fingers point away from VirtualBox?
Has it ever been tested, whether VB behaves well if it encounters a full disk scenario?
Because in this situation the problem seems to have been brought on by the following.
Quaxo76
I knew I didn't have enough space for the whole 20GB, but I thought that with 5GB free, I was safe as long as I didn't install anything new.
It is the same thing that would have happened if you tried to copy a 10Gig file to a drive that only had 5Gig of available space on any native HDD using any OS software.
What are you talking about!?
If I assume, that VirtualBox handles out-of-diskspace sitations well and then vdi doesn't get corrupted, then what does the guest OS see? I assume, it sees a broken harddisk. You don't expect any guest OS to handle this situation gracefully, do you?

So if virtualbox behaves well, could it behave any better? Well, yes, it could. It could shutdown the guest immediatly, to avoid the corruption of the guests filesystem. It could make the vdi read-only after the first failed write attempt. Both methods probably keep the filesystem in a much better state. If the guest OS is allowed to continue to run and write, and the filesystem may be altered by the guest OS to refernce harddisk sectors that aren't there because the vdi wasn't able to grow.
Even better than a crash would be to suspend the guest. Of cause, VirtualBox would have to pre-allocate some space to be able to suspend the guest in an out-of-diskspace scenario.

Don't get me wrong. I don't expect you to do implement that.

Re: Disaster after running out of disk space!

Posted: 13. Dec 2009, 21:21
by Quaxo76
skoehler wrote: Even better than a crash would be to suspend the guest.
Actually I'd love if it would just pause the guest and show a warning. Would be enough for me.

Things were starting to get better, I had fixed almost everything, when it happened again. For no apparent reason the vdi size increased of another 3-4 GB causing the same problem again. Oh my am I sick of this. I just wanted to get back to a stable state before doing a general cleanup of my system... Why oh why must Windows let its vdi grow so large for no reason whatsoever? Now Windows reports only 8GB used but the vdi size is almost 18GB! :(