[TIP] Windows 7 UEFI install without CSM

Discussion in 'Windows 7' started by °ツ, May 6, 2019.

  1. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    718
    923
    30
    #1 °ツ, May 6, 2019
    Last edited: May 7, 2019
    I was wondering if someone has found a way to install and run Windows 7 without having to enable CSM in the UEFI firmware and I found the solution on another forum so wanted to share it here.

    On an live system you have to do the below from CMD (GPU drivers have to be installed). What it does is to disable VGA driver, you can re-enable it by setting it to 3.

    Code:
    set Services=HKLM\SYSTEM\CurrentControlSet\Services
    reg.exe add "%Services%\Vga" /f /t REG_DWORD /v "Start" /d 4
    reg.exe add "%Services%\VgaSave" /f /t REG_DWORD /v "Start" /d 4
    bcdedit.exe /set {default} bootlog yes
    bcdedit.exe /set {default} bootstatuspolicy IgnoreAllFailures
    bcdedit.exe /set {default} novesa on
    

    Or if you want to clean install without having to enable CSM then you have to integrate GPU drivers to the WIM, edit the offline registry and do bcdedit changes before you boot Windows.

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\vga]
    "Start"=dword:00000004
    
    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\VgaSave]
    "Start"=dword:00000004
    Tested and it works both ways.

    Best is to apply windows 7 to the HDD from WinPE. Don't forget to integrate USB 3.0 drivers.

    Code:
    sel dis 0
    cle
    con gpt
    cre par pri size=350
    for fs=ntfs label="Windows RE tools" quick
    set id="DE94BBA4-06D1-4D40-A16A-BFD50179D6AC"
    gpt attributes=0x8000000000000001
    assign letter="T"
    cre par efi size=100
    for quick fs=fat32 label="System"
    assign letter="S"
    cre par msr size=128
    cre par pri
    for quick fs=ntfs label="System"
    assign letter="W"
    lis vol
    exit
    

    Code:
    diskpart /s .\CreatePartitions.txt
    dism /Apply-Image /ImageFile:D:\W7\sources\install.wim /Index:1 /ApplyDir:W:\
    md T:\Recovery\WindowsRE
    attrib "W:\Windows\System32\Recovery\Winre.wim" -h -s -r
    copy W:\Windows\System32\Recovery\Winre.wim T:\Recovery\WindowsRE\winre.wim
    bcdboot W:\Windows
    W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows
    
     
  2. Free_Being

    Free_Being MDL Novice

    Dec 28, 2010
    39
    13
    0
    Hi,

    I'm surprised, because I already installed Windows 7 with UEFI system, I only had to disable Secure Boot into UEFI Setup.

    Maybe a bug with your system and Windows 7 ?
     
  3. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    3,231
    2,849
    120
    #3 Carlos Detweiller, May 10, 2019
    Last edited: May 18, 2019
    If the original Windows 7 installation succeeded for you, you have a Gen2 UEFI which still provides the legacy BIOS INT10 emulation that Windows 7 requires to boot correctly in UEFI. Gen3 UEFI and up do not provide any CSM (and thus not the INT10 emulation) to OSes, so Windows 7 (which does not support GOP) fails to boot and freezes at the flags logo.

    Using the workaround from the OP to disable the VGA drivers allows you to use Windows 7 on those devices, but there are caveats:

    1. The graphics drives need to be pre-integrated, creating a GPU-specific ISO.
    2. You won't see anything at boot, after installation.
    3. Safe Mode (which uses the basic VGA driver) probably won't work.
     
  4. LittlePro

    LittlePro MDL Member

    Jan 19, 2017
    126
    22
    10
    #4 LittlePro, May 11, 2019
    Last edited: May 12, 2019
    Hi All,
    Greets,
    Thanks for the TIP & further analysis!
    I would also like to share something. It was an hp Pavilion g6 laptop that came preinstalled with windows 8 SL 64. I prepared USB installation media => GPT + UEFI using Rufus to install & make a dual boot with win7 64 sp1 on the same internal harddisk. It would hang on GUI Boot Starting Windows Flags. Then I just enabled Legacy boot & i was able to boot into & install win 7 with the same UEFI + GPT installation media with the same scheme => UEFI + GPT on the same internal hardisk.
    I am still surprised why an UEFI 1st & Legacy 2nd setting helped to boot into UEFI + GPT scheme.

    Thanks & Regards. ...
     
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    23,908
    33,639
    390
    8.1 doesn't need CSM (legacy bios support) and win 7 SP1 officially does, then you can install it in uefi mode..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    3,231
    2,849
    120
    Beginning with Windows 8.0, there is full support for GOP, no workarounds required.
     
  7. Ramiro Pistoia

    Ramiro Pistoia MDL Member

    Dec 24, 2018
    110
    52
    10
    I have an MSI A68HM-E33V2 and has UEFI and Windows 7 boots in UEFI mode and GPT disks without problem. Only I had to boot from USB2.0 ports because USB3.0 doesn't work until I install the AMD drivers. But Windows 7 is working perfectly in this system, even in a SSD!
     
  8. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    23,908
    33,639
    390
    With CSM support enabled;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Ramiro Pistoia

    Ramiro Pistoia MDL Member

    Dec 24, 2018
    110
    52
    10
    The UEFIBIOS has the option to boot in UEFI mode and Legacy mode, no CSM is mentioned. Probably is old and the new models don't have lagacy support anymore. I'm lucky :)
     
  10. Ramiro Pistoia

    Ramiro Pistoia MDL Member

    Dec 24, 2018
    110
    52
    10
    And KMS activation works flawlessly in Pro and Enterprise therefore I'm not affected by the problem some computers have to activate W7 by KMS
     
  11. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    3,231
    2,849
    120
    Mobos with support for BIOS INT10 might not require you to enable it, will be provided automatically if required. Others require to explicitly enable CSM, a third kind lets you select the OS to boot (and will act accordingly).