GetDotted Domains

Viewing Thread:
"Dual Booting - The Virtual Way with Win7"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Mon 18/05/09 at 01:42
Regular
"previously phuzzy."
Posts: 3,487
Have you ever considered dual booting your machine? Server and client, Linux and Windows? Up until recently, any kind of full dual boot required 2 or more bare metal installations - a time consuming and laborious task. However, one of the new features to come out of the various Windows 7 pre-releases has brought along a cool new feature that I've been spending the whole weekend playing on my new rig (credit card = happy days!).

Before we start, and FAQs
------------------------------

Who is this article for?
- Those who wish to dual boot copies of Window 7, copies of Windows Server 2008 R2, or a mix of the 2.
- Those with administrator privileges on their machine and are fairly confident using the Computer Management console and command line

Who is this article NOT for?
- Those who wish to dual boot copies of any other OSes, Windows or otherwise (this technology is currently limited to Windows 7 & Windows Server 2008 R2)

Why not use Virtual PC?
Because native VHD allows full use of all hardware that any bare metal installation can use. Virtual PC is limited to a basic graphics card, CPU, motherboard etc

Things You'll Need
- a machine with Windows 7 installed (RC link below)
- a disc or disc image of at least Windows 7 (RC download here) or Server 2008 R2 (beta download here), or both
- the ImageX utility (downloadable here

Terminology used
VHD: Virtual hard disc: A file which is actually a simulated hard drive
VM: Virtual machine: A computer that is running on simulated hardware on top of a host operating system

The Process

PLEASE READ: The forums here don't like the backslash character, as it can be used on web forms such as this to muck things up. So alot of the paths for the command line are missing the backslashes where appropriate. View the screenshots or the this Word document to see where to 'slash :)
--------------------------------

Part 1 - Creating, formatting and attaching a native VHD file
--------------------------------

In this section: The first steps you need to take are all about creating a native VHD file that can be used as bootable OS.

1: Open up the Computer Management console by searching for 'Computer Management' in the start menu Search box.
2: Right click 'Disk Management' under 'Storage' in the left-side menu, selecting 'Create VHD'
3: Specify a location to save the VHD and a size. I'd recommend at least 20480Mb (~20Gb) for any meaningful OS
4: Choose 'Fixed Size' for stability.
5: Computer Management will then begin creating the VHD. Get yourself a cuppa and stick on Deal or No Deal...
6: Once complete, you should have something like this image (JPEG). Depending on the number of drives you have, it'll be 'Disk ', with a small light-blue drive icon, and status will be 'Not Initialized'
7: Right click 'Disk ', where the blue drive icon is, and select 'Initialize Disk'
8: Select 'Disk 1', and ''MBR' as the partition style
9: Your 'Disk ' will now be 'Online' where it was previously 'Not Initialized'
10: Now right click on the striped rectangle block thing in Disk Management representing your disk, and select 'New Simple Volume'
11: This will take you through the 'New Simple Volume Wizard' - leave the volume size as it is, assign whatever drive letter you like best (I used 'Y' for simplicity, and will assume you do to for this tutorial), and then format with the default values, except 'Volume Label' - change this to something meaningful (e.g. 'Windows 7 Virtual'). Finally, hit 'Finish'
12: You should see Autoplay pop up, and tell you you've got a new drive! Screenshots are this image (JPEG) and this image (JPEG).
13: You now have a virtual drive on your system! You can use this as a separate partition if you fancy, leaving it as is. You could do this to your HDD's limit. Or, you can carry on and get a dual boot :)

Pitfalls, Gotchas and Tips
- If you want to get rid of the VHD, go back to 'Disk Management', right click on the 'Disk 1' box with the blue icon, and click 'Detach VHD'. You can either detach it and keep the file for later, or detach and check the 'Delete' box. This will also remove the VHD from your computer

So now you have a mounted VHD on your computer. What next?

Part 2 - Getting an OS onto the VHD
--------------------------

In this section: We will apply the .wim file, with all the Windows files, onto our VHD

1: First, we need that disc or disc image of Windows 7 or Server 2008 R2.
1a: If you have a physical disc, right click on it in 'Computer' and select 'Open' (DO NOT RUN!)
1b: If you only have the image (the .iso file), you'll need a utility like DAEMON TOOLS to mount the image on a virtual drive, and then follow the instructions below

