SEARCH

How-To Geek

How to Dual Boot Windows 7 and 8 Without Re-Partitioning (Using VHD)

We’ve already shown you the classic method of dual booting Windows 8, but that requires tweaking your partitions. If that’s something you’re not ready for, here’s how to use a virtual hard drive (VHD) to boot Windows 8 on your Windows 7 PC.

There’s a lot of different methods to do this, and we’re just going to show you the most user friendly method, using the GUI to create a blank VHD, a PowerShell script to expand the .WIM image file so we can install.

Creating The VHD

To create the VHD, go to a run prompt by pressing Win+R, and type diskmgmt.msc.

sshot-1

An MMC console will appear, and will have the Disk Management snap-in pre-loaded.

sshot-2

To create a new VHD, click on the action button in the menu  bar, and select Create VHD.

sshot-3

Now you need to choose a location for the VHD file and set the size, which should be no less than 20 GB. You should probably choose a fixed size for best performance.

sshot-1

Windows will then create the VHD, the progress of this can be viewed in the Status Bar of the MMC snap-in.

sshot-4

Once the disk is created it will be in the list of partitions in the Disk Management console. You’ll want to initialize the disk by clicking on it and selecting initialize.

sshot-1

Leave the partition style at MBR(Master Boot Record) and click ok.

sshot-1

Once the disk has been given a partition style, we now need to create an actual volume on the partition. To do this right click on the black space and select “New Simple Volume”.

sshot-5

A wizard will open, you can just accept all the defaults until you get to this screen. Here change the Volume label to “Windows 8”, then click next and finish.

sshot-1

Now you have a new VHD file that is acting like a real hard drive.

sshot-1

sshot-1

Installing Windows 8 On The VHD

The first thing you need to do is open PowerShell as an administrator by opening Start Menu->All Programs->Accessories->Windows Powershell, right-clicking on the Windows PowerShell shortcut, and choosing Run as Administrator.

sshot-1

When PowerShell launches you will need to change the execution policy to allow you to run scripts. To do this, you need to type “Set-ExecutionPolicy RemoteSigned”. You will be given a security notice just type “Y” and press enter to accept. Once you have done this, leave the PowerShell window open as we will be using it again just now.

sshot-1

Next you need to download this script from MSDN, and then move it to the root of the C: Drive. Note that you could move it somewhere else if you want, but just change the rest of the instructions to use the alternate path.

sshot-1

Right-click on the file and select properties.  Click the unblock button in the bottom right hand corner.

sshot-7

Now you will need to mount the the .ISO file that you downloaded from the Windows Developer website. If you don’t know how to mount an ISO file check out our guide. Once you have mounted the .ISO image switch back to the PowerShell  window. Now type “CD C:\” to switch to the root of the drive.

sshot-6

Now type  the following command into the shell window:

.\Install-WindowsImage.ps1 –WIM J:\Sources\Install.wim –Apply –Index 1 –Destination I:\

You should substitute the drive letter that comes after the –WIM for the drive of the mounted DVD image, and substitute the destination drive letter, in our case this is I:\, for the VHD that you created in the first section of this article. Then press enter.

sshot-1

Once it has completed you will be notified.

sshot-1

Now open an elevated command prompt, and type bcdboot.exe I:\Windows (assuming that I:\ is the drive with Windows 8 on it).

sshot-1

That’s it now when you boot Windows you will be greeted with the new OS Choosing Screen.

04-ChooseOS

Taylor Gibb is a Microsoft MVP and all round geek, he loves everything from Windows 8 to Windows Server 2012 and even C# and PowerShell. You can also follow him on Google+

  • Published 09/26/11

