Hyper-V virtualization in a flash, drive that is – Part 1

• February 12, 2010

Warning: Illegal string offset 'video_embed' in /home/hssp9874/public_html/wp-content/themes/wp-inspired_basic/single.php on line 36

We’ve been talking about virtualization on the podcast, but how can you really give this a try?  Over the next few articles I’ll try to lay out how you can take several free virtualization tools available and turn them into exciting platforms for WHS and other systems.  In these write-ups I’ll go through how to set up host based virtualization for both VMWare Server and Virtual PC on a pre-existing Windows 7 installation, as well as show you how to create bootable USB drives containing bare metal hypervisors for Hyper-V Server 2008 R2 and ESXi 4.0.  Below is a brief overview of what each can offer:

  • VMWare Server 2 and Virtual PC 2007 (XP Mode)– These virtualization software packages are installed on top of an existing host OS, and can allow you to easily create and manage virtual machines.  They do not require any dedicated hardware, and you can turn on and off the systems easily, as well as configure them from only 1 PC.  This is the easiest way to get virtualization up and running for a simple test system without any additional computers needed.  An example for how this could be used is that you have a mediasmart WHS already, and want to test some add-ins before you put them on your “production” box.  You could setup a test VM with the free WHS trial, and see how the add-in performs before you decide if it’s ready for prime time or not.
  • Hyper-V Server 2008 R2 and ESXi 4.0 – These baremetal virtualization platforms are installed and run directly on the PC’s hardware.  They are the boot drive for the PC they are connected to, and require that the attached PC is dedicated to running virtualization systems when in use.  A second PC is used to manage and interact with the virtual machines running on the main virtualization PC.  These systems are designed to run headless, meaning no monitor/keyboard attached after initial configuration and all management is performed from a separate PC.  This is a more advanced setup for virtualization, is designed for an always on virtualization environment, and is more efficient when running multiple virtualized systems at one time.  Some examples for how this could be used is you have an OEM license for WHS and you create your production WHS in a VM.  You can also have running on the same machine any other system you would like such as a Windows 7 install running Media Center, a Ubuntu Linux OS for testing, an old XP installation, or even a router or security appliance.  On one of my main VM systems I have WHS, Server 2008, PFSense router, Untangle UTM, jeOS Ubuntu webserver, and a pound reverse web proxy all running.  It can be as advanced or basic as you like!

Different listeners and readers will want to take advantage of host based, baremetal based, or both of the types of virtualization as they give you different features and advantages.  In the first write-up, I’ll go through how to set up a USB based Hyper-V Server 2008 R2 system.  For the more cautious of our readers out there, don’t fear if this seems too much and you’re only looking for a simple host-based platform for virtualization.  A write-up for that is coming soon!

Alright, let’s set up Microsoft’s Hyper-V Server R2, and we’re going to do it on a USB drive.  This is Microsoft’s bare metal type 1 hypervisor from MS’s Server 2008 R2 platform.  The hypervisor can be installed by itself (for free), or as a role with a purchased Server 2008 R2 installation.  This is a very powerful virtualization platform on top of which you can run/develop/design anything from simple to very complex virtualization environments.  For the enthusiast market, we lucked out that MS is letting us use this for free because we can take the virtualization capabilities that the big enterprises use and put them to work for our own benefit.  Once we create our Hyper-V USB drive it can be used to turn your computer into a virtualization server that can run any virtualized system you like.

You might be wondering why a USB drive?  Well, they’re cheap, (about $20 for the 8gb one used in this demo), they don’t use much power, the hypervisor isn’t competing for any of our hard drive space and I/O, and also they’re easy to remove!  That way you can try this out on a computer, boot off of your USB, and then change back to your normal system if you like.  In fact, most enterprise systems (read big business virtualization) are implementing their hypervisors on flash memory going forward as well.  What we’re putting together today can be used permanently (i.e. you always have this computer running hyper-v and your VM’s on top of it), or just to try it out and see if this is something you’d like to do going forward and maybe make your next hardware purchase to support some type of virtualization.

So what ingredients will we need to make this happen?

  • 2 computers you can access, one w/ Windows 7 used to set up the flash drive (Vista doesn’t support VHD’s which this process uses)
    • 1 to use as your virtualization system w/ the USB drive, and another to setup for the management.  The virtualization system’s CPU needs to support virtualization (either VT-x for Intel, or AMD-V for you guessed it, AMD.)
  • 1 USB drive, at least 8GB size
    • Note, if your USB drive comes with some embedded software it can be a problem as the computer detects a USB drive, and a CD drive sometimes.  In one of my installs, I used a SanDisk USB drive that had U3 software on it causing problems.  A format of the drive doesn’t get rid of it, you need to download the removal tool from their website if the removal tool isn’t included with the USB drive.
  • 3 free downloads

Once you have downloaded all 3 of those files, our first step is to install the Window AIK.  Find the KB3AIK_EN.iso file and either burn it to a DVD and install, or extract/mount the ISO and install it.  We’re going to want the Windows AIK Setup from the screen below.  You can change the install location, and if you do you’ll see an additional prompt later on but it’s not a problem.

Windows AIK

Now, fire up the BootFromUSB-HVSR2 executable. (This requires MS .NET 3.5 if you get an error)

BootFromUSB-HVSR2

Once you hit OK, if you either ran this before installing the AIK or you installed the AIK in a different location than the default you’ll see the below screen.  No worries, the tool will give you the option to browse to the new directory for AIK in step 0.  Select OK if you see it, and you’ll be caught up with the rest of us.

