Menu

Adding a Windows 7 OS Stanza

James
2014-01-01
2014-04-15
  • James

    James - 2014-01-01

    Hey all,

    So I'm close to getting this to go (triple boot OSX/Linux/Win7). My last bit is creating a Windows 7 OS stanza. I'm not sure what to do to be honest...documentation shows something about a script, but I don't need anything fancy. I see this in the docs:

    menuentry "Windows via shell script" {
    icon \EFI\refind\icons\os_win.icns
    loader \EFI\tools\shell.efi
    options "fs0:\EFI\tools\launch_windows.nsh"
    }

    But I also see refences to bootmgr.efi and bootmgfw.efi online. I have both these files in:

    Windows/Boot/EFI

    Do I need to copy them to my EFI dir on the OS X side? Or....I'm just not sure how it works. Any pointers would be great...thank you.

    James

     
  • Roderick W. Smith

    Most Windows 7 installations on Macs use BIOS/CSM/legacy mode. Unfortunately, it's not currently possible to create a manual boot stanza for such boot loaders; you must use the automatic detection with the hdbios option to scanfor.

     
  • James

    James - 2014-01-04

    Thanks Rod. Yea the auto detection detects, but it doesn't boot..hangs at the gray screen with the Windows logo in the center after selecting that entry. Is there a way I can troubleshoot why it's not booting? Again, I can hold down the option key, reboot, and select Windows and it boots, so I know it's at least functional. Thank you.

     

    Last edit: James 2014-01-04
  • James

    James - 2014-01-07

    So more info on this. If I have scanfor internal, I get one entry for Windows, Boot from EFI. If I add hdbios, I get a second entry, Boot from Partition 3, neither of which boot Windows. Interestingly, if I boot into Mountain Lion from an External drive with rEFInd installed, it I can boot from the Boot from Partition 3 entry that it finds.

     
  • macyat

    macyat - 2014-01-08

    I was trying to get rEFInd to work for a complicated multi-boot setup. I had Win7 and Win8 installations on a GPT-formatted SDD booting via UEFI. I had WinXP and Ubuntu installations on an MBR-formatted SDD booting via BIOS (legacy).

    Win7 and Win8 would load as follows (at least I think so):
    - the UEFI loads bootmgfw.efi (located on the system EFI partition)
    - then bootmgfw.efi loads bootmgr.efi (usually located on the Win8 partition,
    but could be located elsewhere)
    - then Winload.efi is loaded (in \Windows\System32 directory of the Win7
    partition if Win7 is selected in the boot menu or the Win8 partition if Win8
    is selected)
    - then the selected OS is loaded

    I tried to get rEFInd to auto-detect my installations using scanfor with internal and hdbios options. It seemed to find the Windows Boot Manager (for Win7 and Win8) in the EFI system partition and the hard disk that had the WinXP and Ubuntu installations, but it didn't seem to be able to boot WinXP or Ubuntu. I can't remember if it would load up the Win8 boot manager properly. I think it did.

    I tried to write boot stanzas for Win7, Win8, WinXP and Ubuntu, but rEFInd could not even find any file that I specified. I would just get an EFI error saying file not found. I added an EFI ntfs driver, and rEFInd could find the specified file, but the installs would not boot. It would just hang (sort of like you describe above). For the Win7 and Win8 installs, I tried selecting bootmgfw.efi, bootmgr.efi, and winload.efi, but booting would not work. Rod also mentioned to that it's not currently possible to create a manual boot stanza for BIOS boot loaders. So WinXP and Ubuntu (at least the way I had things configured) just will not work.

    So if you have a BIOS boot Win 7 install on an MBR-formatted hard drive, it probably won't work (at least I couldn't get something similar to work).

     
  • James

    James - 2014-01-08

    Thank for the response Macycat. I continue to work with this..it's been interesting for sure ;)

     
  • Elli Lo

    Elli Lo - 2014-02-12

    Hi,

    I have kind of the same Problem: MacBookProLate2013: OSX, Windows8.1, Xubuntu. Windows boot stuck on Grey Screen after choosing in Refind. If I hold Alt at boot, I get to the normal Bootcamp loader, which only displays Osx and Windows, and if I select Windows there, it works flawlessly. If I delete my linux Partition, Windows works from Refind...
    I really am confused ?!
    Short:
    - 3 Systems: From Refind only OSX and Linux work, NOT Windows.
    - 2 Systems: From Refind both OSX and Windows work!

    Any ideas or progress?

    Maybe some additional infos: Had normal OSX installation, lastest updates and so on. Tried for 2 weeks to install Windows 8.1 in EFI mode; wasn't successful; installed Windows in normal "Bootcamp" Mode (Mac-Bootcamp-HybridMBR). Everything worked: Normal "Bootcamp-Hold-Alt-and-Choose-Boot, and also Refind! No Problems at all! Than came Linux, which was itself very troubeling, but I finally got it working. Installed without Grub, in EFI. The Bootorder in Refind changed from OSX, Windows to OSX, Linux, Windows. Now Windows doesn't work from Refind, even if I did nothing with Windows. I deleted Linux, and Windows was booting again from Refind. Installed Linux again, Windows wont boot. By the way, the Linux partition is after the Windows one. So I don't think it has to do with that.

    What I cant do is to try to install Linux in Bios mode, since I have no optical drive and if I put the Linux installation on a USB Stick, it only let me choose EFI mode. But I don't want that anyway. The only thing I want is functioning tripple boot!

    Thanks

     

    Last edit: Elli Lo 2014-02-12
  • joevt

    joevt - 2014-02-12

    Need more info:

    diskutil list
    sudo fdisk /dev/disk0
    sudo gpt -r show -l /dev/disk0
    sudo dd if=/dev/disk0 count=1 | xxd
    sudo dd if=/dev/disk0 count=1 skip=firstBlockOfWindowsPartition | xxd

    mount the EFI disk and use "ls -lR /Volumes/EFI/*"

    Post the output in an attachment.

    What is the list in rEFInd? Use text mode to see all items at once. Get a screen shot of the rEFInd text menu if possible (press F10 - the screen shot is saved to the EFI partition).

    There are some notes about repairing the EFI boot loader for Windows 8.1. I think this should be doable while booted in Windows from BIOS (but the EFI partition would need to be listed in the MBR? I'm not sure - you could just use a separate FAT partition). The end result should be an EFI boot loader for Windows on the EFI partition. You should be able to choose between BIOS and EFI boot for Windows in rEFInd.

    To install Linux in BIOS mode (which you don't want to do, or shouldn't need to do), you could try partitioning your drive using iPartition, make the new partition visible in Windows and make it the active partition, then use Parallels to install Linux to the partition using the option to store grub on the partition (without changing the boot code in the MBR). Don't install Parallels Tools until you know the partition can work from Boot Camp.

     
  • Roderick W. Smith

    Please provide the information for which Joe van Tunen has asked. My suspicion is that you've got some weirdness going on with your disk's hybrid MBR, but I can't be positive of that.

     
  • Jeff Johnson

    Jeff Johnson - 2014-04-06

    I have a MacbookPro Late2013 and I have been wrestling with the same Windows7 boot issue for a while. On a previous MacbookPro I triple booted OSX/Win7/Fedora with no problem using REFIt. I switched to REFInd on the new Macbook because development on REFIt had tapered off.

    I have the same issue booting Windows 7. The autoscanned OS instance boots to the grey REFInd screen with the Windows logo and never proceeds to boot. I pulled bootmgfw.efi from the Windows 7 install and placed it in ESD/EFI/Microsoft where REFInd finds it and gives it as an additional boot option. It doesn't work either as the OS wasn't properly installed to use it but something interesting happens! If I try to boot the bootmgfw.efi option it fails but the Microsoft bootmgfw CLI interface lets me ESCape back to REFInd. If I select the Windows 7 partition option next (not the bootmgfw.efi option but the autoscanned Windows partition option) the boot works perfectly. It is as if the bootmgfw.efi process enables something that REFInd needs (like ntfs driver perhaps?).

    I am guessing that should give enough of a clue to trigger a thought amongst REFInd developers.

    Here is the code requested above (that a previous poster didn't post)

    diskutil.out

    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            800.0 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4:       Microsoft Basic Data BOOTCAMP                85.9 GB    disk0s4
       5: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX               113.8 GB   disk0s5
    

    gpt.out

    #stderr "gpt show: /dev/disk0: Suspicious MBR at sector 0"
           start        size  index  contents
               0           1         MBR
               1           1         Pri GPT header
               2          32         Pri GPT table
              34           6         
              40      409600      1  GPT part - "EFI System Partition"
          409640  1562500000      2  GPT part - "Customer"
      1562909640     1269536      3  GPT part - "Recovery HD"
      1564179176   167772160      4  GPT part - "Microsoft basic data"
      1731951336   222258751      5  GPT part - "Linux filesystem"
      1954210087          32         Sec GPT table
      1954210119           1         Sec GPT header
    

    The two blocks are added as attachments as they look ugly inline.

     
  • joevt

    joevt - 2014-04-06

    The XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX that you replaced is just a GPT partition type code like "Apple_HFS", "Apple_Boot", "Microsoft Basic Data". It is not any kind of personal information. There's a list of partition types at http://en.wikipedia.org/wiki/GUID_Partition_Table

    The "Formatting Help" button will tell you how to format text. To get monospaced text, the simplest method is to indent each line like this (use the Prview button to verify):

    0000000: eb52 904e 5446 5320 2020 2000 0208 0000  .R.NTFS    .....
    0000010: 0000 0000 00f8 0000 3f00 ff00 e87a 3b5d  ........?....z;]
    0000020: 0000 0000 8000 8000 ffff ff09 0000 0000  ................
    

    It looks like your MBR and Windows partition are setup to boot using BIOS. The BIOS option will show up in rEFInd as something like "Boot Windows from Partition 2" where 2 is the partition index in the MBR.

    If you install the NTFS.efi driver from the Clover project into rEFInd's drivers folder, then it will say "Boot Windows from xxx" where xxx is the name of the Windows volume.

    I'm not sure why it would get stuck at the gray screen with the windows icon or why starting bootmgfw.efi would fix that. You could try using text mode instead (uncomment the textonly command in the refind.conf file) and make sure you have "scan_delay 1". Make sure your Windows partition has the BIOS BCD files (BOOTMGR, the boot folder, the BCD file in the boot folder). The files may be hidden but you can force the Finder or Windows Explorer to show hidden files and operating system files. EasyBCD can be used to edit the BCD (BIOS BCD only).

    If you wanted to try booting EFI (I haven't tried it and don't know if it works with Windows 7), then you would have to setup the efi BCD files in the ESD partition. EasyBCD 2.2 might be able to edit the EFI BCD file. This might work on the Windows partition if you have the NTFS.efi driver installed (I haven't tried that). You might also have to convert the MBR from Hybrid to GPT protected or else Windows might get confused - Windows shows Hybrid disks as MBR only which is annoying if you want to access the non-MBR partitions that are in the GPT.

    With EFI booting, you won't see the BIOS screen with blinking BIOS cursor in the top left corner, the screen will probably be at native resolution instead of 640x480 (or whatever the default BIOS graphics driver resolution is) so the Windows logo or boot graphics will appear at a higher resolution.

     
  • Roderick W. Smith

    Unfortunately, I don't have any more idea of why a direct boot to Windows is failing than Joe does. My vague thought about why trying with the EFI loader first helps is that the EFI loader is partially setting something up that the Windows BIOS loader can then use.

    You might try using a Windows repair disc to get things working; it's conceivable that something has become damaged in the boot loader files. Another possibility is that your partition table is being re-written on a regular basis to change the hybrid MBR, although in that case I don't know why the EFI loader would help matters.

    It is possible to boot Windows 7 in EFI mode on some Macs; see this thread for a very lengthy discussion of the issue (with numerous blind alleys). This reportedly works much more easily on more models with Windows 8.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.