Jump to content

Boot Windows 7 from VHD - an amazing concept


Recommended Posts

Posted (edited)

1. Install Windows 7 to VHD from DVD

-----------------------------------------------------

With Windows 7, you now have the option to boot the OS from a VHD, a virtual disk file, instead of a partition. This way, you don't have to reconfigure your hard drive partitions.

Limitations: Hibernate is not supported.

Here are the simplified instructions:

1) Start Windows 7 installation from DVD.

2) Press Shift+F10 to start the command prompt.

3) Start diskpart.

4) Use the "create vdisk file=D:\Win7.vhd maximum=xxxxx" to create a virtual hard disk. Choose your drive and filename accordingly. xxxxx is in MB.

5) Type "select vdisk file=D:\Win7.vhd".

6) Type "attach vdisk". You will get a confirmation that it was attached.

7) Type "exit" to exit diskpart. And then close the command prompt.

8) Click on "Install Now" and install as you would normally by clicking on "Custom Install". Choose your attached vdisk as the location.

The installation takes care of adding the boot option to bcd. You don't have to do anything.

See Virtual Hard Disk Booting on a tutorial for VHD booting.

also check this out: Install Windows 7 to a VHD and add boot option to Vista's menu.

Basically, instead of installing windows 7 to your physical HDD by getting rid of Vista or even dual booting off another partition, you can install to a virtual HDD (in VHD format), and boot off the VHD so you actually get the hardware functionality to play with!!

Build 7068 does not allow calculation of the WEI score.

2. Install Existing VHD to Boot Menu of Windows 7

-------------------------------------------------------------------

If you already have a VHD that you want to boot from, you can simply add it to the boot menu rather than going through the above steps. If you have a Virtual PC image, for example, you can syprep it, then add it to Windows 7 menu. Vista's boot manager will not work - you have to update it to Windows 7 boot manager if you want this to work.

First, here how to add the vhd to the boot menu:

Open elevated command prompt, then type the following commands in sequence:

C:\>bcdedit /copy {current} /d "My New VHD Description"
C:\>bcdedit /set <guid> device vhd=[driveletter:]\<directory>\<vhd filename>
C:\>bcdedit /set <guid> osdevice vhd=[driverletter:]\<directory>\<vhd filename>
C:\>bcdedit /set <guid> detecthal on

Note: The first command will Return the GUID of the Loader Object that you will use to replace <guid> below

Note: vhd=[driveletter:]\<directory>\<vhd filename> is the new syntax supported for BCDEdit.exe to locate VHD File and Bootmgr will locate the partition containing the VHD File to boot from.

Type bcdedit /v to check the bcd store.

3. How to Boot VHD without Windows 7 Installed

-----------------------------------------------------------------

If you have Vista and want to boot a Window 7 VHD, then you need to copy the boot manager of Windows 7 to Vista's partition. You need to copy C:\bootmgr and C:\windows\system32\bcdedit.exe to an external source from Windows 7. You could extract these files from the Windows 7 VHD using WinImage or another program.

Then, open an elevated command prompt in Vista and unhide bootmgr (attrib -h -r -s bootmgr) and replace it with Windows 7's. Do same for bcdedit. You might consider making backup copies of these files before replacing them.

Then, add the VHD item to the boot menu using #2 above.

4. How to Remove

-------------------------

To remove, run the following command in a elevated command prompt:

bcdedit /delete {guid} /cleanup

Delete the vhd file.

Edited by spacesurfer

Posted

spacesurfer, That's great! I am going to try this as well. Do you find it significantly slower or do you experience normal speeds when using Windows 7 this way? Is it good enough to watch movies etc?

Posted (edited)

I haven't tried it yet. I'm going to do that today. I had two similar questions:

1) Does booting and running from VHD take a performance hit?

2) Do you have all your other partitions and HDD's available for read-write operation?

I'll find out today! Installing right now as I speak.

Edited by spacesurfer
Posted

So for the uninitiated, this is something like using a VM...like Virtualbox and running the OS in it except you dont need to use a VM like Virtualbox?

Posted
So for the uninitiated, this is something like using a VM...like Virtualbox and running the OS in it except you dont need to use a VM like Virtualbox?

YES! Exactly.

So, I'm using Windows 7 beta build 7000 right now and typing this from it currently. I followed the instructions exactly.

Prior to install, my setup was C: = Vista SP1 on 12 GB partition and D: = Storage 25 GB partition.

During install, I created a VHD on D: 6.66 GB. I used a vLited Windows 7 ultimate. The installation process is automatic. It automatically creates a boot entry to boot from VHD.

After install, I HAD ACCESS TO MY STORAGE PARTITION (D:) - GREAT!!! My Vista partition is not assigned a drive letter but I can see it in Drive Management. I don't particularly need it though.

Performance-wise - I see no performance hit as yet. I'm using firefox 3.0.6 to type this and I'm installing Comodo Firewall right now.

Posted

Yes i would imagine a performance hit is to be expected with this as it works by using a driver that understands the NTFS filesystem and VHD format, it will locate the VHD file on the physical NTFS volume then open that up, and boot windows reading its the NTFS structure from the VHD file.

Posted
I'd hardly call this an amazing concept, since Linux, BeOS and QNX were doing this a decade ago.

Don't be crazy, they were not. QNX is the only OS to have something similar, and it's not the same. We're not talking about a kernel image, or running a kernel image off of a non-native filesystem - this is an entire "volume" inside a VHD, that is bootable from another OS natively without a Virtual machine. It's not quite the same - and also, we're talking about Windows here, not a fringe OS - this brings virtual disk booting to the masses (well, once Win7 releases).

Posted
Yes i would imagine a performance hit is to be expected with this as it works by using a driver that understands the NTFS filesystem and VHD format, it will locate the VHD file on the physical NTFS volume then open that up, and boot windows reading its the NTFS structure from the VHD file.

No performance hit noted by me yet.

So far, certain things are faster than Vista SP1, such as opening Network and Sharing Center. Boot time is faster or same as Vista.

Only issues are the bugs that are typical of a beta. Otherwise, I can live off of Windows 7!

Posted
Don't be crazy, they were not. QNX is the only OS to have something similar, and it's not the same. We're not talking about a kernel image, or running a kernel image off of a non-native filesystem - this is an entire "volume" inside a VHD, that is bootable from another OS natively without a Virtual machine. It's not quite the same - and also, we're talking about Windows here, not a fringe OS - this brings virtual disk booting to the masses (well, once Win7 releases).

QNX, Mandrake Linux and BeOS all had an ""entire "volume" inside a VHD, that is bootable from another OS natively without a Virtual machine". I know what I'm talking about.

Posted

I'm not talking about a Live CD here, or firing up Qemu for a VM to run Linux from inside Windows (VHD boot is *not* a virtual machine) - what are you speaking of, and where's the documentation? I cannot find any, nor do I remember ever finding this in BeOS, specifically, either. I'd like to see some documentation if I'm wrong.

Posted

Spacesurfer, this is awesome.

Are the vdisk files dynamic in size, or can you set them to be one huge size initially to avoid fragmentation?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...