Having read about ESXi which can be bought from Dell / HP in an embedded manner, which lets you boot without harddrive I decided to go on the journey to accomplish the same thing with Hyper-V Server 2008 R2. The closest I got to an “embedded” storage thingie was a Kingston USB-stick with 16 GB of storage on it. Worth to note here is that USB-sticks doesn’t have the greatest read/write performance, which I was aware of before I started.
If you wanna see it in action you can always watch the 2½ minute video
filmed with iPhone (not the best quality, sorry!) New video shot with video-cam instead, looks a little better (I blame the rest on FLV…).
Updated: I’ve been informed through email that the OPK (OEM Preinstallation Kit) is freely available at Microsofts site.
Download it here: http://oem.microsoft.com/script/contentpage.aspx?PageID=561189 (You might need to register)
Starting off I first decided to install Hyper-V Server onto my USB-stick. That was an epic fail since it’s not (without a lot of trouble) installing Windows onto a removable drive. So I took the easy approach which saved me (and will save you) a lot of time. Boot from VHD! (click for a TechNet-video) This is a gift from Microsoft staff and Santa Claus to the rest of us. You just need to get everything right and keep track of which drive is which and why and when. But there’s a walktrough coming along nicely below this text.
Step 1: Get a USB-drive with at least 8 GB storage. This is minimum req’s for Hyper-V Server 2008 R2, but I’d recommend 16 GB. Shop the fastest one you can find, it’ll be worth it when you have to sit around and wait. You’ll also need the ISO for Hyper-V Server 2008 R2 and the Windows Automated Installation Kit (WAIK).
Either burn your ISO or use a program to mount it as a virtual drive. You could also extract the files to a directory
Step 2: Fire up CMD with admin-rights.
diskpart (starts the disk management CMD-utility)
create vdisk file=driveletter:virtualharddisk.vhd maximum=14500 type=fixed (creates a VHD on driveletter: of the size 14500 Mb and it’s fixed size for better performance)
select vdisk file=driveletter:virtualharddisk.vhd (selects the created disk)
attach vdisk (attaches it so Windows can see it)
list disk (shows you all the disks in the system, note the number of your newly created VHD)
select disk disknumber (selects the newly created VHD)
create partition primary (creates a primary partition)
select partition 1 (selects the primary partition)
active (sets it to active)
format fs=ntfs quick (format it with NTFS and do it quick)
assign (assigns a driveletter, note with driveletter it gets!)
Leave this window open and start a new CMD with administrative rights.
Step 3: Download Windows AIK from Microsoft (1.7 GB) and install it. You need this to get ImageX which we’ll need soon and you could use the WAIK to customize your installation but that’s beyond the scope of this post.
imagex /info dvddrive:sourcesinstall.wim (this will show you all the entries (or versions) available in the WIM-file, Hyper-V Server 2008 R2 has only one entry, index 1)
imagex /apply dvddrive:sourcesinstall.wim /check 1 vhddrive:
Step 5: Back to our diskpart-CMD
select vdisk file=driveletter:virtualharddisk.vhd
list volume (note the drive letter for the newly mounted VHD.)
bcdboot vhddrive:Windows /s usbdrive: /v (this copies the boot-files from your VHD’s Windows-directory to your USB-stick, which lets you boot later on)
When it’s finished, go back to the CMD with diskpart active and run
Now you can reboot your machine or test in another one with your USB-stick. Don’t forget to move USB to the top of the boot order since it’ll reboot a few times during installation (if you don’t wanna babysit it and press F9 / F12 / the any key)
If this approach doesn’t work you can always create a VHD, install Hyper-V Server 2008 R2 in Virtual PC / Virtual Server / Hyper-V / Virtualbox. When finished, log on and then run Sysprep with the generalize option. I’ve had some problems with certain hardware and it just freezes on the logon screen. This also happened when the VHD was expandable, but I haven’t investigated it further.
Questions? Ask in comments / send an email!