An aside: The .wim file you're looking for is a new file format to enable multiple different types of operating system that all share a bunch of common files to be packed together in one file. So, Windows 7, when it ships, will have all 4 version on one DVD. Depending on how you setup the .wim file, you'll get a different install. So, we need this .wim file to continue

- For Windows 7 RC and Server 08 R2 Beta, it's located in '<your CD drive letter>:sourcesinstall.wim'


2: Copy this file to your local drive - I'd recommend the same directory that you're storing all your VHD files in.
3: Extract and run the ImageX utility you've downloaded. This is part of the WAIK - Windows Automated Installation Kit. However, the full WAIK is about 1.4Gb. All you need is the tiny ImageX utility. So some nice soul extracted that little bit, and hosted it here. The full, free WAIK is available at microsoft.com
4: Open up an Administrator command prompt, and navigate to the directory where ImageX is located
5: The first bit of info is the version we're wanting to pull from the WIM file. Enterprise? Home Premium? Ultimate? They're all there. You just need to know where. In ImageX, type:

imagex.exe /info <path to wim file>install.wim

where is the path to the WIM file on your machine. So for my installation:

imagex.exe /info C:VHDinstall.wim

or see this image (JPEG).

This will bring up a big list, starting something like this image (JPEG). Note the highlighted and circled sections - these are important. I'm wanting the 'Ultimate' edition, so I scroll down till I find it.

Ultimate edition pic (JPEG).

6: Take note of the '' attribute. You'll need this. For me, it's '4'.
7: Back at the command line, type the following command:

imagex.exe /apply <path to wim>install.wim <image index from before> Y:

So, again, for me:

imagex.exe /apply C:VHDinstall.wim 4 Y:

or see this image (JPEG).

8: You're done when the message 'Successfully applied image' appears :) Congratulations, you've got a bootable native VHD with Windows on it! Now to tell the computer that...

Pitfalls, Gotchas and Tips
- Pick the right image index number! From the RC WIM file, '4' is Ultimate, '3' is Professional, '2' is Home Premium..
- You can check 'Computer' and you'll see your volume with a Windows install on it. Yay!

So now you have a mounted VHD on your computer. What next?

Part 3 - Telling the Boot Manager what a great job you've done
---------------------

In this section: We will tell the OS what it needs to know in order to recognise your VHD file as a bootable drive, using the builtin 'bcdedit' tool

1: Load up a command prompt with Admin priviliges, and type:

bcdedit /copy {current} /d "<a description of your VHD>"

Make sure you actually type '{current}' there - it's not a thing for you to fill in - I made this mistake... For me?

bcdedit /copy {current} /d "Windows 7 - Virtual"

2: Do this right, and you'll get a message - "The entry was successfully copied to ". WRITE DOWN or COPY this long bunch of letters and numbers, cos you're about to need it. This is called the GUID.
3: Type:

bcdedit /set <your GUID> device vhd=[<drive>:]pathtovhd<vhdName>.vhd

where you've to fill in your GUID (from above), your drive letter, and the path and name of your VHD. So for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} device vhd=[C:]VHDwin7.vhd

4: Next, type:

bcdedit /set <your GUID> osdevice vhd=[<drive>:]pathtovhd<vhdName>.vhd

And for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} osdevice vhd=[C:]VHDwin7.vhd

5: Finally, type:

bcdedit /set <your GUID> detecthal on

And again for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} detecthal on

AFTER EACH of these bcdedit commands, you should see 'The operation completed successfully'. If you see anything else, chances are you've type the GUID in incorrectly (as I did), or got the path to the VHD wrong. Always triple check!

The final cmd window should look like this image (JPEG).

6: Hey presto! You're done. You can verify this has all gone to plan either by looking at the 'Boot' options in the Startup Configuration dialog (command line: just type 'msconfig' then Enter), where'll you'll see the physical Windows Installation, and your virtual one(s)

How do you then boot into your VM? Restart your PC, and select your VM when presented at the boot menu on startup :) Bingo, a native VHD VM.

I'm no technical writer, and appreciate that's been a bit of a fly-through, so happy to take any questions or comments on anything here!

Cheers,

