Screwed up a VirtualBox VM resize

This is for discussing general topics about how to use VirtualBox.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

So that created a 60GB img file. Took forever lol. Now to see if I can get at a Windows PC and use cloneVDI or try that winebottler thing.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

Hurrah, that worked! I have it all working again.

However, CloneVDI does not have a function to reduce the size of the drive from 60GB down.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Screwed up a VirtualBox VM resize

Post by mpack »

Congratulations.
omro wrote:However, CloneVDI does not have a function to reduce the size of the drive from 60GB down.
You mean, other than the "Compact" option??

If you tried to shrink the drive, rather than compact it, then its certainly true that CloneVDI does not allow that.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

That's what I tried to do all along that resulted in this issue in the first place lol

I wanted to prevent my drive expanding towards the 60gb size originally set.

However, I'm glad that it's working again and I really appreciate all your help getting me to that point!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Screwed up a VirtualBox VM resize

Post by mpack »

omro wrote:I wanted to prevent my drive expanding towards the 60gb size originally set.
You can shrink the partition size using gparted, down to some number - lets say 32GB. You musn't shrink it so much that the partition becomes congested - no more than half full. You then clone with CloneVDI, with the "compact" option enabled. This causes any data, on the drive but stored outside the partition, to be discarded. The drive will still be a 60GB drive, but from then onwards the host file cannot grow any larger than the internal partition allows.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

Awesome information, great to know.

So far the VM seems to work ok, though for some reason a few glitches seem to be occurring. When I run internet explorer (the vm is an XP install) some of the graphics files file to load and some sites are a little corrupt looking. I'm wondering if the DD didn't copy the old drive entirely accurately.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Screwed up a VirtualBox VM resize

Post by mpack »

Running chkdsk/f on the drive, from inside the guest, is probably a good idea anyway.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

Did that and it doesn't help.

I attempted to use clonezilla to recreate the image, just out of curiosity, but it created an image file that lists as having a corrupt ntfs partition table which I can't fix.

All in all, it's not perfect, but it's better than having lost all my data and the application that I needed still runs, so I'm happy enough about that.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

I'm going to keep the original vm and if the resize option ever allows you to decrease the size of the VDi I can restore from there.

I'm guessing no one knows if or when this might happen.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Screwed up a VirtualBox VM resize

Post by mpack »

omro wrote:I'm going to keep the original vm and if the resize option ever allows you to decrease the size of the VDi I can restore from there.
I'm guessing no one knows if or when this might happen.
I guessing it will never happen, given how catastrophic the results could be in the wrong hands. There are very good reasons why neither CloneVDI nor VBoxManage allows that.
omro
Posts: 26
Joined: 15. Jan 2012, 22:03
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows XP

Re: Screwed up a VirtualBox VM resize

Post by omro »

Ah well, thanks for all your help!
ostroffjh
Posts: 1
Joined: 27. Oct 2015, 01:53

Re: Screwed up a VirtualBox VM resize

Post by ostroffjh »

mpack wrote:...
Run the hex editor, .... Move the cursor to offset 0x170 (hex 170, decimal 368). Edit the 8 bytes starting from that offset so that they are "00 00 00 00 05 00 00 00". Next move to offset 0x180 (hex 180, decimal 384). Edit the 4 bytes starting from that offset so that they are "00 50 00 00".
I hope it's not necrobumping for me to say thanks for this information. Years later, and searching didn't find any better way for me to deal with this. I got the correct values to use by creating a new empty vdi file of the desired size, The hex editor (qhexedit on Gentoo Linux) claimed it couldn't save the file, but it did save it fine - it just quit after deleting the original but before renaming the temporary saved file to the proper name. I just renamed it, and was good to go.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Screwed up a VirtualBox VM resize

Post by mpack »

Hmm. Or you could have just ran the CloneVDI repair function, a feature it's had for a couple of years now.
Post Reply