jcoburn

Experienced as a Web Developer and Web Server administrator since 1994, in 1999 Jess set out to start a Web Hosting Provider that would leverage the latest in cutting edge and innovative technologies and make them available to businesses in a way that was easy to understand, easy to use and affordable. Today Applied Innovations is a recognized leader in Windows Hosting and specializes in ASP.NET, E-Commerce and Advanced Web Application Hosting.

Homepage: http://www.jesscoburn.com

Yahoo Messenger: tarzan


Posts by jcoburn

How to dual boot Windows 7 and Windows Server 2008 with a VHD

I have a new Dell M4400 laptop that I just got up and running with Windows 7 and thought “WOW! It would be great to boot this thing as Hyper-V server and just run the demos on there … but I have everything installed already!”  What to do? The solution turns out to be incredibly simple: Dual boot between Windows 7 and Windows Server 2008 R2 using boot from VHD.  At the end of the day the only drawbacks seem to be that I’ll lose the ability to hibernate when I’m booted off of VHD and I’ll see about a 3% overhead in disk performance so I took the plunge, I’m pretty pleased with it so I thought I’d share what it took to get up and running and my list of reference articles/sites.

Pre-Requisites

  1. You’ll need a machine that supports hardware virtualization with Windows 7 already installed and hardware virtualization enabled in the bios.
  2. You’ll need the install media for Windows Server 2008 R2. I recommend a USB stick and following my blog article: Installing Windows 2008 off a USB stick
  3. You’ll need to take your prom dress off and not be a little girl about it. You’ll likely not blow up your machine but in case you do you’ll be hard at work getting things back. I run windows home server at home for backup so I have no worries, those backups are rock solid!

The Process

The first thing you need to do is create a VHD to boot off of and make it available to the setup. Here’s the steps:

1. Start the Windows Server setup. When you get to the install screen (shown below) press Shift-F12:

This will bring up a dos prompt. You’re actually inside of a WinPE (Windows Preinstalled Environment) it’s from here we’re going to: Mount our drive on the Windows 7 install, connect to the volume, create a VHD on that drive, attach the VHD to the system before we continue the setup.

2. In this step we’ll create the VHD and and attach it to our system so the installer will see it.

  • From the DOS prompt enter DISKPART

X:\Sources>diskpart

 

  • List our drives in the system.

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  ——–  ————-  ——-  ——-  —  —
  Disk 0    Online          298 GB      0 B
  Disk 1    Online         3864 MB      0 B

  • Select the drive we’re going to create the VHD on.

DISKPART> select disk 0

Disk 0 is now the selected disk.

  • List our volumes before we create the VHD.

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ———-  —  ———–  —–  ———-  ——-  ———  ——–
  Volume 0     E                       DVD-ROM         0 B  No Media
  Volume 1     C   System Rese  NTFS   Partition    100 MB  Healthy
  Volume 2     D                NTFS   Partition    297 GB  Healthy
  Volume 3     F                FAT32  Removable   3863 MB  Healthy
  Volume 4                      FAT    Partition    172 MB  Healthy    Hidden

  • Create our VHD on the drive we have our Windows7 OS installed on.

DISKPART> create vdisk file=d:\vhds\windows2008.vhd MAXIMUM=50000 TYPE=EXPANDABLE

  100 percent completed

DiskPart successfully created the virtual disk file.

  • Select the VHD Disk

DISKPART> select vdisk file=d:\vhds\windows2008.vhd

DiskPart successfully selected the virtual disk file.

  • Attach the VHD Disk to the system

DISKPART> attach vdisk

  100 percent completed

DiskPart successfully attached the virtual disk file.

  • Create the Primary Partition on the VHD

DISKPART> cre part pri

DiskPart succeeded in creating the specified partition.

  • Format the new Partition (quickly thanks Alex)

DISKPART> format fs=ntfs quick

  100 percent completed

DiskPart successfully formatted the volume.

  • Assign a drive letter to the new Partition

DISKPART> assign letter=v:

DiskPart successfully assigned the drive letter or mount point.

  • Verify the Volume is there.

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ———-  —  ———–  —–  ———-  ——-  ———  ——–
  Volume 0     E                       DVD-ROM         0 B  No Media
  Volume 1     C   System Rese  NTFS   Partition    100 MB  Healthy
  Volume 2     D                NTFS   Partition    297 GB  Healthy
  Volume 3     F                FAT32  Removable   3863 MB  Healthy
  Volume 4                      FAT    Partition    172 MB  Healthy    Hidden
* Volume 5     V                NTFS   Partition     48 GB  Healthy

  • Exit DISKPART and DOS (type exit at both prompts) and continue the installation.

DISKPART>EXIT

X:\Sources>EXIT

3.  Now you’ll run the installer making sure to select your 50GB drive you created earlier and install the OS there. On my Dell M4400 it said that booting from the VHD wasn’t supported on my bios. I ignored it and the boot works anyway. Your mileage may vary.

After it’s installed