phuzzy
There have been no replies to this thread yet.
Mon 18/05/09 at 01:42
Regular
"previously phuzzy."
Posts: 3,487
Have you ever considered dual booting your machine? Server and client, Linux and Windows? Up until recently, any kind of full dual boot required 2 or more bare metal installations - a time consuming and laborious task. However, one of the new features to come out of the various Windows 7 pre-releases has brought along a cool new feature that I've been spending the whole weekend playing on my new rig (credit card = happy days!).

Before we start, and FAQs
------------------------------

Who is this article for?
- Those who wish to dual boot copies of Window 7, copies of Windows Server 2008 R2, or a mix of the 2.
- Those with administrator privileges on their machine and are fairly confident using the Computer Management console and command line

Who is this article NOT for?
- Those who wish to dual boot copies of any other OSes, Windows or otherwise (this technology is currently limited to Windows 7 & Windows Server 2008 R2)

Why not use Virtual PC?
Because native VHD allows full use of all hardware that any bare metal installation can use. Virtual PC is limited to a basic graphics card, CPU, motherboard etc

Things You'll Need
- a machine with Windows 7 installed (RC link below)
- a disc or disc image of at least Windows 7 (RC download here) or Server 2008 R2 (beta download here), or both
- the ImageX utility (downloadable here

Terminology used
VHD: Virtual hard disc: A file which is actually a simulated hard drive
VM: Virtual machine: A computer that is running on simulated hardware on top of a host operating system

The Process

PLEASE READ: The forums here don't like the backslash character, as it can be used on web forms such as this to muck things up. So alot of the paths for the command line are missing the backslashes where appropriate. View the screenshots or the this Word document to see where to 'slash :)
--------------------------------

Part 1 - Creating, formatting and attaching a native VHD file
--------------------------------

In this section: The first steps you need to take are all about creating a native VHD file that can be used as bootable OS.

1: Open up the Computer Management console by searching for 'Computer Management' in the start menu Search box.
2: Right click 'Disk Management' under 'Storage' in the left-side menu, selecting 'Create VHD'
3: Specify a location to save the VHD and a size. I'd recommend at least 20480Mb (~20Gb) for any meaningful OS
4: Choose 'Fixed Size' for stability.
5: Computer Management will then begin creating the VHD. Get yourself a cuppa and stick on Deal or No Deal...
6: Once complete, you should have something like this image (JPEG). Depending on the number of drives you have, it'll be 'Disk ', with a small light-blue drive icon, and status will be 'Not Initialized'
7: Right click 'Disk ', where the blue drive icon is, and select 'Initialize Disk'
8: Select 'Disk 1', and ''MBR' as the partition style
9: Your 'Disk ' will now be 'Online' where it was previously 'Not Initialized'
10: Now right click on the striped rectangle block thing in Disk Management representing your disk, and select 'New Simple Volume'
11: This will take you through the 'New Simple Volume Wizard' - leave the volume size as it is, assign whatever drive letter you like best (I used 'Y' for simplicity, and will assume you do to for this tutorial), and then format with the default values, except 'Volume Label' - change this to something meaningful (e.g. 'Windows 7 Virtual'). Finally, hit 'Finish'
12: You should see Autoplay pop up, and tell you you've got a new drive! Screenshots are this image (JPEG) and this image (JPEG).
13: You now have a virtual drive on your system! You can use this as a separate partition if you fancy, leaving it as is. You could do this to your HDD's limit. Or, you can carry on and get a dual boot :)

Pitfalls, Gotchas and Tips
- If you want to get rid of the VHD, go back to 'Disk Management', right click on the 'Disk 1' box with the blue icon, and click 'Detach VHD'. You can either detach it and keep the file for later, or detach and check the 'Delete' box. This will also remove the VHD from your computer

So now you have a mounted VHD on your computer. What next?

Part 2 - Getting an OS onto the VHD
--------------------------

In this section: We will apply the .wim file, with all the Windows files, onto our VHD

1: First, we need that disc or disc image of Windows 7 or Server 2008 R2.
1a: If you have a physical disc, right click on it in 'Computer' and select 'Open' (DO NOT RUN!)
1b: If you only have the image (the .iso file), you'll need a utility like DAEMON TOOLS to mount the image on a virtual drive, and then follow the instructions below

