[TIP] Windows 7 UEFI install without CSM

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

  1. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    763
    1,041
    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
    40
    14
    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,988
    3,778
    120
    #3 Carlos Detweiller, May 10, 2019
    Last edited: Aug 30, 2020
    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 drivers 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 Senior Member

    Jan 19, 2017
    344
    115
    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. ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    30,802
    48,192
    450
    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,988
    3,778
    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
    184
    77
    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
    30,802
    48,192
    450
    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
    184
    77
    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
    184
    77
    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,988
    3,778
    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).
     
  12. wkeller

    wkeller MDL Member

    Nov 30, 2010
    134
    367
    10
    #12 wkeller, Nov 22, 2019
    Last edited: Nov 22, 2019
    The solution doesn't works for me. However

    I have found modified solution which works flawlessly.

    On a live system, I have installed vendor GPU drivers, and then applied this:


    Then I have extracted install.wim from Win10_1903_V1_Polish_x64.iso , then unpacked Windows/Boot/EFI folder from it.
    Then I've replaced files EFI/Microsoft/Boot/bootmgr.efi, EFI/Microsoft/Boot/bootmgfw.efi and EFI/Microsoft/Boot/memtest.efi on EFI System Partition of Windows 7 with those extracted files from Windows 10.
    Also I've replaced folders EFI/Microsoft/Boot/Fonts and EFI/Microsoft/Boot/Resources with those from Windows 10.
    I've deleted other folders from EFI/Microsoft/Boot/
    I've also replaced EFI/Boot/bootx64.efi with EFI/Microsoft/Boot/bootmgr.efi.

    Then I've restarted to BIOS/UEFI, disabled CSM and.... it works. It works! No logo during boot, but it works flawlessly. Windows 7 with UEFI with no CSM.

    PS. Secure Boot must be disabled.
     
  13. wkeller

    wkeller MDL Member

    Nov 30, 2010
    134
    367
    10
    #13 wkeller, Nov 22, 2019
    Last edited: Nov 22, 2019
    I've checked again and this is unnecessary when using Windows 10 bootloader:

    All above values can be safely deleted with bcdedit.exe /deletevalue command, so boot logo is displayed again.



    Only Vga and VgaSave drivers have to be disabled, so the below is important:

    And Recovery Mode will be not working, unless it has also integrated vendor specific GPU drivers (in place of Vga and VgaSave).


    PS. I have also tested that Windows 7 boots even with Secure Boot Enabled, so disabling it is no longer necessary.
     
  14. edmondgavin

    edmondgavin MDL Novice

    Feb 5, 2017
    1
    3
    0
    A simple way for reference.

    Need Google translator:)
    bbs.wuyou.net/forum.php?mod=viewthread&tid=404950&extra=&ordertype=1&page=1
    github.com/davidcie/VgaShim
     
  15. shhnedo

    shhnedo MDL Addicted

    Mar 20, 2011
    747
    963
    30
    ^ This seems interesting. Aside from the obvious need to integrate drivers, you only need to rename and copy the vgashim files to the appropriate folder on the install media.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. The Freeman

    The Freeman MDL Novice

    Dec 7, 2018
    15
    8
    0
    Hello everyone.
    Would be too much trouble to write a more detailed tutorial and synthesize the information above in a clearer, simpler way so others can prepare and use a Windows 7 OS?
    I'm sure you would make happy many W7 fans who just lost their hope in using W7 on their 8th and 9th gen Intel computers...
     
  17. shhnedo

    shhnedo MDL Addicted

    Mar 20, 2011
    747
    963
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. wkeller

    wkeller MDL Member

    Nov 30, 2010
    134
    367
    10
    You have to use Windows 10 boot manager (bootmgr.efi and bootmgfw.efi):