Okay you should have run through the installer now and yes it’s really just that easy.

Now in Windows 7 and Windows Server 2008 The OS creates a special boot partition that’s 100MB in size. There’s a boot configuration file there that gets automatically updated by doing this install procedure for you so when you’re booting your OS you’ll see the options on the screen.  I’m not going to include more information about that in this HOW-TO but will provide links to some of the great resources I referenced in my own learning process. 

The Cool Stuff

My favorite part of my blog (and why I blog) is The Cool Stuff!  Here’s the cool stuff:

  1. You’re able to automatically see your parent drive on the VHD machine. In my case it’s the D: drive.
  2. You’re able to mount a VHD within Windows 7 and see the content there as well.
  3. We used a Dynamic Disk which will expand automatically (it will not contract automatically) as needed up to the size of the disk we created it as.  Right now my 50GB VHD only uses 7GB of actual diskspace.
  4. We’re able to use Hyper-V now and create our new machines be it for labs or demos and get to use all the cool features of Hyper-V like snapshoting.
  5. All of my laptop’s hardware features are all directly available to the OS since we’re booting from a virtual Hard Drive not a virtual machine.

The Gotchas

This is the stuff I ran into that could pose a problem and how I addressed it.

  1. The installer said my Laptop BIOS didn’t support booting from VHD but I tried it anyway and it’s working fine. YMMV (Your Mileage May Vary)
  2. We’ll lose Hibernate when booted from the VHD and we’re not able to run the System Index Tool to see what kind of scores our computer gets (you can use other tools for that like SiSandra).
  3. When I first installed Windows Server 2008 I couldn’t see my wireless NIC. Turns out this is a feature you need to turn on in Windows Server 2008 which makes sense as I don’t know of any servers with a Wireless NIC.
  4. Once you enable your Wireless NIC, Hyper-V won’t be able to use it to create a virtual switch. But don’t worry there’s a few clever blog posts out there on how to do this using Internet Connection Sharing ;) .
  5. I saw a blog post about BitLocker and it not supporting the boot from VHD. I haven’t enabled bitlocker on the new laptop so I don’t know the impact that will have.

JessCoburn.Com running on ARR! and that not be Pirate speak thar Matey!

3 Blog posts to say “Hey I’m running on my site load balanced using ARR”. This is the third and hopefully last blog post for tonight.  I posted two other posts tonight:

  1. Discusses the first stage of Applied Innovations Cloud Initiative.
  2. Discusses ARR & Load balancing.

All of this was to explain how I’m running my website currently (which I tend to test everything on first so I break it a lot but you have to break eggs to make cake, right?).

ARR or Application Request Routing is a new extension to IIS7 that allows you to turn a Windows Server (or VPS as in my case) into an Application Aware Load Balancer with such features as offloading compression and SSL encryption!

How I’m running JessCoburn.com

For the past year and a half, JessCoburn.com has (and continues to) run on a shared web hosting server that runs IIS7 on top of Windows Server 2008. My site is treated identically to how my customers sites are treated as I firmly believe in eating your own dog food (no not ALPO but using the same services you sell). The site makes use of FastCGI to run the PHP engine and backends to a shared MySQL server. All of our shared web servers connect to the SQL servers via a private dedicated gigabit network for optimal performance. In addition, I make use of expiry headers for output caching of my images and also use the wordpress plugin supercache to reduce my reliance on MySQL queries so my pages render faster.  So that’s why it’s been fast, I think you’d agree that’s pretty well optimized for a Windows shared hosting website (same thing you could for as little as $8.33 a month with one of our Windows hosting accounts..  Sure it’s optimized but there’s still a problem.

What’s the problem with JessCoburn.com?

The problem is my web site runs on a single web server. This means if there’s maintenance on the box (don’t worry we do this during load traffic times) there’s still potentially downtime. This also means if my site ever gets popular enough to make the first page of DIGG or REDDIT (use those social bookmarks please) then no matter how much I optimize my site on that one web server, I could have a problem… These are the trade-offs we accept with shared hosting (today).

But what if, I could run JessCoburn.com on multiple web servers and load balance them? Yeah who’s going to go out and spend 20K to load balance his little wordpress blog (the profit margins aren’t that good you know).  Well thanks to our own cloud computing initiative and the good folks on the IIS Team at Microsoft I can do just that for peanuts! Today!

My new configuration

I have a Windows 2008 VPS running IIS7 with ARR 2.0 Beta 2 on it. It’s of course running on our High Availability Managed Windows VPS Hosting Cluster.  I also have JessCoburn.com still running on the shared Windows Hosting server running on IIS7 and I setup another VPS server running on top of Virtuozzo running Windows 2003 and copied the site there. Just to show that you can route requests to any kind of server.  Both servers back end to the same MySQL server.

All requests for JessCoburn.com come into the ARR server and it then proxies these requests between the Shared Server and the Win2003 VPS server.  In the event one of the sites crashes, is down or has problems, ARR will redirect all requests to the other server.