My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana - Jon Galloway

My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Summary

  • Windows 7’s Boot to VHD works as advertised – native speed, virtual machine flexibility.
  • I came up with some tips and tricks which you might find useful
  • Having to reboot without hibernate to switch to the VHD machine means it’s a lot less useful than I’d hoped.

Background

I’ve recently been running some early releases developer tools which came with the “install on VM’s if you don’t want your computer to catch fire” warning. That seemed like a good time to back off on my “VM’s are for sissies” stance and get my VHD on. After verifying that there wasn’t already a suitable VHD available for download, I decided to follow Scott Hanselman’s directions to set up a Boot To VHD instance.

Here’s a very high level overview:

  1. Download the wim2vhd script from CodePlex
  2. Install the Windows 7 Automated Installation Kit (AIK)
  3. Copy ImageX.exe from the the AIK install into the same folder as the wim2vhd script
  4. Run the script
  5. Mount the VHD in the Windows 7 disk management screen
  6. Run some funky commands to make the disk bootable

There's a little goofing around at the command line, but it's only a few minutes if you follow the directions. Then your new VHD shows up as an option on boot.

BUT WAIT! I have a few minor modifications. Rather than write a complete walkthrough of the process – since Scott and others have done such a good job there – I’m just going to list some footnotes to the process. I’ve very roughly outlined the steps above; I recommend you read through the following list of tips, then go and follow Scott’s walkthrough and use any of the below tips you think are helpful.

Mod #1: Getting ImageX.exe without installing the AIK

There are copies of ImageX.exe floating around on the internets. I normally wouldn’t recommending using them, I only mention that because the AIK is 1.5 GB. If you’re one of those irrational people that thinks downloading 1.5GB to get a 471KB program, you could search around for “download imagex.exe” If you do that, the CRC for my my 32 bit ImageX.exe – version 6.2.7600.16385 - is 54 BF FA D5. Not recommended, but it is an option.

Note: Dear Microsoft folks that make gigantic SDK’s, please stop. Those might have made sense before the internet, but… c’mon now. Here’s how utilities should be done: live.sysinternals.com. 

If you end up downloading the entire (1.5GB!!!) AIK ISO but hate installing a bunch of junk just to use one thing, you can open the ISO in 7-zip and find the find the ImageX.exe file, by looking for F1_imagex in Neutral.cab, like so:

ImageX 

Then you can just extract that file and rename it to ImageX.exe.

Mod #2: Changing the VHD size

The wim2vhd script defaults to a 40GB dynamic disk. Normally, I don’t really care much about the size of a dynamic disk, because the actual size of the VHD is only as big as the actual used space, and you can compact a disk to recover space as needed. However, when you mount a dynamic drive, the boot manager and host filesystem appear to reserve the maximum possible size of the of the disk – 40GB. In my case (on a laptop), that wasn’t going to work.

It’s not just a convenience thing, either – if you have a VHD whose maximum size exceeds the physical disk space available, you’ll get a blue screen of death:

BSOD - Windows 7 Boot From VHD

(photo credit: Bart Lannoeye, see his post about the BSOD issue)

You can change the created VHD disk size using the /size parameter. For my Windows 7 + Visual Studio 2010 testing purposes, a 16GB disk seemed to work well. To do that, you’d call wim2vhd with this command:

cscript wim2vhd.wsf /wim:e:\sources\install.wim /sku:ultimate /size:16384

The size is calculated in MB, so you calculate it as 1024 * number of GB. A 20GB would use /size:20480

Mod #3: Rearming Windows to extend the evaluation time

If you’re using a virtual machine installation of Windows for temporary testing, you can use it without activation for 30 days. However, you can extend that evaluation period 3 times, giving you a total of 4 months, which is plenty of time for most evaluation purposes. It’s really simple:

Run "slmgr -rearm" from a command prompt with admin rights

This isn’t a hack – it uses a command that’s been shipped with Windows since Vista first came out. It’s not really news – Jeff Atwood wrote about it a while ago, and Ed Bott followed up with a cool tip on scripting that command to run every 30 days so you don’t forget. But it’s a really handy note, and it bears repeating.

