How to shrink a Win7 virtual machine?
-
jcourcoul
- Posts: 14
- Joined: 22. Aug 2010, 10:56
- Primary OS: Mac OS X Leopard
- VBox Version: OSE other
- Guest OSses: Windows, Solaris, Linux
How to shrink a Win7 virtual machine?
A few days back, I committed the error of downloading a very large file from within a Windows 7 virtual host. I had attached a read/write Shared Folder pointing to an empty directory on the hosting MacOS boot disk to download the file into, but Windows 7 had better ideas: first it downloaded the file to its C: drive, THEN copied it over to the shared drive, vastly expanding the virtual drive in the process. So now I have a huge VM lugging around quite a few gigabytes of unneeded disk space. Could someone please provide a failsafe kitchen recipe approach to shrinking this monster?
Back in VirtualBox 3 days, I once tried to do this, but only ended up in damaging the VM beyond all possible repair. No biggie since it was just a testbench. Now, on VBox 4 and Win7, I do have enough stuff on the VM that losing it would be very painful.
Thanks in advance for your help.
JMC
P.S. I've already exported the VM as an .ova appliance on an external drive as a precaution.
Back in VirtualBox 3 days, I once tried to do this, but only ended up in damaging the VM beyond all possible repair. No biggie since it was just a testbench. Now, on VBox 4 and Win7, I do have enough stuff on the VM that losing it would be very painful.
Thanks in advance for your help.
JMC
P.S. I've already exported the VM as an .ova appliance on an external drive as a precaution.
Re: How to shrink a Win7 virtual machine?
See the CloneVDI sticky.
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
-
jcourcoul
- Posts: 14
- Joined: 22. Aug 2010, 10:56
- Primary OS: Mac OS X Leopard
- VBox Version: OSE other
- Guest OSses: Windows, Solaris, Linux
Re: How to shrink a Win7 virtual machine?
Ok, finally got CloneVDI 2.0.3 working under Wine 1.2.2 and WineBottler 1.1.44. Selected the offending .vdi and let CloneVDI do its magic with the Compact option enabled. End result was a file 25% smaller than the original.
Now, how do I use the copy? I assume I could import it into a new VM. Or, is it possible to create the copy of the original .dvi volume, conserving the original UUID and just substituting one file for the other?
Now, how do I use the copy? I assume I could import it into a new VM. Or, is it possible to create the copy of the original .dvi volume, conserving the original UUID and just substituting one file for the other?
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How to shrink a Win7 virtual machine?
It's nice to have it finally confirmed that CloneVDI will indeed work on a Mac OS X host using Wine.
If the original VM did not use snapshots (and it sounds like it didn't), then your best option is to mount the clone in the existing VM. If you create a new VM for it then the new VM-UUID would trigger Win7 reactication, unless you take steps to avoid that (see recent messages on "What causes Windows activation" stick in "Windows Guests" forum).
If the original VM did not use snapshots (and it sounds like it didn't), then your best option is to mount the clone in the existing VM. If you create a new VM for it then the new VM-UUID would trigger Win7 reactication, unless you take steps to avoid that (see recent messages on "What causes Windows activation" stick in "Windows Guests" forum).
-
jcourcoul
- Posts: 14
- Joined: 22. Aug 2010, 10:56
- Primary OS: Mac OS X Leopard
- VBox Version: OSE other
- Guest OSses: Windows, Solaris, Linux
Re: How to shrink a Win7 virtual machine?
Cool, I'll try that (swapping .vdi files) first on a Solaris 10 testbench I have just to make sure VirtualBox 4.0.4 doesn't barf.
A few notes on getting CloneVDI to go to work on the Mac:
A few notes on getting CloneVDI to go to work on the Mac:
- I did this on a MacBook Pro running 10.5.8 with the latest security patches, VirtualBox 4.0.4 r70112 and a Win7 pre-SP1 VM.
- WineBottler is 1.1.44. However, the version of Wine that comes in its .dmg is also 1.1.44, so I upgraded to the latest 1.2.2 before proceeding.
- Unpacked CloneDVI 2.03 and placed the subdirectory (containing the executable and the .bat, .xml, .ini files) in my Applications folder
- Started WineBottler, selected Create Custom Prefixes.
- With the select File... button chose the CloneDVI.exe executable.
- Ticked the Copy only checkbox underneath the Install File textbox.
- prefix template was left to the default new prefix, all other options were left blank or to default values.
- Clicked Install, chose to place the CloneDVI.app together with all the stuff in its folder, let WineBottler do its stuff.
- New icon popped up, double click to run CloneDVI from MacOS from now on. Note that this will cause X11 to launch since it uses that as the graphic platform.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How to shrink a Win7 virtual machine?
@jcourcoul: I hope you don't mind that I copied your last message to the CloneVDI support topic (in Windows Hosts) for posterity. The copied version was minimally edited by me due to the context being missing in the other thread, plus a couple of spelling issues (i.e. CloneVDI vs CloneDVI).
-
jcourcoul
- Posts: 14
- Joined: 22. Aug 2010, 10:56
- Primary OS: Mac OS X Leopard
- VBox Version: OSE other
- Guest OSses: Windows, Solaris, Linux
Re: How to shrink a Win7 virtual machine?
Oh, that's quite all right, heck, honored to be preserved for posterity
And sorry for the misspellings, after I had gotten it right at the start.
Also worthy noting the importance of simplifying the process by dealing with (i.e., getting rid of) snapshots before proceeding since that ensures a much greater probability of success.
Lastly, a report of success with the experiment using a Solaris 10 9/10 VM that was actually imported from the trial offering that Oracle has on the Solaris distribution portal. Its virtual disk is dynamic and max-sized at 64GB; in my case it had only expanded to 4.58GB. While the virtual disk manipulations were successful and the VM survived without harm, the shrink process was not too successful. Maybe because its internal format was not NTFS or FAT32, but the original 4.58GB .vmdk file was processed by CloneVDI into a 4.9GB .vdi file (using the "Keep old UUID" and the "Compact drive while copying" options). However, I was able to freely exchange the .vdi and original .vmdk files on the VM by fiddling around with the Virtual Media Manager.
Also worthy noting the importance of simplifying the process by dealing with (i.e., getting rid of) snapshots before proceeding since that ensures a much greater probability of success.
Lastly, a report of success with the experiment using a Solaris 10 9/10 VM that was actually imported from the trial offering that Oracle has on the Solaris distribution portal. Its virtual disk is dynamic and max-sized at 64GB; in my case it had only expanded to 4.58GB. While the virtual disk manipulations were successful and the VM survived without harm, the shrink process was not too successful. Maybe because its internal format was not NTFS or FAT32, but the original 4.58GB .vmdk file was processed by CloneVDI into a 4.9GB .vdi file (using the "Keep old UUID" and the "Compact drive while copying" options). However, I was able to freely exchange the .vdi and original .vmdk files on the VM by fiddling around with the Virtual Media Manager.
-
jcourcoul
- Posts: 14
- Joined: 22. Aug 2010, 10:56
- Primary OS: Mac OS X Leopard
- VBox Version: OSE other
- Guest OSses: Windows, Solaris, Linux
Re: How to shrink a Win7 virtual machine?
Finally, a report of unqualified success!
First, I did all the possible maintenance to be done on the Win7 guest: checked the C: drive, applied all patches including SP1, did a thorough disk cleaning including the elimination of all but the latest restore point, defragmented the drive and, for good measure, ran sdelete -c. Then shut the guest down, quit VB, started the Wine-ified CloneVDI and let it loose against the virtual disk with the Keep old UUID and Compact... options. Awhile later it concluded without errors and quit. Moved the old .vdi to a safe backup, renamed the clone to the original filename and fired VB up. The Windows 7 instance started up flawlessly without even having to fiddle around with the Virtual Media Manager! And the cloned .vdi is 30% smaller than the original.
Thanks everyone for the help, guidance and encouragement.
First, I did all the possible maintenance to be done on the Win7 guest: checked the C: drive, applied all patches including SP1, did a thorough disk cleaning including the elimination of all but the latest restore point, defragmented the drive and, for good measure, ran sdelete -c. Then shut the guest down, quit VB, started the Wine-ified CloneVDI and let it loose against the virtual disk with the Keep old UUID and Compact... options. Awhile later it concluded without errors and quit. Moved the old .vdi to a safe backup, renamed the clone to the original filename and fired VB up. The Windows 7 instance started up flawlessly without even having to fiddle around with the Virtual Media Manager! And the cloned .vdi is 30% smaller than the original.
Thanks everyone for the help, guidance and encouragement.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How to shrink a Win7 virtual machine?
CloneVDI supports (i.e. the "compact" option will work with...) NTFS, FATx, and EXTx. In effect this means I support Windows, DOS and Linux filesystems. I think Solaris usually uses something other than these.jcourcoul wrote:While the [Solaris] virtual disk manipulations were successful and the VM survived without harm, the shrink process was not too successful. Maybe because its internal format was not NTFS or FAT32
-
eyeman
- Posts: 36
- Joined: 8. Apr 2011, 20:56
- Primary OS: Mac OS X other
- VBox Version: OSE other
- Guest OSses: windows xp
Re: How to shrink a Win7 virtual machine?
Hi All
I am trying to run CloneVDI in Mac OSX with Wine and WineBottler. I followed the instructions above, and it appeared to install. I want to know actually how to run the CloneVDI. When I click on the MyWineApp that I created, nothing appears to happen. I pointed the WineBottler to the CloneVDI.exe that I downloaded.
please advise
I am trying to run CloneVDI in Mac OSX with Wine and WineBottler. I followed the instructions above, and it appeared to install. I want to know actually how to run the CloneVDI. When I click on the MyWineApp that I created, nothing appears to happen. I pointed the WineBottler to the CloneVDI.exe that I downloaded.
please advise