Running both Windows 7 and Windows 8 in a MacBook Pro

Last month I updated my main laptop MacBook Pro to Windows 8 and I’ve written about the experience here “Installing Windows 8 on MacBook Pro experience“.  There are no noticeable issues and I’m quite pleased with it. Even though technically all of the applications that run in Windows 7 should run on Windows 8, still there are scenarios where you need Windows 7. In my case, I need Microsoft BizTalk Server on my local machine to continue working on BizTalk360. BizTalk Server will be supported in Windows 8 only as part of BizTalk Server 2013 that’s coming next year.

What are the options?

There are basically 3 options I can think of

  1. Go back to Window 7, just wipe out everything and install Windows 7
  2. Use Hyper-V (comes as part of Windows 8), and create a virtual Window 7 PC
  3. Native boot to Windows 7 VHD file

Let’s analyse the pros and cons of each method.

The first method is very straight forward, you basically rebuild your MacBook Pro with Windows 7 and everything will work. The issue here is I’ll lose ability to work with Windows 8.

The second method is a also fairly straight forward. You log into Windows 8, type “Hyper-V Manager” and create a new Windows 7 virtual machine. The biggest problem with this approach is you cannot take full advantage of your hardware. Say for example you have 8GB RAM in your machine, you can only allocate may be 5GB max to the Windows 7 VM, since you need the host OS (Windows 8) to be still running.

The third option is basically you create a Hype-V Virtual machine, but instead of using it like a virtual machine, you boot natively into that machine. So technically you are virtualizing only your hard drive (using .VHD file) and taking advantage of all the hardware in the MacBook Pro. This is perfect, since majority of the time I can use Windows 8 and whenever I want to do something with Windows 7, I can do so without compromising much performance.

Creating Windows 7 VHD for Boot to VHD

If you search for “Boot to VHD” there are few good articles explaining about the process. I found this article “How to Create Windows 8 VHD for Boot to VHD using simple, easy to follow steps” really well written and just up to the point.  Basically you use this procedure if you don’t already have a Windows 7 VHD and you wanted to build one from scratch. In the article they used an utility called ImageX.exe from “Windows Automated Installation Kit“, which you need to download and install. Apart from that, everything is standard Windows stuff.

How to use existing Windows 7 VHD for Boot to VHD?

In lot of cases you may already have the Windows 7 VHD files and you don’t want to recreate one from scratch.  In this case, you simply need to tell Windows boot sequence to show the option to boot into that VHD file instead of your traditional hard drive. From Windows vista and above, you can setup the boot sequence using an utility called “Boot Configuration Data” (bcdedit.exe).  These are steps you follow to setup you VHD to show up in the boot sequence using bcdedit

bcdedit /copy {guid} /d “Windows 7 OS”
bcdedit /set {guid} device vhd=[D:]\Image.vhd
bcdedit /set {guid} osdevice vhd=[D:]\Image.vhd
bcdedit /set {guid} detecthal on

You can get the guid by using the following command and writing to a temp file

bcdedit /copy {current} /d “Windows 7″ > a.txt

Altering boot sequence is NOT something we do everyday and you really don’t want to mess around with your boot sequence. When I searched and found the above snippets, I really didn’t feel comfortable. After bit more search, I found this gem script from Dan Stolts, automating the whole thing.  You can download the script file here (AutoBootVHD-BCD.txt). Rename AutoBootVHD-BCD.txt to AutoBootVHD-BCD.cmd and copy it to the same folder where you have your Windows 7 VHD file and Run the following command

AutoBootVHD-BCD.cmd SKWIN7MACPRO.VHD “SKWIN7MACPRO Boot to VHD”

Of course you use your own .VHD file name and a description. The command executed without any issues as shown in the below screen shot

AutoBootVHD-BCD Boot To VHD script execution

Once the command is executed you can open “MSCONFIG.exe” and check the boot sequence.

MSCONFIG Boot Sequence

Now you can restart your machine and during the boot you’ll see the following options. Now I can either boot using the default Windows 8 or to my Windows 7 VHD directly.

Windows 8 or Windows 7 Boot sequence

About Saravana Kumar

Saravana Kumar is the Founder and CTO of BizTalk360, an enterprise software that acts as an all-in-one solution for better administration, operation, support and monitoring of Microsoft BizTalk Server environments.