BootFromUSB-HVSR2.2

You’re now at the main screen of the tool.  Since we installed AIK already, step 0 is done.  In step 1, select the disk number from the drop-down list we want to install Hyper-V on.  Make sure your USB drive is in your computer and select it from the drop-down list.  A word of warning, whichever disk you select will get formatted, so double check you have the right one, or even go into Disk Management and confirm your disk selection is the right one!  It won’t show up as a full 8GB, mine was 7664 mb when formatted.

Tool1

With the USB disk selected, it’s on to step 2 where the tool will build the blank Virtual Hard Drive (VHD) that it will then install Hyper-V on.  Click the Create Blank VHD button, and select where you want the blank VHD to be created on your computer prior to the tool copying it over to the USB drive.  It can be deleted once we’re all done.

The last step before we’re done is step 3, selecting the install.wim file from the Hyper-V installation.  We need to either burn the GRMHVxFRE1_DVD.iso Hyper-V download to a DVD or extract/mount it so we can select the install.wim file that’s currently in the ISO.  I extracted it, and you need to browse to the Sources folder in the ISO and select the INSTALL.WIM file.

install.wim

That should just about do it, your screen should look similar to the one below.  Now click start, sit back, and watch.  You’ll see a few screens pop up while the tool is working its magic.

Untitled

And we’re off!

diskpart

Applying the Hyper-V install to the VHD

applying

Copying the VHD from your HDD to the USB drive

copying

And we’re done!

Done

A quick look in the USB drive and sure enough, there’s the VHD and the files to make the USB drive bootable.

USB Drive Contents

At this point we’ve created our bootable USB drive with Hyper-V Server on it, congratulations!  Look for part 2 to show how to configure the Hyper-V server, the management console from your 2nd computer, and how to set up our test WHS VM.

by: Tom Sydow(wodysweb)

Share

Tags: , , ,

Category: Software, Virtualization, Windows Home Server

Comments (8)

Trackback URL | Comments RSS Feed

  1. fasthair says:

    Wodysweb,

    Nice "introduction to VMs" post. As you know I've been playing with VMware since you've last podcast after a few years of being away from VMs. I've got three VMs, Win 7, Vail, WHS v1 and working on converting images stored on my production WHS to VMS to further play with Vail. I tried converting a Vista image last night but it failed but I see where screwed up :) Actually I've got a lot of ideas. How well they all play out is another story.

    This Hyper-V looks interesting but I don't really have two PCs I can dedicate to it's use. Somehow I don't think my netbook would be a good machine to control the Hyper-V from :) It is possible to just use the "desktop" of Hyper-V install and control/use the VMs using it? Or is this a bad idea or not work?

    I might be getting ahead of you here and I don't want to spoil the next post. But I'm guessing you boot from the USB drive you just made and install the VMs on the HDDs in the box that Hyper-V is running on via USB. I ASSume you can also install Hyper-V to the HDDs in the box too. But I'll wait for the next post to explain all of this.

    I can see I'm going to have to go buy a 8gig USB drive this weekend and play around. If nothing else just boot the USB drive and see what Hyper-V is all about. I've got a couple of spare HHDs doing nothing so why not!

    One thing I would like to see in up coming posts is what you think it takes hardware wise for a nice VM host and bare metal machine.

    fasthair

  2. fasthair says:

    Oh sure just go buy a 20$ USB drive… 212$ later and my WHS has another TB of storage and a cool HDD docking station. Thanks a lot pal :)

    fasthair

  3. wodysweb says:

    Hi Fasthair, no you can’t use the desktop of your Hyper-V server to manage or interact with your virtual machines as it is meant to be a headless machine after you do the initial install, i.e. no interaction just like a server sitting in a server room. You can use any other PC to do the VM management it doesn’t have to be netbook like I described in the post. It could be your main desktop if you have a separate virtualization server by itself.

    Yes, I probably should clarify that you most definitely can install Hyper-V on a hard drive as well, I just like this way better in that it frees up your HDD’s totally for your VM’s.

    I’ll work on a post regarding hardware sizing, the thing is it all depends on what you’re trying to accomplish as well as one person’s “acceptable” performance levels are always in line with others but a general comparison is doable.

    Glad to see I was able to help speed up your hardware purchases!

  4. EDR says:

    Thank you for the informative and interesting articles. I now have a very good handle on how bare metal virtualization works. This is tempting for starting up your own home build. I could see setting up an OEM WHS as your working server and then installing a different OS with physically different drives which would allow you to backup your WHS. It would be nice to also install a test WHS without any additional hardware.

    Just before WHS came out in beta I setup a FreeNAS server (which I still have running). Then I bought a Norco 530 and installed OEM WHS and when the EX 495 came out I bought one of those to back up my Mac. Virtualization allows me to explore new server without dedicating more hardware.

    I look forward to your next articles.

    Thanks,

    Ed R

  5. wodysweb says:

    Hi Ed R, glad you liked the article. Sounds like you have some good use cases for a virtualization server already ironed out. That's what is nice about a baremetal server, you can add whole new systems w/o a lot if any extra expense. Keep us updated if you start to experiment!

  6. Bennon says:

    I have this issue with both W2K8R2 and 2012-Hyper V. The process completes okay to copying then 'hangs' at 'Waiting to VHD to mount'…
    What am i missing here??

  7. alex says:

    It is working with 2008 server, but how to do in window 203 R2 OS.

  8. Braintichy says:

    It's very usefull blog

×

Shop and help out Home Server Show. Drag this box to your BookMarks Bar. Amazon