Note: Apparently you can use the SkipRearm registry setting to extend that even further, but I don’t know if that’s covered by the EULA. I haven’t had the need to use a VM that long, so I’ve never run into that.

Mod #4 (untested): EasyBDC

You can apparently skip the rigmarole with BCDEDIT by using EasyBCD, because beta builds of EasyBCD 2.0 support the Windows 7’s VHD features.

Note: I haven’t done this. I’ve used previous releases of EasyBCD and haven’t had a problem, but I haven’t used EasyBCD 2.0 as it wasn’t out when I set up my VHD.

Mod #5 (untested): Disk2vhd

The SysInternals team recently released Disk2vhd, which can capture a disk image (while running) and create a VHD. I believe that in order to use the created VHD on the same machine it was created from, you’d first need to sysprep it, since otherwise you’re essentially trying to run two identical copies of the same operating system on the same computer, and you run into problems with drive paths. I haven’t tried this yet.

Gotcha #1: Go with Windows 7 Ultimate

Boot to VHD only works in Windows 7 Ultimate or Enterprise, not Windows 7 Professional. But you can’t use the Windows Activation re-arm trick we just talked about in Enterprise (since it uses a different licensing model). So I recommend that you go with Windows 7 Ultimate Edition.

Gotcha #2: Dual Boot means no hibernation

I use hibernation quite a bit, and only do a full reboot when I have to. So, for me, dual booting was inconvenient. It meant shutting everything down – including saving any tabs I happened to have open in IE8 (since tab saving in IE8 has been pretty unreliable for me) – in order to use the VHD partition, then shutting everything in the VHD partition down to switch back to the main one. That’s a lot of friction, and it ended up that I don’t use it as often as I thought I would.

As I write this, I’m setting up a VHD which I’ll just run under Virtual PC, because I can start it up without shutting everything else down. I still feel like it’s a great feature, just one that I’ll use less often than I thought.

Side note: Fast switching between boot instances would be a killer feature for Windows. I’d settle for multiple hibernation instances. I’ve read that it’s not enabled because of concerns over invalidating one hibernation instance while running the second machine instance, but I disagree – let me make that decision. At least give me a registry setting or something to enable it.

Published Sunday, October 25, 2009 3:57 PM by Jon Galloway

Comments

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Gotcha #3 - if you are using BitLocker, you cannot boot to VHD with only one drive. :-(

Sunday, October 25, 2009 7:27 PM by timheuer

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

I agree about the fast switching option, that is really needed. I would also prefer multiple hibernation, this seems the best way.

Cheers,

Laurent

Monday, October 26, 2009 5:56 AM by Laurent Bugnion

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

I gave up on multi-boot long ago because inevitably the program I need to run is on the partition that is not currently active.  For now, VMs are the only solution that allows for launching any app, any time, regardless of which OS partition they are running on.

Monday, October 26, 2009 6:34 AM by jbrinkman

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Your link to Scott's blog links to your internal mail server first.

Monday, October 26, 2009 10:56 AM by Roger

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Roger - Thanks for pointing that out. Those sneak by me sometimes, because of course for me the link just works. Fixed.

Monday, October 26, 2009 12:59 PM by Jon Galloway

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Great post Jon. Is it possible to boot a vhd both from disk and from VPC? (I guess it is not, from reading your post, but...)

Tuesday, October 27, 2009 12:53 PM by alberto

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

+1 for hibernation registry setting ;)

we NEED hibernation !!! NOW !

Friday, November 13, 2009 3:42 AM by Perica

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Re Gotha#1, Dual Boot to Win7 VHD works for me on Win7 Professional.

I have retail copy of Win7 Professional (pre-ordered ont he cheap) and have successfully created a dual boot into a WIn7 Enterprise (as that is one of the VHD downloads available from MS).

I must admit, it took me a while but I had none of the issues you talk about.

Friday, November 27, 2009 3:52 PM by Stuart Wells

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

@Stewart Wells

