Installing Windows 7 on the pure UEFI systems without CSM

Discussion in 'Windows 7' started by PrimeExpert Software, Jan 2, 2020.

  1. driver1998

    driver1998 MDL Novice

    Aug 26, 2013
    2
    7
    0
    I now have a fork of VgaShim that solves a few issues:
    - Failed to detect GOP graphics card and therefore not working on some machines. "No display adapter found" during VgaShim start
    - The screen display garbled when Windows 7 boot (when in PE / graphics driver not installed)

    Hope it can help somebody out here.
    github.com > driver1998 > VgaShim

    download v0.98.1 from the releases.
     
  2. james hod

    james hod MDL Novice

    Apr 23, 2020
    2
    0
    0
    I tried running Windows 7 with this and VGA Fix thingy checked on FlashBoot Pro and it got past "Starting Windows" and then got stuck at ACPI Compliance BSOD. I know its not the fault of software but I just wanted to say that you may encounter other hurdles.

    I also tried Gen2 ISO (yes I know Gen2 ISOs doesn't have a good rep) but its the only ISO with which I can install Windows 7; however after install when I attempt to boot it gives be ACPI Compliance error again :/

    I would appreciate some help with getting this running.
    Thanks
     
  3. cengizhan

    cengizhan MDL Senior Member

    Jul 29, 2009
    456
    149
    10
    why do people won't give up this? it wont work. microsoft will not patch windows 7 for this. windows 7 does not support pure uefi. you have to enable csm and disable secure boot. there is no other way. all these third party patches/hackes may introduce new bugs or problems.
     
  4. james hod

    james hod MDL Novice

    Apr 23, 2020
    2
    0
    0
    i really wanted to install Windows 7 because of its low RAM and CPU Usage on my pos Atom Z8350 laptop. It doesn't have support for CSM (I did disable secure boot). I also tried Lubuntu but it had some audio driver issues due to weird implementation of headphone/speaker switching. After trying to install various ISOs and various tools I finally gave up and installed Windows 10 2016 LTSB, its not the best on this laptop (youtube video freezes on >480p on Chrome/Firefox though IE runs it fine for some reason).

    I'm thinking of getting a Ryzen laptop once lockdowns and delays end because Intel Atoms are absolute garbage.
     
  5. dsanke

    dsanke MDL Novice

    Jan 31, 2016
    2
    0
    0
    Tried Flashboot Pro 3.2x , yes , Windows 7 boots with CSM disabled , but the graphic driver by Intel or AMD do not work ( I have no Nvidia devices.).
    Nothing happens after successful driver installation. The resolution still fixed at 1024*768 , and can not enable Aero or play games.
    Test on B85/Z97/Z170/Z270/X570 with 4/5/8/9th gen Intel Core CPU and Ryzen 3700X with HD5200/HD6200/UHD630/RX580/RX5700XT graphic.
    And I copy bootmgfw.efi to existing Windows 10 and Windows 7 EFI partition. It can not boot both 10 and 7 , with error 0xc0000428 , can not verify the signature of winload.efi.
     
  6. andreidi

    andreidi MDL Novice

    May 24, 2020
    34
    9
    0
    I succesfully installled win7 on intel kaby lake r with uefi class 3 by disabling vga and integrating a custom signed intel uhd video driver. Whenever I will have to reinstall I will try the VGA fix from above.
     
  7. The Freeman

    The Freeman MDL Novice

    Dec 7, 2018
    15
    8
    0
    Is it complicated to "disable vga and integrate a custom signed intel uhd video driver" ?
     
  8. mbc004

    mbc004 MDL Novice

    Jul 12, 2020
    12
    12
    0
    #29 mbc004, Jul 12, 2020
    Last edited: Jul 13, 2020
    The following procedure works on Dell Vostro 3671.

    1. Use NTLite to slipstream USB and storage drivers. Build ISO. Use Rufus to create a bootable USB pendrive from this ISO (mode GPT, UEFI). Let's say that USB pendrive is drive U:.

    2. Obtain the following files:

    a. vgashim.efi (driver1998's version) and vgashim.bmp

    b. bootmgr.efi, bootmgfw.efi memtest.efi from Windows 10.

    3. Create directory U:\newefi, copy bootmgr.efi, bootmgfw.efi, memtest.efi there. Additionally, copy vgashim.efi to U:\efi\boot\bootx64.efi and vgashim.bmp to U:\efi\boot\bootx64.bmp

    4. Boot off the pendrive. You should see the vgashim logo animation and the installer should start.

    5. The installer will run until reboot, and you will see a bootloader error 0xc000000d. Don't panic.

    6. Boot off the pendrive, enter recovery mode, start shell.

    7. Run mountvol to see your drive letter assignments. Note in particular EFI partition (hereinafer S: ) and USB pendrive (hereinafter U: ).

    8. If EFI partition is not mounted, run mountvol S: /S.

    9. Replace bootloader with Win10 version: copy U:\newefi\*.* S:\efi\microsoft\boot

    10. Install VgaShim: copy U:\efi\boot\bootx64.* S:\efi\boot

    11. Update the boot path: bcdedit /set {bootmgr} path \efi\boot\bootx64.efi

    12. Reboot off the HDD. VgaShim should load, and the installer should continue.

    FAQ:

    Q1. What is this sorcery?

    A1. Win7 expects to have VGA hardware, and VgaShim emulates that. The trick is to boot into vgashim.efi instead into bootmgfw.efi, as is the default. vgashim.efi will
    run \efi\microsoft\boot\bootmgfw.efi automatically after doing its magic. This must be done for both the installation disk and the installed system.

    Q2. How do I know VgaShim worked?

    A2. You'll see an animation, plus installer will work. Also, you can press V when booting, vgashim will enter debug mode.

    Q3. Can I use vgashim.efi instead of bootx64.efi?

    A3. Yes, just adjust bcdedit path accordingly. Check BIOS setting or use BootIce.

    Q4. Why the bcdedit thing, and not just setting the path in BIOS?

    A4. Because Win7 will see the mismatch between BIOS and its BCD record, and add a new BIOS entry, pointing directly at bootmgfw.efi.

    Q5. Should I slipstream graphic drivers? Should I disable VGA driver after installing graphics drivers?

    A5. It does not appear to be necessary. I would recommend against disabling VGA driver, unless you want to get rid of VgaShim.

    Q6. Is the .bmp file necessary?

    A6. No, vgashim will work fine without it, just no animation. Alternatively you can make your own .bmp file from your favorite cat gif.

    Q7. Why replace the *.efi files with Win10 version?

    A7. This fixes the 0xc000000d error. Win7 bootloader does not like the hardware, but Win10 bootloader has no problem with it, and will boot Win7 also.

    Q6. Can I slipstream / automate this?

    A6. I see no fundamental reason why not. I have a VgaShim-based installer booting off PXE.

    Q7. Can I use a VGA-compatible grahics card instead of VgaShim?

    A7. I don't see a reason why this wouldn't work. You still need to replace bootloaders.

    Q8. How do I control which .efi file is booted?

    A8. UEFI boot entry in BIOS contains a device identifier pointing at an EFI partion and a file name. You can have multiple entries for booting different files. If you want to modify "Windows Boot Manager" entry, do it via bcdedit, otherwise Windows will overwrite it, see Q4 above. If file name is not specified, bootx64.efi will be used. This is the case when booting off USB media. From Windows (live or PE), use BootIce to set boot paths.

    Q9. Can I have more control over the boot process?

    A9. Yes! Download UEFI shell, put it into your EFI partition and boot it instead. This will give you a command prompt and you can manually type which .efi fie you want to run. You can then create startup.nsh file which will be run automatically when the shell starts. The shell waits 5 seconds before processing startup.nsh, and will drop you to command prompt when Esc is pressed.

    Q10. How do I edit stuff on EFI partition?

    A10. From boot disk, see step 8 above. From a live system, run cmd.exe as administrator, then see step 8. Note you will have to run notepad etc. from admin command prompt also, normal user cannot see EFI drive. From UEFI shell, cd, cp and edit commands; see help command and shell documentation. (Tip: run fs0: first).
     
  9. chumacher

    chumacher MDL Novice

    Oct 14, 2019
    14
    1
    0
  10. The Freeman

    The Freeman MDL Novice

    Dec 7, 2018
    15
    8
    0
    @mbc004
    Your tutorial looks very clean and neat! You sure put a lot of time and effort in writing it and is very much appreciated.
    I will give it a go and come back with feedback.
    Fingers crossed!
     
  11. andreidi

    andreidi MDL Novice

    May 24, 2020
    34
    9
    0
    No, I didn't know about vgashim then and I managed to do it without it. But now with the guide above is this very easy
     
  12. mbc004

    mbc004 MDL Novice

    Jul 12, 2020
    12
    12
    0
    Two hours to write up, plus a week to figure it out XD

    There's another interesting thing I forgot to mention. UEFI programs are like DOS programs, i.e. they exit and then the calling process resumes. This means that if you run vgashim.efi from shell, and vgashim.efi cannot find \efi\microsoft\boot\boomgfw.efi, it will drop you back to shell after installing the VGA emulator.

    You can (ab)use this in interesting ways. One idea is to use the hex editor on the vgashim binary and replace "bootmgfw.efi" with "xxxxmgfw.efi" or other garbage. This produces a version of vgashim which always drops you back to shell. You can then manually type which .efi file you want to run next. So in theory you could multi-boot another VGA-requiring OS, like XP64, as long as you have an EFI loader for it... Or run ipxe.efi which then allows you to boot the OS via wimboot.
     
  13. burdvista

    burdvista MDL Novice

    Jan 14, 2020
    14
    5
    0
    @mbc004

    OT , But this also works with Vista , Provided the bootx64 is from Vista or 7(not sure if thats ok do let me know) , but the other files are from Windows 10.
     
  14. manatails

    manatails MDL Novice

    Jul 23, 2014
    33
    44
    0
    #35 manatails, Aug 3, 2020
    Last edited: Aug 3, 2020
  15. andreidi

    andreidi MDL Novice

    May 24, 2020
    34
    9
    0
    I wonder if I could use this after i've already installed win7 by disabling vga and slipstreaming video driver, so I could get logo screen, BSODs and safe mode.
     
  16. mbc004

    mbc004 MDL Novice

    Jul 12, 2020
    12
    12
    0
    Sure. Put vgashim.efi on EFI partion as described and add a new entry in BIOS pointing at vgashim.efi. If you need safemode then boot the vgashim entry.
     
  17. Hououin_Kyouma

    Hououin_Kyouma MDL Novice

    Sep 3, 2020
    2
    0
    0
    Hello everyone,

    I recently got msi b550 mortar with 3700x and rx580 nitro+. The bios has CSM but I cannot boot win7. I tried vgashim, uefiseven, flashboot, nothing worked. The only thing that partially worked was a win7 image with win10PE loader. After the initial setup and after the first reboot (trying to continue the installation from the disk) the orbs froze again. I just wonder what "vga.sys" the win8/10 PEs are using in uefi mode or when win8/10 are being loaded?
     
  18. justintime20

    justintime20 MDL Novice

    Feb 5, 2018
    11
    0
    0
    I cannot get windows 7 to boot with CSM disabled. I integrated nvidia drivers, disabled vga services and deleted the vga driver. I also did the bcdedits to the bootloader. Windows 7 will only work with CSM enabled... Any way to fix this?
     
  19. Hououin_Kyouma

    Hououin_Kyouma MDL Novice

    Sep 3, 2020
    2
    0
    0
    Try to install to another working system, disable vga, install gpu drivers, msconfig to disable gui boot and do sysprep.