none
HOWTO: Install Windows 8 or Windows 7 to a GPT Partition in a Hyper-V Virtual Machine

    General discussion

  • Hello,

    Could somebody please help me to understand if it is possible to install Windows 8 (or Windows 7, no big deal) to a GPT partition provided that this partition is created on a virtual hard drive in a virtual machine running on Windows Server 2008 R2?

     

    I did the following:

    During the course of Windows 8 Setup, I pressed SHIFT+F10 to open the Command Prompt window and typed at the prompt 

     

    C:\> Diskpart
    
    DISKPART> list disk
    
    DISKPART> select disk 0
    
    DISKPART> online disk
    
    DISKPART> attributes disk clear readonly
    
    DISKPART> clean
    
    DISKPART> convert gpt
    
    DISKPART> create partition efi size=100
    
    DISKPART> assign letter=s
    
    DISKPART>format quick fs=FAT32
    
    DISKPART>create partition msr size=128
    
    DISKPART> create partition primary align=32
    
    DISKPART>assign letter=c
    
    DISKPART> select part 1
    
    DISKPART> format fs=ntfs label="System" unit=512 quick compress
    
    DISKPART> assign letter c
    
    DISKPART> list volume

    In the Where do you want to install Windows? dialog box I see:


    The message is... oh, nay. I'd say it is "love" but it actualy reads as:

    Windows cannot be installed to this disk. The selected disk is of the GPT partition style.

    Is it possible to install Windows on a GPT parition within the Hyper-V? Or is it only possible to install it on a MBR partition? 

    Or am I doing something wrong?

    Thank you in advance.


    Well this is the world we live in And these are the hands we're given...

    Thursday, September 15, 2011 6:00 PM

All replies

  • Hi,

     

    As far as I know, Hyper-V doesn’t emulate the EFI, it’s still the legacy BIOS. So you need to install the system on a MBR disk instead of a GPT disk while GPT disk need EFI if you want to boot from it.

     

     

    Best Regards,

    Vincent Hu

     

    Friday, September 16, 2011 1:47 AM
  • Hanselman has a nice article about that: http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx Also Hao: http://blogs.itecn.net/blogs/haohu/archive/2011/09/15/how-to-boot-up-windows-8-developer-preview-via-vhd-in-2-steps.aspx
    Adelino Araujo
    Friday, September 16, 2011 2:22 AM
  • Hi Vincent,

    Thank you for your reply!

    In other words, whey they say Hyper-V does support GPT, the following restrictions apply:

    1. The GPT partition should be a data type partition.

    2. The VHD file still cannot be larger than 2 Tbytes.


    Well this is the world we live in And these are the hands we're given...
    Friday, September 16, 2011 1:05 PM
  • Hanselman has a nice article about that: http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx Also Hao: http://blogs.itecn.net/blogs/haohu/archive/2011/09/15/how-to-boot-up-windows-8-developer-preview-via-vhd-in-2-steps.aspx
    Adelino Araujo

    Thank you, Adelino, for pointing to this article.

    However, Scott is discussing setup of Windows 8 to a newly created VHD.

    What if I already have a VHD with deployed Windows Developer Preview? Is it possible to add an entry to the BCD of my Windows Server 2008 R2 with Service Pack 1 that would point to that exiting VHD? I would love to boot to already created installation rather than install the OS from scratch.

    The reason I am asking is due to the following points:

    1. To be on the safe side, I'd love to avoid overwriting existing BCD with the new loader from the Windows 8.

        When the next public build is out, I will only need to re-create the VHD without having to suffer from the obsolete boot loader.

    2. If I managed to boot from the VHD, I believe, that would allow me to easily boot into Windows 8 both from physical loader and the Hyper-V.

    Here is what I've done:

    1. Created a new Hyper-V VM and installed Windows 8 on it.

    2. Within the VM I ran the following command:

     

    C:\Windows\System32\sysprep>sysprep /generalize /shutdown

     

    That would've helped to get rid of configuration changes I've made to the OS after installation.

    3. Returned back to the Windows Server 2008 R2 environment and followed the steps, provided in this article that Scott has written back in 2009.

    Now here's the problem. When I restart my server, I get the following two records in the boot menu:

     

    Windows Server 2008 R2
    
    Windows 8

    However, when I choose Windows 8, I bet I get into the Recovery Console, because I see recovery window with a drop-down box allowing me to choose from accounts that I have in the SAM database of Windows Server 2008 R2.

    What makes me puzzled is this command provided in Scott's article:

    C:\>bcdedit /copy {current} /d "My New VHD Option"

    This command, as I understand it, creates a new entry called "My New VHD Option" in the BCD and copies all the contents from the entry that has been used to start current session of Windows.

    What is strange? The strange thing is that in the Scott's output of bcdedit /v all the entries have completely different GUIDs where my differ in the first sub-part of the GUID only.

    Here's what I have:

     

    C:\Users\EH>bcdedit /v
    
    
    
    Windows Boot Manager
    
    --------------------
    
    identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}
    
    device                  partition=\Device\HarddiskVolume1
    
    description             Windows Boot Manager
    
    locale                  en-US
    
    inherit                 {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
    
    default                 {57cde6a3-a96f-11de-84b7-eb7a92b27c05}
    
    resumeobject            {57cde6a2-a96f-11de-84b7-eb7a92b27c05}
    
    displayorder            {57cde6a3-a96f-11de-84b7-eb7a92b27c05}
    
                            {57cde6a9-a96f-11de-84b7-eb7a92b27c05}
    
    toolsdisplayorder       {b2721d73-1db4-4c62-bf78-c548a880142d}
    
    timeout                 30
    
    
    
    Windows Boot Loader
    
    -------------------
    
    identifier              {57cde6a3-a96f-11de-84b7-eb7a92b27c05}
    
    device                  partition=C:
    
    path                    \Windows\system32\winload.exe
    
    description             Windows Server 2008 R2
    
    locale                  en-US
    
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
    
    recoverysequence        {57cde6a4-a96f-11de-84b7-eb7a92b27c05}
    
    recoveryenabled         Yes
    
    osdevice                partition=C:
    
    systemroot              \Windows
    
    resumeobject            {57cde6a2-a96f-11de-84b7-eb7a92b27c05}
    
    nx                      OptOut
    
    hypervisorlaunchtype    Auto
    
    
    
    Windows Boot Loader
    
    -------------------
    
    identifier              {57cde6a9-a96f-11de-84b7-eb7a92b27c05}
    
    device                  vhd=[D:]\VM\Win8\Win8.vhd,locate=custom:12000002
    
    path                    \Windows\system32\winload.exe
    
    description             Windows 8
    
    locale                  en-US
    
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
    
    recoverysequence        {57cde6a4-a96f-11de-84b7-eb7a92b27c05}
    
    recoveryenabled         Yes
    
    osdevice                vhd=[D:]\VM\Win8\Win8.vhd,locate=custom:22000002
    
    systemroot              \Windows
    
    resumeobject            {57cde6a2-a96f-11de-84b7-eb7a92b27c05}
    
    nx                      OptOut
    
    hypervisorlaunchtype    Auto
    
    detecthal               Yes

     

    What am I doing wrong? Possibly Windows 8 does not support the Windows Server 2008 loader?

    Could you please help me here?

    Thank you!


    Well this is the world we live in And these are the hands we're given...
    Friday, September 16, 2011 4:04 PM