Late comment... The limitation is in regard to the OS within the VHD container.  People using any edition can boot a copy of either Ultimate or Enterprise if those 2 are inside the VHD container.  Otherwise you will get a license restriction message upon bootup attempt.  Trust me I have already tried.

Saturday, January 16, 2010 1:50 AM by Robert

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Rather nice blog you've got here. Thanx for it. I like such themes and everything connected to them. I definitely want to read a bit more on that blog soon.

Sincerely yours

Tuesday, February 16, 2010 3:31 PM by Darek Wax

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

What do you think about adding some more illustrations?  I’m not trying to offend anyone, page is really great. Just as I know people acquire information much more effective when they see some helpful images.

Jeff Page

Monday, May 10, 2010 7:23 PM by jammers com

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Really it was extremely interesting for me to read this post. Thanks for it. I like such topics and anything connected to them. I definitely want to read a bit more soon.

Thursday, May 20, 2010 11:07 PM by social site

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Really cool blog to read it to my thinking. BTW, why haven't you you place it to social bookmarks? This can bring a lot of traffic to this domain.

Thursday, May 27, 2010 8:57 PM by indian escort service london

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It was extremely interesting for me to read the article. Thanx for it. I like such themes and anything that is connected to this matter. I definitely want to read more on that blog soon.

Hilary Hakkinen

Wednesday, August 04, 2010 9:42 PM by brunette ladies

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Rather cool blog you've got here. Thanks the author for it. I like such themes and everything connected to this matter. I would like to read a bit more on that blog soon.

Kate Swenson

<a href="suisse-escort.com/">escort girls suisse romande</a>

Wednesday, September 15, 2010 9:30 AM by Kate Swenson

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It is extremely interesting for me to read this blog. Thanx for it. I like such topics and anything that is connected to this matter. I definitely want to read a bit more on that blog soon.

Avril Smith

<a href="kievcityescort.com/">kiev models</a>

Saturday, September 25, 2010 8:02 PM by Avril Smith

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It was rather interesting for me to read this article. Thanks the author for it. I like such themes and everything connected to them. I would like to read a bit more soon.

Don't you think design should be changed from time to time?

Julia Smith

<a href="www.asianescort.us/">asian girls escort</a>

Monday, October 25, 2010 2:34 PM by Julia Smith

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It was extremely interesting for me to read that post. Thanks for it. I like such themes and anything that is connected to this matter. I definitely want to read more on that site soon. By the way, rather good design you have here, but don’t you think it should be changed from time to time?

Whitny  Pingtown

<a href="www.baccaratgirls.com/">escort adult</a>

Tuesday, October 26, 2010 7:39 AM by Whitny Pingtown

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Damn, certainly nice information. Where can I get this subscription?

Jenny  Flouee

<a href="www.wirelesscameradetectors.com/">best bug detector</a>

Tuesday, November 23, 2010 12:00 PM by Jenny Flouee

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Wow, truly nice info. Where can I find your subscription?

Whitny  Smith

<a href="nycescort.org/">escort services new york</a>

Monday, November 29, 2010 5:27 PM by Whitny Smith

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It is extremely interesting for me to read the blog. Thanks the author for it. I like such topics and anything that is connected to them. I definitely want to read a bit more on that blog soon.

Avril Smith

<a href="irelandescortdirectory.com/">www. escorts in ireland.com</a>

Thursday, December 02, 2010 11:20 PM by Avril Smith

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

amazing stuff thanx

--------------------------------------------

my website is <a href="zeroskateboards.org/.../cool-skateboards-images-10.html">skateboard cupcakes</a> .Also welcome you!

Friday, December 03, 2010 2:17 PM by cool skateboarding pics

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Cool content. When will I get the additional details?    

Avril Kuree  

<a href="westsideescort.com/">west end escorts</a>

Friday, December 03, 2010 5:33 PM by Avril Kuree

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

I maintain listening towards the information converse about obtaining no cost online grant purposes so I've beenlooking close to for the best internet site to get one particular.

--------------------------------------------

my website is  

http://coffeecups.mobi

Also welcome you!

Sunday, December 05, 2010 3:47 PM by RickenBacker Bass

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Cool page. Will be back soon.

