Virtual PC
Booting to a VHD
May 22nd
If you’re like me and run all development in a VM, then this is going to be great news for you …
Hanselman posted an excellent article on how to boot from a VHD. Check it out here.
This is exciting stuff and I’m going to give it a whirl this weekend.
Cannot Install Programs on Virtual PC
Feb 2nd
Our team is having this really odd problem with not being able to install apps in their VPC instances once the app has joined the domain at a client. The error message we get is.
“Please wait while the installer finishes determining your disk space requirements.”
No matter how long you wait, nothing happens. Hmph.
A co-worker of mine discovered a temporary work around to this issue and it involves the following:
- Uninstall the Virtual Machine Add-ons.
- Install your application of choice.
- Reinstall the Virtual Machine Add-ons.
Once you uninstall the add-on’s the installation goes smoothly.
Resizing a VHD and a Volume
Sep 26th
I ran into a problem today…. I wanted to install SP1 for Visual Studio 2008 on my virtual pc instance today. I started the install and got an error stating I did not have enough space on my drive to do so. I was about a gig short. This is on a VPC too… NO BUENO mi amigos.
NO bueno at all.
After trying a bunch of tools and different methods, I finally got something to work and I’m going to document it here.
Tools You’ll Need To Do The Job
Install all of these prior to starting the resize.
VHD Resizer – This bad little mama-jama will take your VHD file and add space to it. Essentially, it creates a new VHD, and then copies over your files onto the new VHD file.
- VHDMount – This is a component that is part of the Virtual Server 2005 download. Be sure to ONLY install this as you wont need all the Virtual Server mumbo jumbo. See the image below.
3. diskpart.exe – A little Microsoft Utility that allows you do more than the regular disk management GUI. All kinds of goodness in here. The only downfall is that it is a command line utility.
How To Get The Job Done
Important note: This process will take up to an hour if not MORE to complete. So give yourself some time.
Normally if you need space you can add another partition and create a new drive on that partition. However, for reasons of upgrades for a previously installed app (VS2008) I need more space on C, therefore I need to resize my hard drive.
1. Resize the VHD with VHDResizer.
- Open VHDResizer.
- The application will ask you for the VHD you want to resize. Select that drive and then select a destination location.
- Now select the “New Size” as shown below. In this case I’ve decided to bump up from 16 GB to 25 GB.
- Click “Resize”. Now go get lunch. This will take awhile.
2. “Plug in” the vhd as a new mount point.
We need to plug this VHD into our host machine so we can operate on it.
F:\VPC\Base>”C:\Program Files\Microsoft Virtual Server\Vhdmount\vhdmount.exe” /p
XPSP2_VS2K8_SQL05_BASE_25GB.vhd
The results will look like this:
The specified Virtual Hard Disk (VHD) is being plugged in using the default Undo
Disk option. Use /c to commit or /d to discard the changes to the mounted disk.The Virtual Hard Disk is successfully plugged in as a virtual disk device.
3. Run diskpart and expand the volume
Fire up diskpart:
F:\VPC\Base>diskpart
Microsoft DiskPart version 5.1.3565
Copyright (C) 1999-2003 Microsoft Corporation.
On computer: DONNF-PC
Find which volume you need to expand. In this case my volume was “Volume 4″.
DISKPART> list volume
Volume ### Ltr Label Fs Type Size Status Info
———- — ———– —– ———- ——- ——— ——–
Volume 0 E OFFICE12 CDFS DVD-ROM 253 MB
Volume 1 D New Volume NTFS Partition 75 GB Healthy
Volume 2 C OSDisk NTFS Partition 112 GB Healthy System
Volume 3 F FreeAgent D NTFS Partition 233 GB Healthy
Volume 4 G NTFS Partition 16 GB Healthy
Select the volume so that you can work with it.
DISKPART> select volume 4
Volume 4 is the selected volume.
Extend the volume using the extend key word
DISKPART> extend
DiskPart successfully extended the volume.
The disk has now been extended. We now need to view the volumes size, so run a list volume again.
DISKPART> list volume
Volume ### Ltr Label Fs Type Size Status Info
———- — ———– —– ———- ——- ——— ——–
Volume 0 E OFFICE12 CDFS DVD-ROM 253 MB
Volume 1 D New Volume NTFS Partition 75 GB Healthy
Volume 2 C OSDisk NTFS Partition 112 GB Healthy System
Volume 3 F FreeAgent D NTFS Partition 233 GB Healthy
Volume 4 G NTFS Partition 25 GB Healthy
We see that the new size is 25 GB. It worked. Cool.
4. “Unplugging” the Disk
At this point we are almost done. We just need to unplug the disk from our machine. We will use VHDMount for this again.
Run the following command:
F:\VPC\Base>”C:\Program Files\Microsoft Virtual Server\Vhdmount\vhdmount.exe” /u /c XPSP2_VS2K8_SQL05_BASE_25GB.vhd
Virtual disk device(s) successfully unplugged.
Merging Undo Disk(s) to parent disk(s). This may take some time.
Undo Disk(s) successfully merged.
When vhdmount mounts the disk it creates an undo disk that houses all of the changes that are done during the mount. Then, before unmounting the disk we have to tell VHDMount if we would like those changes committed or deleted. The /c switch commits those changes. These changes are merged into the disk. The /u switch unplugs the disk from the machine (unmounts it).
5. DONE
We are done. Fire up virtual PC and create a new virtual machine (vmc file) through the wizard and connect to the machine. You will now have a larger C drive.
Enjoy.
Update: When I tried to do this again an hour later on another VHD I received an error stating that VHDMount was not a valid Win32 application. WTF? I had to uninstall and reinstall VHDMount for it to work again.
VS2008 VPC’s Are Expiring Prematurely on Nov 1st
Oct 27th
Reading Jeff Beehler’s blog posted a thread here stating that the VS2008 VPC’s are going to terminate prematurely because of an OS expiration date of Nov 1st 2007.
If you’re using any of the VS2008 VPC’s you’ll want to read this. You’re going to have to back up your TFS database, and then restore it into a new VPC that is being created as we speak and is expected to be live early next week.
Ubuntu and Virtual PC 2007 Mouse Issues
Jul 28th
I recently ran into an issue while installing Ubuntu to test Mono.
Apparently when you install Ubuntu 7.04 on Virtual PC 2007 the system doesn’t recognize the mouse. MAJOR SUCKAGE. Luckily I found a link that helped me through this and eventually got my mouse working for Ubuntu on VPC 2007.
This is mainly a post to log it for my own purposes, but hopefully it helps you as well. A big thanks to the guys who figured this out.
Links