Thursday, October 2, 2008

Steps to resize a Windows XP VMWare disk image

Here are the steps to resize a Windows XP VMWare Fusion 2.0 disk image:

  1. Power off machine and delete all snapshots
  2. Virtual Machine -> Settings -> Hard Disks
  3. Set your disk size to the allocation you want... but now we need to expand the partition so Windows uses all that space
  4. Quit VMWare
  5. Use a text editor to add the following line to the configuration (.vmx) file of the virtual machine (VMWare Fusion's virtual machine files are a bundle, so in the Finder right click and Open Package Contents on the sucker. Then find the .wmx file in there.): bios.forceSetupOnce = "TRUE"
  6. Download the live cd .iso from the GParted. This is the Gnome Partition Editor which will - for free - let you edit your partitions. Or you could use a windows partition editor like Partition Magic. But these steps are for GParted. Download the LiveCD .iso
  7. Relaunch VMWare
  8. Virtual Machine -> Settings -> CDs & DVDs. Use the .iso you downloaded above as the disk image.
  9. Run your virtual machine
  10. In the BIOS prompt...
    1. Use the right arrow key to navigate over to the Boot "tab"
    2. Use the down arrow key to navigate down to the CD drive in the list
    3. Press the + key on your numberpad to move the CD drive above the Hard Disk section
  11. In your Mac OS X System Preferences, make sure F10 isn't used by anything (ala: Expose). If it is, unassign F10 for now
  12. Back in the BIOS, hit F10 (Save and Exit) and return
  13. Now you should be in the LiveCD. Follow the instructions to boot it
  14. Eventually you'll be in a graphical UI for GParted. Read the resizing document for GParted. The Resize/Move button opens a dialog where you can adjust these settings. Remember: it's just X-Windows..., so tab down to the edit fields, adjust your space requirements (note the total space label in the dialog and the "new total size" text field. No, I don't think I have those names exact from the interface). Tab down to the Apply button and hit Return. Also: At least for me, the GUI tended to register clicks a few inches away from where the cursor actually was... which made it very hard to hit buttons. You may want to do some experiments (the buttons will show a border when it thinks the cursor is over it - check to see when this border shows up) to see if clicks are registered where you expect them to be - because you have to click the Apply button - no keyboard navigation to this UI element!
  15. When GParted is complete, use the UI to exit (and select that you want to shut down the machine)
  16. Virtual Machine -> Settings -> CDs & DVDs. Set it to automatically detect physical drives (aka: change it to not use the GParted LiveCD anymore
  17. Boot your virtual machine. Windows should check the disk (this is expected and was mentioned in the GParted resize guide).

Yes, this is pain.