Comments (78)

  1. Peter

    Excellent article, explained easily. Love this site.

  2. Ashish Jain

    Does Windows 8 has any hardware check? I was not able to install on Virtual Box because of hardware acceleration is not supported on my laptop
    Will it work on physical machine.

  3. Nick

    Will this work with any version of Windows 7? I know that usually to run operating systems from a VHD it needs to be higher than Win7 Pro.

  4. Zain

    WTH how much space do you have in total of all your partitions. That’s too much of a free space! I wish I had that much of free space in my machine too :-D

    anyways… very nicely explained. Bookmarked! :)

  5. RABO

    can I do this in reverse?(I have win8 and do not have win7)

  6. Kevin McKell

    I have Windows 7 64 bit and i have also installed Linux Mint (duel boot). Is it still possible to install windows 8 by creating VHD as mentioned in the article above?

  7. Dime

    Why can’t I mount the .iso file? after unblocking it, daemon tools doesn’t recognize it as a image file, neither does the Virtual Clone Drive. And in the PowerShell after I type the command it says that the argument did not fall true. Please help..

  8. TaylorGibb

    @Nick, as far as i know it should work on all version although i am not sure about that.
    @RABO, yes you can
    @Kevin Mckell, You should be able to provides you follow the exact steps as it copies the boot entries from the existing Windows 7 boot manager to the new Windows 8 one.

  9. shafiq

    i am so proud of this greeks God is blessing me

  10. Ray Cooke

    Hi,
    I loaded it onto a blank hard-drive in my machine. I have 4 hdd’s with Windows7 ultimate on drive C. It completely cocked up my C drive and I finished up having to delete the partitions on both the C drive and the G drive [windows8] and formatting both + re-installing windows on C once more. GGRRRRRR

  11. PingLu

    Hmh.. thanks for the how to! I’ve come across some problems, first there is no “Unlock” on the ps1 file.. is there something special i have to do to unlock that file?

    when i enter:

    .\Install-WindowsImage.ps1 -WIM E:\Sources\Install.vim -Apply -Index 1 -Destination W:\

    i get:
    C:\Install-WindowsImage.ps1 : Cannot validate argument on parameter ‘WIM’. The ” Test-Path $_ ” validation script for t
    he argument with value “E:\Sources\Install.vim” did not return true. Determine why the validation script failed and the
    n try the command again.
    At line:1 char:32
    + .\Install-WindowsImage.ps1 -WIM <<<< E:\Sources\Install.vim -Apply -Index 1 -Destination W:\
    + CategoryInfo : InvalidData: (:) [Install-WindowsImage.ps1], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Install-WindowsImage.ps1

    Anyone have an idea? Seems to be a problem with the -WIM parameter… but cannot figure out why it cannot be validated, since the file path is correct.
    Thanks a lot!

  12. Ray Cooke

    But I agree with most folk..THIS IS THE BEST SITE EVER..KEEP ON GEEKIN’ CHAPS!!!

  13. PingLu

    okay, scrap my last comment. I wrote “Vim” instead of “Wim”. Will hit my head hard against the keyboard.
    Thanks for the tutorial, hope that i can get it running!!!

  14. dark DJ

    great work on the tut’ but i have some minor problem with this … in the step of installing the image it say
    that the file is not digitally signed

  15. Dee Plus

    Can I use this method even if I already have a dual-boot situation with Linux on one of my partitions, Easy BCD etc.?

  16. Dee Plus Plus

    Can I use this method even if I already have a dual-boot situation with Linux on one of my partitions, Easy BCD etc.?

    Does the boot screen in the final picture appear AFTER you boot into Windows? Or will there be another entry in my boot menu?

  17. EricY

    How to you roll back the changes once they are made lets say you Don’t want to use windows 2008 any more
    could you simply point bcdboot.exe to the local windows location and that would overwrite it

  18. Suraj @seekably

    This is really cool technique!

  19. fooman

    You guys ROCK! Everything you post is just awesome, thanks for being you :)

  20. Peter

    @EricY – I also would like to know how to roll back changes when I’m finished experimenting.

  21. Demonkunga

    Yeah it would be nice if they had included how to reverse changes. How come no one ever does this? D:

  22. Matt

    Great article. I had some trouble with the 64bit developer preview. Sorry didn’t write down the error message. 32bit worked great.

    Not to be annoying but couldn’t you do the last step in powershell and save yourself from opening the cmd prompt. Heh, yeah that was annoying.

  23. Han Broekman

    Everything went fine until I booted win8 (64bit). Then it said no can do this version on my ASUS x53e.
    How to reverse the bootmanager to just do Win7?

  24. Mike A

    After restarting my laptop I get to a windows recovery environment, “digital signature for this file couldnt be verified” File \Windows\system32\winload.exe error. Any ideas?

  25. Wayne Madeley

    tried it, got to the point of powershell to install and i’ll paste what error i’m getting.
    Maybe one of you can tell me what I did wrong.
    Thanks in advance

    PS C:\> .\Install-WindowsImage.ps1 -WIM F:\Sources\Install.wim -Apply -Index 1 -Destination s:\
    Applying “Windows Developer Preview” to s:\…
    WARNING: This may take up to 15 minutes…

    Exception calling “Apply” with “1″ argument(s): “Unable to apply image to s:\. Error = 769″
    At C:\Install-WindowsImage.ps1:831 char:39
    + $wimContainer[$($Index - 1)].Apply <<<< ($Destination)
    + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DotNetMethodException

  26. bob johnson

    You got to be kidding its much easier to partition the disk to create a virtual drive

  27. eastcoastsam

    THIS IS USER FRIENDLY !?!?!?!?!?!? I’D HATE TO SEE THE “UNUSER” VERSION !!!

  28. juergen

    This is awesome!
    After the first reboot, a moment of panic, when the Windows 8 developer boot screen appeared, but all was good.

  29. Tammy

    Would this work with Windows XP. I have 7 on a new gateway I just bought and want to put XP on the second partiton. Will I have to streamline XP. Thanks

  30. A

    I think I’ll just stick to the secondary hard drive idea…

  31. bilby

    If I want to use my D:\ partition do i have to in all steps use D:\ instead C:\ ?

  32. KyEap

    Great! Is it this trick apply to any OS also ? I mean dualboot XP, dual boot linux.

  33. Muddasir

    This is truly fantastic. You people are doing a fantastic job. Thanks a lot.

  34. Tig

    At the PS C:\> I receive the error
    The term ‘.\Install-WindowsImage.ps1′ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:27
    + .\Install-WindowsImage.ps1 <<< -WIM F:\Sources\Install.wim -Aplly -Index 1 – Destination A:\
    + categoryInfo : ObjectNotFound: [], CommandNotFoundException
    + FullyQualifiedErrorld : CommandNotFoundException
    I am running windows 7 64bit, Any help would be greatly appreciated am new to this and would really like to accomplish the Dual Boot
    Thanks

  35. Lo

    How do you uninstall???

  36. MG

    HELP! ASAP! thanking you in advance; trying to set up the HTG Dual Boot 7 and 8 (using VHD) at the step after doing the CD C:\ and entering in the powershell .\Install etc.. etc.. I get the following message;
    ps1 not digitally signed the script will not execute on the system. Please see “get-help about signing” for more details.
    So I am stuck here not knowing what to enter in the next command in PowerShell.

    Please respond as soon as possible (I am at work)
    Thank you for your undderstanding in this matter and all the help will be welcomed.
    MG

  37. Ronald R

    I have been running Windows 8 for a few weeks now.
    I put the 64 bit on a fresh 250 gb drive.
    Its been running Great no real big problems , just a few small little things.
    The built in spell check had me in mind “lol”
    But I do like to Game on Windows Live.
    And that is not built in program yet.
    Its forcing me to hack my games to try to make them run on this prototype Windows 8.
    I’m going to try to hack up one of my games today .
    If I can’t get my Xbox controler and games to run on soon.
    I’m pulling the plug on the Windows 8
    Thank for the Windows 8 anyways it seems ok.
    But I don’t roll that way.
    I don’t want it on my 1TB drive.
    I mite fire it up once a week if I can’t game on it.
    But it do’s up date . Thanks Again.

  38. Ankou

    Awesome verbage Ronald! Don’t hide your genius from the world.

  39. jcarlsen

    Yes, it would be really nice to know how to roll back the changes once they are made and you Don’t want to use windows 2008 any more.
    Come on you Geeks, release the Concept for this.

  40. TaylorGibb

    UPDATE: Everyone that wants to know how to roll back changes im working on the article this weekend it will be up early next week :D until then keep geekin out :P

  41. Fsheetsk!

    Works OK with some minor adjustments. When I turned my computer on this morning, it did not come up to the dual boot menu. I had changed the order to boot Windows 7 by default if I didn’t do anything.
    Oh well, Change the boot order and see if Windows 8 comes back!

  42. Armando

    Hi MG, I got the same error, this is how I fix it:
    Instead of : “Set-ExecutionPolicy RemoteSigned”
    Use: “Set-ExecutionPolicy Unrestricted”
    Granted that we are puting ourselves at risk, since the file is not even signed.
    By default you can not run scripts(W7 ultimate), you have to manually give permission to the OS.
    Execution policy, grants permision to your script, even your own.
    I am installing the w8 preview now. I will post my results later.
    Cheers.

  43. TaylorGibb

    @Armando yeah you can do that, the reason i didnt do it, is beacuse im kind of fanatical about best practises. So yeah it works, but yeah you widen your attack surface

  44. SuperSimon

    Can you do it with vista? (I know, I’m still stuck with that goddamn thing!)

  45. Lou

    The instructions suck and NO I am NOT a computer idiot. Virtual Clone doesn’t seem to work. It’s all crap. I will wait for Windows 8 to be released.

  46. Lou

    I don’t understand this line .\Install-WindowsImage.ps1 –WIM J:\Sources\Install.wim –Apply –Index 1 –Destination I:\

    My VHD is M:\ What goes after the -WIM

  47. SuperSimon

    Wait, nevermind vista doesn’t have the vhd options :( I should upgrade soon.

  48. rangerevo8

    @Lou

    after the -WIM, replace the “J:\” to your mounted Windows8 Developer Preview ISO drive letter.
    e.g. Your ISO mounted as “H:\”. Then your line should look like this:-

    .\Install-WindowsImage.ps1 –WIM H:\Sources\Install.wim –Apply –Index 1 –Destination M:\

  49. shinigamibob

    What happens to my linux partitions? Currently I have Linux Mint with Windows 7 set up to dual boot. If I install this, what happens to my linux partition and bootmanager (GRUB)?

  50. Ahmad nazir

    I got Error 1392 after Warning: This May Take Up to 15 minutes thing….it says CategoryInfo: NotSpecified. …. Please help. I did this thrice yet still with the same error. :(

  51. Jim Nielsen

    Excellent tutorial,

    Followed the instructions and 25 minutes later was running Windows 8…

    First impressions: Don’t like the metro tile interface, but it may grow over time…

    Good work…

  52. williamknight57

    OK, got running fine, everything worked great, but I have a dumb question how in the hell do turn it off, can’t find an of button anywhere help

  53. williamknight57

    Found it – for those interested ctrl-F4 will bring up a shutdown screen very much like the XP screen or under the settings thing there is a power button there to.

  54. C.Littlej

    .\Install-WindowsImage.ps1 –WIM E:\Sources\Install.wim –Apply –Index 1 –Destination G:\

    Ok “E:\” is for the the drive with the mounted Win8 image
    and
    “G:\” is for the letter of the VHD

    I’m getting hit with File C:\Install…. cannot be loaded. The File C:\Install… is not digitally signed
    The script will not be executed.

    Any idea what I’m doing wrong? Running Windows 7 Pro 64-bit btw

  55. rew

    dAll went well, and I was successfully able to install windows 8 using the method above. But now I can’t boot to Windows 7.
    Whenever I try to boot to windows 7 , I get redirected to the startup repair screen(The one that you see when installing Windows 7), I tried to choose startup repair but it said it cant detect the problem.
    What do I do?

  56. williamknight57

    To get back to were you before the changes just reset the powershell to restricted thats the default setting

  57. iphoness

    This is surely a very good tutorial and I am just gonna give it a try right now. Thanks a lot for sharing it.

  58. Mehdi

    Love It! Thanks a lot.

  59. rem

    Anyone?How do I get back to where I started before following this guide?

  60. ToRem

    @rem Boot in to windows 7 run this command bcdboot.exe C:\Windows Remove the VHD

  61. JoshH100

    How long is this supposed to take? Its been sitting there for like 40min with no errors.

  62. Mizwan

    Superb! article for dual boot of Windows 7 and Windows8

  63. Ken

    All goes well, I get the dual boot splash screen, but when I click on the Windows 8 icon to boot Windows 8, I get this message: “Windows could not start the installation process”
    All I can do is click on OK, which then reboots the PC.
    I have tried both a mounted DVD image, as well as a physical DVD, with the same result.
    There are no errors during the installation, but Windows 8 will just not boot.
    The same DVD installs fine on another machine.

  64. Pradeep

    Excellent article, very straight forward method. Worked great for me.

  65. Sudeep

    Good post… I like this post very much. So easy to install the preview version of windows 8 without partitioning the hard disk… Thankx for this post… All goes fine throughout the whole process…

  66. Billwoo

    Excellent article ! It took me two tries, but the second time worked. However, using Visual Studio 11 preview under Win8 on a VirtualBox is slow as cold honey.

    My system is a 6420 duo-core with 4 gigs of ram: yeah I guess that’s an old jalopy these days :)

    But, I ain’t complaining; this is, after all, preview pre-beta software. Tomorrow I un-install the VHD and try to put Win8 on a Flash drive, or maybe a hard-drive.

    thanks, Bill

  67. AlbertGusti

    Exellent article! but, i have one problem, i configure bcdboot.exe to L:\Windows (Windows8 Partition) but failed

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>bcdboot.exe L:\Windows
    BFSVC: Failed to set element application device. Status = [c00000bb]

    C:\Windows\system32>

    What i must do now? will my computer cannot boot windows 7 again?
    Thanks for the best tutorial, Albert

  68. guru

    and once done how do i undo it?? i mean remove the VHD and the Windows 8 option from the boot list?

  69. satyadev

    running windows 8 successfully……

    thank you for best tutorial..

  70. cipher

    Hey, quick question: Is there a way to set the bootloader to load the current Windows 7 partition by default? Say after 5 seconds?

    Thanks!

  71. cipher

    Nvm, got it. After the bcdboot.exe W:\Windows bit, just have to go to msconfig, boot, and set Widnows 7 as default again.

  72. brandon

    After win. 8 installed I restarted my pc instead of doing the boot command, now idk what to do lost my G drive but I have the vhd on my desktop, what do I do????

  73. Waldemar

    Very good!
    You authorize me to translate and publish this post in my blog in Brazil?

  74. bonehooch

    Thanks taylor, worked like a charm!

  75. Pete

    New-Object : Exception calling “.ctor” with “1″ argument(s): “Unable to open/create .wim file E:\sources\install.wim. E
    rror = 1″
    At C:\Install-WindowsImage.ps1:805 char:27
    + $wimContainer = new-object <<<< Microsoft.WimgApi.WindowsImageContainer $WIM
    + CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

    Hi Huys any ideas. I am running win7 x64 My VHD is G:\ and my Mounted ISO is "windowsdeveloperpreview (e:)" I did not have an option to unblock when looking at the properties of the Scrip

  76. Someone

    Thank you so much! Had LOADS of problems with the other methoud but this works perfectly!!

  77. Bones

    Will this work if i put another iso file mounted and do the same steps will it boot like that?

  78. karawan

    I’ve done everything just as you said But the problem is that Now I have Just windows 8 which is booting alone and the MSCONFIG command it’s not giving me any other boot options…..Any help?????

Enter Your Email Here to Get Access for Free:

Go check your email!