Julia Swenson  

<a href="rome-escort.info/">100 euro escorts in rome</a>

Monday, December 06, 2010 5:33 PM by Julia Swenson

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Damn, rather interesting information. Where will I find your subscription?

Mary  Pingtown

<a href="www.latinescortlondon.com/">latin escorts</a>

Tuesday, December 07, 2010 8:58 AM by Mary Pingtown

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Great text. Ready to read more.  

Julia Swenson    

<a href="parisescort.info/">escort tour in paris</a>

Friday, December 10, 2010 2:17 PM by Julia Swenson

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

A thousand-li journey is started by taking the first step.

-----------------------------------

Sunday, December 19, 2010 6:45 PM by ipad accessories reviews

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It is extremely interesting for me to read this post. Thanx for it. I like such topics and anything connected to them. I definitely want to read more on that blog soon.

Joan Kuree

<a href="rome-escort.info/">escorts rome italy</a>

Monday, December 20, 2010 9:51 PM by Joan Kuree

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

-----------------------------------------------------------

just wanted to say i discovered this web page outstanding cointent and assets. The author obviously understands his/her topic plus the comments posted confirm what i am  stating. Well carried out.

Monday, January 03, 2011 4:24 AM by best ipad application

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It was extremely interesting for me to read that article. Thanx for it. I like such themes and anything that is connected to this matter. I would like to read a bit more soon.  

Whitny  Stepman  

<a href="lasvegas-escort.com/">las vegas asian escorts</a>

Tuesday, January 04, 2011 8:33 PM by Whitny Stepman

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Impressive text. Will be back soon.  

Anete Swenson    

<a href="mexicoescorts.biz/">escorts in mexico</a>

Friday, January 07, 2011 6:54 AM by Anete Swenson

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

-----------------------------------------------------------

yea good Do the job

Saturday, January 08, 2011 3:55 AM by ipad app reviews

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Rather interesting place you've got here. Thanks the author for it. I like such topics and anything that is connected to them. I definitely want to read more soon.

Hilary Simpson

<a href="kolkataescort.com/">kolkata escort</a>

Wednesday, January 12, 2011 4:23 PM by Hilary Simpson

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

Great text. Will be back soon.    

Julia Kuree      

<a href="kievcityescort.com/">escort in kiev</a>

Friday, January 14, 2011 11:17 PM by Julia Kuree

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

"Substantially, the report is in fact the freshest on that deserving matter. I harmonise with your conclusions and likewise undoubtedly will eagerly appear forward to your  long term updates. Stating thanks certainly won't basically just be sufficient, for your exceptional lucidity with your writing. I can directly grab your rss feed to remain  privy of any sort of updates. Gratifying function and likewise significantly success as part of your organization enterprize!"

--------------------------------------------------------------------  

I have a <a href="onlytopreviews.com/">hd video camera reviews</a> Website,i love him.Mania !You are welcome to look!

Monday, January 17, 2011 2:37 AM by computer monitor reviews

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It is certainly interesting for me to read the post. Thanks for it. I like such topics and anything that is connected to this matter. I definitely want to read a bit more soon.

Julia Hakkinen    

<a href="milanescorts.com/">accompagnatrice escort girl a milano</a>

Tuesday, February 22, 2011 7:52 PM by Julia Hakkinen

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

How much time does it take to boot from Windows 7?

Saturday, February 26, 2011 4:08 AM by tuition agency

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

It is rather interesting for me to read the article. Thanx for it. I like such themes and everything connected to them. I definitely want to read more soon.  

Bella Smith    

<a href="www.pickescort.com/">london cim escorts</a>

Thursday, March 31, 2011 3:55 PM by Bella Smith

# re: My Boot-to-VHD experiment: found some tips, like it, but still haven’t found VM nirvana

I love your article. It can help me get much useful information. Hope to see more words in it. I think you will have interests to see

http://www.e-rosettastoner.com

Monday, May 16, 2011 11:40 PM by rosetta stone

Leave a Comment

(required) 
(required) 
(optional)
(required)