HOWTO: Shrink a VirtualBox 1.5.0 Windows Guest Virtual Disk

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
burggraf2
Posts: 23
Joined: Sat 18 Aug 2007, 21:39

HOWTO: Shrink a VirtualBox 1.5.0 Windows Guest Virtual Disk

#1 Post by burggraf2 »

Problem: Your XP virtual disk file in VirtualBox 1.5.0 has grown too large due to fragmentation. Even though you only have 4 gigs of stuff on the disk, the file is 12GB large!

Here's what you need to do:
1. Defragment the disk, moving files to the beginning of the disk.
2. Overwrite all empty space in the disk file with zeros.
3. Close the windows VM and compact the disk file

You need these free tools:
http://www.dirms.com/
http://www.microsoft.com/technet/sysint ... elete.mspx

First, boot up your Windows VM under VirtualBox.

DirMS will defragment the disk and move all files to the beginning (leaving all the free space at the end of the disk.) Run the command:

dirms c -q
or
dirms c

You may need to run this several times. Run the built-in XP defrag utility to get a visual map after running dirms. You'll see the improvements.

Now wipe the free space with zeros:

sdelete -c c:

Now, exit your Windows VM and go back to a Puppy prompt:

VBoxManage modifyvdi <diskfile.vdi> compact

That should compact your disk file!

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

That's nice, but what does it have to do with Puppy Linux?

burggraf2
Posts: 23
Joined: Sat 18 Aug 2007, 21:39

VirtualBox running under Puppy Linux

#3 Post by burggraf2 »

what does it have to do with Puppy Linux?
VirtualBox 1.5.0 runs great under Puppy Linux 2.17 in seamless mode, allowing you to run Windows apps under Puppy, right on the Puppy desktop.

This provides the perfect stepping stone for people who want to abandon Windows, but aren't quite ready to go "cold turkey." Just because there's one Windows program you still need doesn't mean you're stuck with Windows. You can now run Puppy and still have the necessary Windows apps in the Puppy environment.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Yes I find these Virtual Box Howtos very useful

#4 Post by mcewanw »

Yes, I found your Howto install Virtual Box to work seamlessly with Puppy particularly useful. In fact, I downloaded VirtualBox source yesterday because of it. Keep up the good work.

The only thing I wish is that you had added the extra material to the same Howto, that would have emphasised the relevance of the different parts and saved lots of hunting around for other info. It's always great to have a central repository about something. In other words, the following three Howtos you submitted (are there ones I missed?), would make one really great howto if combined:

HOW TO: Install VirtualBox 1.5.0 under Puppy 2.17 Seamlessly
http://murga-linux.com/puppy/viewtopic.php?t=21617

HOWTO: Clone a VirtualBox 1.5.0 Virtual Disk
http://murga-linux.com/puppy/viewtopic.php?t=21796

HOWTO: Shrink a VirtualBox 1.5.0 Windows Guest Virtual Disk
http://murga-linux.com/puppy/viewtopic.php?t=21797

If you are keeping it all separate, what I would suggest is that you put in a link at the top of each extra one pointing back to the "Install... Seamlessly" one, so that puppy readers know about that possibiliy. Indeed a list of links/cross-links to your other howto's on the subject would tie them altogether if you want to avoid rearranging the materiial into one central repository for VirtualBox/Puppy-related info.

But great work really. I am not using Windows at all anymore, but need the virtual machine version for the occasion Windows program my family insist on using (and can't be bothered fully testing them under Wine).

Like I say, excellent material and thanks. I'm looking forwards to trying VirtualBox out.

William (mcewanw)

burggraf2
Posts: 23
Joined: Sat 18 Aug 2007, 21:39

Thanks

#5 Post by burggraf2 »

Thanks. I figured others would benefit by my tinkering, so it was time to start giving back.

I will gladly update the first thread with pointers to the other.

One other note -- I notice that, while running VirtualBox seamlessly under Puppy, you can't interact with the desktop. So, for instance, you can't drag new icons to the Puppy desktop. Easy fix: shrink the windows VM (right-click on your vm on the puppy task bar and choose minimize.) Now you can interact with the desktop. Just restore the VM when you're done. No harm, no foul.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

Thank you. I didn't have any idea it was for running Windows programs in Linux until you explained it. :lol: ) It ought to be a very welcome addition to Puppy. (Though Linux newcomers might have trouble guessing from its name what it is for.)

Bruce B

#7 Post by Bruce B »

burggraf2,

Well articulated information. Thanks.

Would you kindly give me a speed estimate of how VirtualBox XP compares to a native installation?

Bruce

burggraf2
Posts: 23
Joined: Sat 18 Aug 2007, 21:39

VirtualBox Speed estimate

#8 Post by burggraf2 »

Would you kindly give me a speed estimate of how VirtualBox XP compares to a native installation?
Well, it FEELS just as slow as a native installation. :)

