First boot via GRUB fails (Pre-OOBE driver install stage)

Discussion in 'Windows 7' started by Fierelier, Dec 3, 2020.

  1. Fierelier

    Fierelier MDL Novice

    May 16, 2016
    12
    11
    0
    #1 Fierelier, Dec 3, 2020
    Last edited: Dec 3, 2020
    Hello forums,

    I've been working on some tools for Windows 7 for a long time, and I'm working on implementing GRUB2, to replace Microsoft's MBR bootstrap (I have multiple reasons, I will elaborate if asked). It works great, IF you boot Windows 7 with the regular bootstrap first, and then install GRUB. However, I do not want to do this.

    The error I'm getting is "Windows Setup could not configure Windows to run on this computer's hardware." - Some threads and websites recommend you press Shift + F10, to open CMD, and run the OOBE manually (cd C:\Windows\System32\OOBE, start msoobe), it does make my setup work, but this method is not desired for multiple reasons:
    * OOBE has to be traversed without drivers, which I could see being an issue on some niche systems
    * unattend.xml is no longer respected
    * When using the Simplix update pack, certain updates are activated which shouldn't be (I get a big "Update to Windows 10" nag-screen)

    As for my setup, the first partition (msdos1 - NTFS) is GRUB, the second (msdos2 - NTFS) is Windows. I apply the install.wim using wimlib in WinPE 3.1 and then create the boot information using bcdboot (bcdboot W:\Windows /s W:\). I tried the following GRUB scripts to boot Windows:
    Code:
    insmod part_msdos
    insmod ntldr
    insmod ntfs
    set root=(hd0,msdos2)
    ntldr (hd0,msdos2)/bootmgr
    Code:
    insmod part_msdos
    insmod ntfs
    set root=(hd0,msdos2)
    chainloader +1
    I tried both, the first is what I put together from some documentation, the second I got from a suggestion in a forum. Reinstalling Windows entirely inbetween, they both work, but result in the same problem.

    It'd be great if any of you could enlighten me as to what is going on.

    Thank you.
     
  2. Fierelier

    Fierelier MDL Novice

    May 16, 2016
    12
    11
    0
    I hope this is fine to bump? I wish the rules were a little more specific about bumping.