An aside: The .wim file you're looking for is a new file format to enable multiple different types of operating system that all share a bunch of common files to be packed together in one file. So, Windows 7, when it ships, will have all 4 version on one DVD. Depending on how you setup the .wim file, you'll get a different install. So, we need this .wim file to continue

- For Windows 7 RC and Server 08 R2 Beta, it's located in '<your CD drive letter>:sourcesinstall.wim'


2: Copy this file to your local drive - I'd recommend the same directory that you're storing all your VHD files in.
3: Extract and run the ImageX utility you've downloaded. This is part of the WAIK - Windows Automated Installation Kit. However, the full WAIK is about 1.4Gb. All you need is the tiny ImageX utility. So some nice soul extracted that little bit, and hosted it here. The full, free WAIK is available at microsoft.com
4: Open up an Administrator command prompt, and navigate to the directory where ImageX is located
5: The first bit of info is the version we're wanting to pull from the WIM file. Enterprise? Home Premium? Ultimate? They're all there. You just need to know where. In ImageX, type:

imagex.exe /info <path to wim file>install.wim

where is the path to the WIM file on your machine. So for my installation:

imagex.exe /info C:VHDinstall.wim

or see this image (JPEG).

This will bring up a big list, starting something like this image (JPEG). Note the highlighted and circled sections - these are important. I'm wanting the 'Ultimate' edition, so I scroll down till I find it.

Ultimate edition pic (JPEG).

6: Take note of the '' attribute. You'll need this. For me, it's '4'.
7: Back at the command line, type the following command:

imagex.exe /apply <path to wim>install.wim <image index from before> Y:

So, again, for me:

imagex.exe /apply C:VHDinstall.wim 4 Y:

or see this image (JPEG).

8: You're done when the message 'Successfully applied image' appears :) Congratulations, you've got a bootable native VHD with Windows on it! Now to tell the computer that...

Pitfalls, Gotchas and Tips
- Pick the right image index number! From the RC WIM file, '4' is Ultimate, '3' is Professional, '2' is Home Premium..
- You can check 'Computer' and you'll see your volume with a Windows install on it. Yay!

So now you have a mounted VHD on your computer. What next?

Part 3 - Telling the Boot Manager what a great job you've done
---------------------

In this section: We will tell the OS what it needs to know in order to recognise your VHD file as a bootable drive, using the builtin 'bcdedit' tool

1: Load up a command prompt with Admin priviliges, and type:

bcdedit /copy {current} /d "<a description of your VHD>"

Make sure you actually type '{current}' there - it's not a thing for you to fill in - I made this mistake... For me?

bcdedit /copy {current} /d "Windows 7 - Virtual"

2: Do this right, and you'll get a message - "The entry was successfully copied to ". WRITE DOWN or COPY this long bunch of letters and numbers, cos you're about to need it. This is called the GUID.
3: Type:

bcdedit /set <your GUID> device vhd=[<drive>:]pathtovhd<vhdName>.vhd

where you've to fill in your GUID (from above), your drive letter, and the path and name of your VHD. So for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} device vhd=[C:]VHDwin7.vhd

4: Next, type:

bcdedit /set <your GUID> osdevice vhd=[<drive>:]pathtovhd<vhdName>.vhd

And for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} osdevice vhd=[C:]VHDwin7.vhd

5: Finally, type:

bcdedit /set <your GUID> detecthal on

And again for me:

bcdedit /set {ABCDEF02-01A2-03B2-E4F2-ABCDEF0123456} detecthal on

AFTER EACH of these bcdedit commands, you should see 'The operation completed successfully'. If you see anything else, chances are you've type the GUID in incorrectly (as I did), or got the path to the VHD wrong. Always triple check!

The final cmd window should look like this image (JPEG).

6: Hey presto! You're done. You can verify this has all gone to plan either by looking at the 'Boot' options in the Startup Configuration dialog (command line: just type 'msconfig' then Enter), where'll you'll see the physical Windows Installation, and your virtual one(s)

How do you then boot into your VM? Restart your PC, and select your VM when presented at the boot menu on startup :) Bingo, a native VHD VM.

I'm no technical writer, and appreciate that's been a bit of a fly-through, so happy to take any questions or comments on anything here!

Cheers,

phuzzy

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Many thanks!
You were 100% right - great support!
I am delighted.
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do. I am delighted.

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.