It's really hard to estimate, because my native installation is so bogged down that it's much slower than the fresh VBox XP instatallation (why do you think I'm running Puppy?)

Perhaps, though, I can run some concrete tests (on the same hardware.) What kind of information are you looking for?

I have an XPHome install with a full install of Visual Studio 2005. Perhaps I can do some basic testing with that under the VM and in the native install and post the results. Keep in mind, of course, that the VM is a fresh install (with all patches applied) and the native install has been running since about the beginning of April, so it's gathered some registry gunk.

burggraf2
Posts: 23
Joined: Sat 18 Aug 2007, 21:39

VirtualBox 1.5.0 Speed Tests vs. Native Windows

#9 Post by burggraf2 »

Ok, this is not very scientific, but I ran some basic tests.

VirtualBox 1.5.0 running under Puppy 2.17 frugal install on the same hardware

Differences:
XP Pro MCE running natively on a 10,000 rpm sata II drive
Puppy booting and running off an external 7200 rpm usb drive

VM running XP Home, with a fresh install, all patches applied, VS2005 installed
Native install has a lot of stuff installed

Booting
Native install, about 65 seconds
VBox, about 15 seconds

The other tests I ran seemed about the same. Starting up WordPad seemed instantaneous under VBox, slightly slower natively. Starting up Visual Studio took 8 to 10 seconds the first time, then just under 3 seconds the second time -- on both platforms. Opening Internet Explorer to a blank page was under a second on the VM, 1-2 seconds natively.

All in all, the VM FEELS faster, but I haven't done any real work in it yet, so we'll see. I plan to move some Visual Studio C# work there next week, and I'll let you know if it's reasonable to do real work in that environment.

timothyli
Posts: 65
Joined: Sun 22 Jun 2008, 07:44
Location: Toronto, Canada

#10 Post by timothyli »

I run VirtualBox on my Pupeee booted off of a 8Gig SDHC card in a ASUS Eeepc 4G.

Then under VirtualBox, I run Windows XP Professional SP3, also off of the same SD card. The Win XPpro VDI takes up about 3Gig of space with MS Office installed.

I did not do any benchmark, but XP feels very responsive, definitely usable for day-to-day tasks like surfing, emailing, watching Youtube, quicktime.com, and running MS Office. I use seamless mode so I get PuppLinux and Windows at the same time.

I have experimented with many configurations with my Eeepc and this is the most optimum. I did not even have to touch the internal SSD drive on the Eeepc.

I love PuppyLinux and Virtualbox!

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#11 Post by Master_wrong »

The Win XPpro VDI takes up about 3Gig of space with MS Office installed.
I guess we can use 4Gig flashdisk ? putting Puppy 301 and xp&office in it ?

:lol: cool
in my experiment..., my vdi was about 2Gigs, and office was fit, but barely more room for anything else.
I did not do any benchmark, but XP feels very responsive, definitely usable for day-to-day tasks like surfing, emailing, watching Youtube, quicktime.com, and running MS Office. I use seamless mode so I get PuppLinux and Windows at the same time.
how much ram did u allocate to it ?
have u tried using it to play 3d games, ?
I'd love to try but my memory just too small...

thank you

User avatar
yim
Posts: 167
Joined: Sat 01 Sep 2007, 05:24
Location: Blue Ridge Mtns

#12 Post by yim »

I have xp running as stated but there is no seamless option in menu & rt control+L doesn't work any suggestions? 2.17.1 with fluxbox 1.0

thanks yim

Post Reply