Archive for September 5, 2007
Vmware Server allow you to create virtual disk (vmdk) files that are either growable or pre-allocated. When you create the file, you specify a maximum size. At some point, you fill the storage to the maximum size. You’ll have two choices:
- Create another virtual disk file and add it to the virtual machine. This will show up as another disk.
- Create a bigger virtual disk and copy the old virtual disk to the new one.
The first option is pretty easy, the second option will require a third party tool that can clone partitions such as Acronis TrueImage or Ghost. While Vmware does provide a set of command line tools that allow you to manipulate the vmdk files, the tools cannot grow or shrink files (well you can on a window host, but not on a linux host).
Here’s how I move the virtual environment around. I will be using Acronis TrueImage, but the concept should be the same for other partition copiers.
- Make sure the virtual machine is off. Add a second hard disk to the virtual machine.
- Boot the machine using Acronis TrueImage Boot CD, this boots the virtual machine with the backup software. Now the backup software sees two disc.
- I use the Clone feature of TrueImage to copy the content of one disk to the other.
- After the copy is complete, I turn off the virtual machine. Remove both hard disk and then re-add the destination hard disk so that it is my primary drive.
- Boot the virtual machine up with the new file. Delete the old one if you like.
Problems with Vista
When I tried this with a Vista Guest, I got a “winboot.exe” error after I boot off the cloned disk. Apparently, TrueImage does not handle the boot sector on Vista properly. To correct the problem, insert your Vista OS disc and select the repair option. This takes a few minute and fixes your problem with no data loss.
Using external drives
If you are using Vmware on a laptop like I do the hard disk space is rather limited, so you may want to create your destination file on an external usb drive. Vmware Server has an option for USB device, but don’t even think about using it. While I have managed to get the USB drive to mount, the virtual USB interface is running USB 1.1 (may be not even that fast). It took an entire day to create a 10 Gb backup file.
Instead, mount the USB on your Host OS and then create your destination file before you start the virtual machine. In fact, it’s better to turn of the USB interface on the virtual machine while you are doing this, just in case the guest and host starts fighting over your USB drive and blowing up partition table.