I have an existing Windows 7 install on a 160GB SSD drive. From time to time I’d like to create a “branch” to install software that either [a] I will only need for a short space of time [b] might interfere with software already on my machine.
Let’s take [a]. As an example, I’m doing a webcast next week that involves installing some specific software. It’s a one-off. I don’t expect to do it again. I already have Live Meeting installed. Ideally I’d like to install the additional webcast software, do the webcast and the then roll-back to my original installation.
For [b], let’s imagine that from time to time I get my hands on pre-release software that may either be unstable, wont side-by-side with an existing install or I simply want to make sure it isn’t inadvertently shown in a public forum (a webcast for example). I want to isolate this install from my “day to day” OS install.
Plan A – The Direct Approach
My proposed solution was to take my existing OS install (about 50GB), create a VHD from it using Disk2vhd, wipe my existing drive, copy on the VHD and create the relevant boot entries to native boot the VHD (ignoring the scary warning about disk signatures – yeah call me crazy).
At this point, I should warn that this is fairly advanced stuff and I know little about it. That should give you a good impression that following my advice is at your own risk. If you stumble and fall, don’t come crying to me. Okay?
Back to my solution. Unfortunately that doesn’t work too well. You’ll probably find you get a nasty BSOD with a message about a lack of disk space. This is because Disk2vhd creates a dynamic disk with a maximum size set to the capacity of the captured disk. When you native boot a VHD, the boot process expands the disk to its maximum size – and it still wants some free space for a pagefile too. You simply can’t shoehorn all that into the space on the physical drive. A BSOD is the result.
Plan B – Shrink Things a Bit
My next tack was to adjust the maximum size of the VHD created by Disk2vhd. There are utilities out there to do this. I set the maximum to 80GB thinking that I could then create a series of differencing disks and boot from those. I planned this sort of layout:
My expectation was that those differencing disks would be very small. They inherit their maximum size from their parent (so in my case they all have a maximum of 80GB). Unfortunately, they are also expanded to their maximum size during boot (I’m making an assumption here – I’ve not found any documentation on this – but I again encountered the BSOD and can only assume it’s because both parent and child are expanded).
Plan C – The Long Way Around
Thus I had to revisit my drawing board and come up with plan C. There is space for two drives in my W510 and, though not ideal, I started to toy with the idea of using Disk2vhd to image my SSD to a VHD on another (larger) drive and booting from that as an alternative.
There is one major gotcha with this – disk signatures. As it says on the Disk2vhd site:
Note: do not attach to VHDs on the same system on which you created them if you plan on booting from them. If you do so, Windows will assign the VHD a new disk signature to avoid a collision with the signature of the VHD’s source disk. Windows references disks in the boot configuration database (BCD) by disk signature, so when that happens Windows booted in a VM will fail to locate the boot disk.
And sure enough, when I tried to boot the VHD created by Disk2VHD with the original disk still attached I ran into all sort of problems. Easy solution – remove the original disk and all worked well. Not very practical every day though so I changed the disk signature on the native boot VHD and it all works just lovely.
Here’s what I’ve ended up with.
- Drive bay 1
- 160GB SSD
- Original Win 7 install
- Drive bay 2
- 300GB SATA Drive
- VHD image of my original Win 7 install with all apps etc
- Option for multiple differencing disk branches
Each drive has its own boot configuration data so I can switch between them by selecting the boot device on startup. I see no reason why you couldn’t simply add the VHD native boot to the boot configuration on the original drive but I liked the idea of being able to operate each independently (and in fact had to do so during my testing and to change the disk signature).
Once you have this setup (the boot configuration etc) it’s a simple case of running Disk2vhd again to capture a new image of the original OS install at a point in time and rebooting into it. Perfect.
A refinement of this – which I may get to one day – is to convert my existing install to a native VHD boot and then I would just have to copy the VHD file to the other drive and I could remove the need for Disk2vhd altogether.
It took a lot of experimentation to get to this point but as this post is already quite length, I’ll write up the distilled “step by step” howto version in another post.