Screwed up a VirtualBox VM resize

This is for discussing general topics about how to use VirtualBox.

Re: Screwed up a VirtualBox VM resize

Postby omro » 17. Jan 2012, 15:19

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

Postby omro » 17. Jan 2012, 17:55

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.
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

Postby mpack » 17. Jan 2012, 18:31

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.
mpack
Site Moderator
 
Posts: 33681
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

Postby omro » 17. Jan 2012, 18:51

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!
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

Postby mpack » 17. Jan 2012, 19:02

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.
mpack
Site Moderator
 
Posts: 33681
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

Postby omro » 17. Jan 2012, 20:16

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.
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

Postby mpack » 18. Jan 2012, 12:19

Running chkdsk/f on the drive, from inside the guest, is probably a good idea anyway.
mpack
Site Moderator
 
Posts: 33681
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

Postby omro » 18. Jan 2012, 21:49

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

Postby omro » 18. Jan 2012, 22:14

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.
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

Postby mpack » 19. Jan 2012, 13:58

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.
mpack
Site Moderator
 
Posts: 33681
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

Postby omro » 20. Jan 2012, 17:30

Ah well, thanks for all your help!
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

Postby ostroffjh » 10. Apr 2020, 22:26

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.
ostroffjh
 
Posts: 1
Joined: 27. Oct 2015, 01:53

Re: Screwed up a VirtualBox VM resize

Postby mpack » 11. Apr 2020, 11:58

Hmm. Or you could have just ran the CloneVDI repair function, a feature it's had for a couple of years now.
mpack
Site Moderator
 
Posts: 33681
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Previous

Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 11 guests