Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I tried to read whole topic, but reading about bunch of different models got me confused.

Is it possible to install Windows 7 in efi mode on Macbook Air Mid 2011 and have all the hardware working?
 
Win7 x64 EFI install and keeping OSX

This is what finally worked for me (mb6,1 and mbp10,1):
  • OSX and OSX system partition:
    • Partitioning/resizing to make space for Windows
    • Installed refind v0.7.4. Just re-run install.sh any time the OSX update or any other OS takes over as boot manager (hold down the alt/option key at power-on)
    • Shell_Full.efi to /EFI/tools/shell.efi
    • Added one line to /EFI/refind/refind.conf
    • Added the config /EFI/refind/manual.conf
  • EFI system partition (EFS):
    • Added the script /EFI/windows.nsh
  • FAT32 file system on a local partition (or flash drive) with:
    • WinPE 4.0 to /
    • The root folder(s) from the supported (v4 or v5) BootCamp zip file to /
    • Copied the content of win8x64 (rtm/eval) iso into /win7inst
    • Replaced /win7inst/sources/install.wim with the one from of a plain win7x64 (pro) iso
    • Added the config /win7inst/sources/autounattend.xml

refind.conf (just showing the single line that i added)
Code:
include manual.conf
manual.conf
Code:
menuentry "WinEFI" {
    icon \EFI\refind\icons\os_win.icns
    loader \EFI\tools\shell.efi
    options "fs0:\EFI\windows.nsh"
}
default_selection WinEFI
windows.nsh - the two "mm" lines are for mb6,1 only and was omitted for mbp10,1 (unique values for every model)
Code:
mm 0010003E 1 ;PCI :8
mm 02000004 1 ;PCI :7
time
fs0:\EFI\Microsoft\Boot\bootmgfw.efi
autounattend.xml - check if drive letter becomes D: (both BC4 and BC5 are handled here)
Code:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">

  <settings pass="windowsPE">
    <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <UserData>
        <ProductKey>
          <Key>HYF8J-CVRMY-CM74G-RPHKF-PW487</Key>                      <!-- product.ini:Professional-->
          <WillShowUI>OnError</WillShowUI>
        </ProductKey>
      </UserData>
    </component>
  </settings>

  <settings pass="offlineServicing">
    <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DriverPaths>
        <PathAndCredentials wcm:keyValue="BootCamp4.0.4033">
          <Path>D:\BootCamp\Drivers\NVidia\Win7_64</Path>               <!-- drive letter in winPE -->
        </PathAndCredentials>
        <PathAndCredentials wcm:keyValue="BootCamp5.0.5033.intel">
          <Path>D:\$WinPEDriver$</Path>                                 <!-- drive letter in winPE -->
        </PathAndCredentials>
        <PathAndCredentials wcm:keyValue="BootCamp5.0.5033.nvidia">
          <Path>D:\BootCamp\Drivers\NVidia\NVidiaGraphics64</Path>      <!-- drive letter in winPE -->
        </PathAndCredentials>
      </DriverPaths>
    </component>
  </settings>

</unattend>
The process:

  • Digging out the "mm" values - Boot to the EFI shell (more documentation to be found elsewhere in this tread...)
    • run 'pci -i -b', look for VGA controller, notate BUS DEV FUNC (BB DD FF)
      • if BB value is 00 then no "mm" lines are needed (probably)
    • run 'pci -i BB DD FF -b' for VGA controller, check that command register = 7
      • mm BBDDFF04 1 ;PCI :7
    • run 'pci -i -b', look for all PCI bridges, notate BUS DEV FUNC (BB DD FF)
    • run 'pci -i BB DD FF -b' for every PCI bridge searching for the BUS above for "Secondary"
      • mm BBDDFF3E 1 ;PCI :8
  • First stage (ca. 8 mins) - Boot to WinPE (not WinEFI)
    • Check drive letters (echo list vol | diskpart)
    • cd \win7inst\sources and execute setup.exe
    • I formatted the Windows partition before I proceeded
    • Win7 might think it needs its own 100MB "Windows reserved" partition in front of the Windows partition at this stage, and could silently grab any 128MB unallocated space that OSX likes to put there. A such partition can be deleted later.
    • The machine reboots
  • Middle stage (ca. 5 mins)
    • Nothing to do here, really. After the bootup was finished I got a screen to look at with mbp10,1 (but nothing was showing up on mb6.1 - spooky...). At least 5 mins. of patience is required. The machine should finally reboot. Or just freeze if anything is (done) wrong.
  • Final stage - OOBE
    • After the bootup was finished I could proceed with the last part of the interactive install procedure.
    • I then installed BootCamp from the install medium/partition
    • I believe I disabled the Intel HD Graphics 4000 for mbp10,1 in Device Manager
    • Reboot
  • Some observations
    • :mad: Newer versions of display drivers like Intel HD Graphics 4000 in Windows Update and updates available in the NVIDIA Control Panel ruined my installations
    • :mad: Unreliable hibernation
    • :( I never got the sound working for the mbp10,1
    • :cool: No screen during startup
    • :confused: No notable performance gain over the BIOS compatibility mode (CSM)
The final question: Is it worth it installing Win7x64 in EFI mode? I don't think so. The limit of four MBR primary partitions has been mentioned. Well, it is not impossible to make a hybrid MBR (GNU fdisk) with extended/logical partitons and then make the GPT on the same sector boundaries. What could be more fun?
 
.......The final question: Is it worth it installing Win7x64 in EFI mode? I don't think so....

I managed to load Windows 8 Professional in EFI on a Mac mini 2012 and came to the same conclusion - not worth it. Plus if you rely for business on running Windows then you need to have a proven backup and restore method and that is where it all came crashing down.
 
I've finally got Windows 8 efi booting on my rMBP 10,1.
My first few efforts were plagued with various problems, mostly BCD related.
As I only had a ESD download of Windows 8 (ie no install.wim, just a install.esd) I couldn't follow most of the guides.

I got it running a few times but booting would fail after a short time. I have now found that just copying the EFI partition (with Clonezilla for instance) wrecked Windows booting and I had to fix it with a bcdboot command.
However, my latest install stayed running for more than a week and then I tried a Clonezilla backup.
Yep, it busted the BCD again.

As I said earlier, to fix the BCD I normally ran diskpart, assigned a letter to the EFI volume and ran a bcdboot command.
This latest time I managed to boot into safe mode and just as I had assigned the letter B: to the EFI volume I got a Windows pop-up window that said that my EFI partition was corrupted and would I like Windows to fix it?
I thought, Oh yeah, this'll be fun but I clicked on OK and then rebooted.

I was astounded to find that actually Windows had repaired it. This is something I have neither seen before or heard of. I was pleasantly surprised.

So, now things are more stable I can have more than 4 partitions (in fact I currently have 6) and all is well, so long as I don't run anything that can break Windows BCD. (NOTE I only use GPT fdisk now for partitioning - see rodsbooks.com)

I started off by using rEFInd (also from rodsbooks) but now I am just using OSX's bootloader for booting both systems.

The sound does not work, but that was expected. I think that will need a firmware update/fix from Apple - so not holding my breath there.
I haven't tried it but I suspect that sound would work through the HDMI lead to my TV. I'll try that some time.

I haven't found anything else not working yet.

I would mention that I needed to disable my Intel HD4000 chip in order to get graphics working (with the Nvidia GT650M).

All in all I'm happy with things - most notably the lack of restriction on the number of partitions and the lack of that dreadful hybrid mbr are the main attraction to me. (GPT-only ftw!).
 
Last edited:
Been a while since anyone posted some progress.

I can say I successfully installed Windows 7 64-bit in EFI mode on my Macbook Pro mid 2012.

Some observations:
- I cannot see what is going on in the EFI part.
- My first install (using bootcamp GFX drivers) installed correctly, but the screen stayed black even when windows started.
- Audio is not working yet

What I used to install Windows 7 64-bit in EFI mode:
- A Windows 7 with updates slipstreamed into it using WinToolKit. (prepared it for my Desktop PC, no Mac related modifications were made);
- The 5.0.x bootcamp support package;
- an 8GB USB drive;
- newest Intel drivers for the graphics and chipset;
- A self-made AutoUnattend.xml answer file.

What I saw:
- Booted into EFI Boot;
- Screen went distorted, so I went for some Cola;
- Mac rebooted, screen went distorted/black;
- Drank some more Cola/Smoked a cigarette;
- Noticed the display flickered for a second;
- I was greeted by the Windows "Completing Installation" screen.

OSX was already installed. I was able to boot into Windows several times, and just booted into OSX. Works fine so far.
When selecting EFI Boot in the Option Boot screen the screen distorts until Windows loads. Then the driver works as it is supposed to and works like a charm.

Only need to fix the audio now!
I'll update this as I move along.

Edit: Oh, no PCI register editing was done.
 
update:

Rebooting and selecting EFI Boot on the HDD after having booted into OSX resulted in a failed boot. Unfortunately I don't get a picture before the Windows driver takes over, so I can't diagnose exactly what the screen says. But I'm assuming it says something about the BCD or EFI partition having been modified by OSX.
 
Update 2:
After selecting "boot from windows boot manager on HDD" using a reFIT bootCD, I can now boot and reboot between OSX and Windows 7 using the standard Mac bootloader.

Audio still not working though. Everything else is.
 
Well, after trying to get the audio working with minimal effort, I decided I'd just format my whole drive and reinstall OSX and Windows (BIOS mode).

Experienced some weird glitches in EFI mode where for example the Bootcamp Configuration program didn't always remember my custom trackpad settings (tap to click vs click to click), graphics got funky once in a while, and the audio was still not working.

Better luck next year when Apple may have improved the EFI of my Mac.

For those wanting to have a go at installing Windows 7 64-bit in EFI mode, but don't want to go through the whole blind-install below you will find my autounattend.xml.
Edit it so:
- the country codes are the ones for your Win7 language. (mine is nl-NL, because I'm dutch :) )
- The license is compatible with the version of windows that you're installing
- The Windows partition size is to your liking. (Space in GB *1024)

The license code in the autounattend.xml is a generic Win7 Pro code I found on the Microsoft website. It's for OEM's and such, and shouldn't be used to activate (if it would activate at all in the first place).

The autounattend does the following:
- Wipes your hard drive clean! (So backup ;))
- Create an EFI (200mb), MSR (128mb), Windows (128GB), and OSX (remaining space) partition on your drive;
- Formats the EFI partition as FAT32, formats the Windows partition as NTFS;
- Installs Windows 7 on the third (= Windows) partition;
- Automatically adds Bootcamp drivers, and automatically installs remaining bootcamp drivers on first login (like the normal Bootcamp file);

Your mileage may vary, but best of luck to you :)
 

Attachments

  • AutoUnattend.xml.zip
    2.3 KB · Views: 216
I just received my Haswell Retina. I will be attempting an EFI install with Windows 8 today.

I was going to do this myself when mine arrive, especially since newer macs seem to do it flawlessly. Look forward to the results.

I would be very interested as well, in how you two get through this.
I tried installing Windows 8 a few times with varying amounts of success. The first time it actually seemed to install as an EFI boot but there were a few unallocated partitions created and I didn't like that so I deleted it. After that I was only able to do a normal Boot Camp BIOS install. This installation just has the normal one partition for bootcamp. In both scenarios I was unable to install the latest 750m nvidia drivers from nvidia's website.
 
I'm happy to say that this EFI install of Windows 8 was VERY easy. Although I DID run into a few issues, once these were resolved, everything is great. This is working FLAWLESSLY. Let me start by saying there are a few shortcomings:

1. I had to use an old WinPE image I had laying around.
2. OS X needed to be installed with Internet Recovery. This was due to the mismatch in Build Numbers.
No Iris graphics. I am limited to using the GT750m. If you want battery life boot into OS X.

Here is the process that I needed to perform to install the EFI version:

1. First grab a blank USB drive with at least 1GB free. You need to format it as FAT32, Then extract the contents of the WinPE image I used. I have placed it here:

https://db.tt/wunCjRAY

This is a WinPE image I made a while just to test EFI booting. You cannot harm your Mac.

2. Plug in the USB drive and hold down Option at reboot. The EFI Boot with a USB icon should pop up. Select it and watch Windows load.

3. Once WinPE is up, you will need to change the font if you are on a retina anything. This is easily done in cmd.

4. The key tool here we need to use is diskpart. Run the following command:

> diskpart
> list disk

Your hard drive NEEDS to have the GPT flag set. It doesn't matter much in OS X because it can read the GUID header just fine. However, if the asterisk is not under the GPT label, it must be cleaned and converted before the Windows 8.1 installer is able to install Windows directly. In my case, this was NOT set. Therefore, I ran the following commands to fix this (THIS WILL WIPE ALL DATA):

> diskpart
> select disk 1 (replace the number with the proper drive)
> clean
> convert gpt
> create partition efi size=256
> format fs=fat32 quick label=EFI
> create partition primary size=SIZE (This will be your Mavericks partition.)

It's important to try and get OS X installed on here immediately.

5. Once you have verified GPT flags are set, reboot the MacBook Pro and hold down Command-R to initiate internet recovery mode. I had to do this on my Haswell due to build number mismatches.

6. Install OS X to the partition you created (be sure you left a little room at the end)

7. Once install is complete, boot into OS X and manipulate the disk to your liking. Unlike earlier versions, Disk Utility DOES NOT overwrite changes made with another partition manager. I resized my partitions here.

I HIGHLY suggest creating a 10Gb partition at the end of the SSD and placing all your media there. That will ensure the FASTEST install time. Here is my partition scheme all done in Disk Utility after installation of OS X:

http://i.imgur.com/wLwWaS1.png

8. Download or create an ISO for windows 8. Extract the entire contents to the partition you created at the end (or a USB key if you chose to forego this).

9. Don't forget boot camp drivers. Do not download from the support site. These are outdated. The drivers that were grabbed by my Boot Camp assistant were from October 3rd. I have included them here:

https://db.tt/CZeXfh7P

10. Reboot into the WinPE image.

11. Check diskpart one more time to ensure the GPT asterisk is still set.

12. Plug in the media that contains the Windows 8 ISO contents. Use the following command to determine what location it is currently stored in:

> vol list

13. Type in the letter followed by a colon:

> D:

14. Once in here, run setup.exe. As stated earlier, install time will be GREATLY reduced if you place the install media in a FAT32 partition on the SSD.

15. Wait for the install to finish. Grab a cup of coffee. You deserve it if you made it this far! Lots of people don't get to this point

16. The machine will reboot a few times. ALWAYS make sure to hold down option and boot from Windows. Yes, we finally don't need refind or another boot manager. I am coming from grub.

17. Once the install is finished, you should have an ULTRA FAST Windows 8 setup. Once you get to the desktop, install the drivers. I have attached a screenshot of my device manager showing that most of the issues have been taken care of:

http://i.imgur.com/99QabWa.png

Yes you are missing Iris graphics. So what. I could care less. The keyboard works perfectly with these drivers. Please report back any findings. Apple has REALLY improver their EFI bootloader. I am a bit bummer this was so easy. But it's all good. Enjoy the EFI boot.

EDIT 1: Disk utility unsets the GPT flag. Nothing has changed. Please do all formatting/partioning with either parted or disk part

EDIT 2: I was unable to get this working again. What's the point of this tutorial without being able to reproduce it? I kept getting errors. It is VERY important to disable automatic graphics switching as soon as OS X is installed. This should keep the Nvidia GT750m in use. If the bootcamp drivers give an error that state the drivers are not supported on the platform, the GT750 will never work.

1. RESET PRAM
2. DESELECT AUTOMATIC GRAPHICS SWITCHING!
 
Last edited:
1. I had to use an old WinPE image I had laying around.
1. First grab a blank USB drive with at least 1GB free. You need to format it as FAT32, Then extract the contents of the WinPE image I used. I have placed it here:

http://www.sendspace.com/file/h629gp

This is a WinPE image I made a while just to test EFI booting. You cannot harm your Mac.

I really appreciate the MALWARE!
 

Attachments

  • winefi.JPG
    winefi.JPG
    75.2 KB · Views: 302
Hi !

You guys should go check Dual-booting guides for Hackintoshes. You'll be able to boot either OS without bootcamp. You will still need a boot loader and mac hardware drivers, but you will completely separate your two OSs.

I stongly recommend that whatever method you use, install your OSes on separate drives (at least until you completely master your method).

This caught my curiosity. I'm going to try for myself !

Clovel
 
Nice findings Gatzby. Why is it that you suggested to install OS X asap? And why did you need a WinPE image?

If you were to install Windows first you would be able to drink more coffee because the installer automagically boots into windows (one example).

Also, the install time and steps required can be greatly reduced by using the autounattend.xml file I linked above. It may need some slight tweaking for Windows 8 but it will get the job done. Saves the user from having to mess with diskpart!

About the GPT flag, you probably formatted the last 10GB of your SSD FAT32 am I right? I say this because as far as I know Disk Utility automatically converts the Protective MBR on the GPT disk to a Hybrid MBR when a partition on that disk is formatted with FAT32.
There is an easy fix for this though. You can use GDisk to simply restore the protective MBR on the GPT disk without data loss.
(steps noted in: http://superuser.com/questions/508026/windows-detects-gpt-disk-as-mbr-in-efi-boot)

Note for those who may say "protective mbr? i don't want mbr, i want gpt!":
A protective MBR is common practice on GPT drives to make sure older software that does not understand GPT doesn't erase a whole drive by saying "hey, no MBR, must be an empty disk!".

----------

Hi !

You guys should go check Dual-booting guides for Hackintoshes. You'll be able to boot either OS without bootcamp. You will still need a boot loader and mac hardware drivers, but you will completely separate your two OSs.

I stongly recommend that whatever method you use, install your OSes on separate drives (at least until you completely master your method).

This caught my curiosity. I'm going to try for myself !

Clovel

I think that is exactly what we're trying to do here. Though it seems the newer Macs are compatible with efi out-of-the-box, meaning this is pretty much 'mastered' on newer macs.
 
I think pretty much I wanted OS X installed on it first because I have my installer located on the actual SSD for a 3 minute Windows install. I used Windows PE as an emergency tool so I can ensure that I don't make any accidental changes to the disk. That SuperUser post would have saved me about 5 minutes. The total install for me takes about 3 minutes with Windows 8.1.

Also a key issue I faced was with Windows detecting the proper hardware. It is a really odd thing. I am assuming because I am not using the EFI shell, I am not setting registers. I am under a suspicion that if you attempt a Windows install with the Automatic Graphics Selection option checked, it doesn't turn on the Nvidia card and thus, bootcamp drivers will fail to install. When I reinstalled OS X, I noticed this setting was still unchecked despite a reinstall. I could be wrong, but I believe this setting triggers a variable in EFI and sets registers accordingly. I need to do more digging about gmux.

I only had a few successful tries with autounattend on my 2009 mac pro. I think a lot of people would be more successful trying to perform this without an autounattend file since most installs are done interactively. But yes you are correct, autounattend would save me lots of time. Another reason I did everything manually was simple for confirmation of specific criteria.

I Also agree with your hybrid MBR. However, yes you are correct I wanted a fully GPT based disk drive as this is the way I am accustomed to having my drive laid out. Call me a mule. ;)
 
About the GPT flag, you probably formatted the last 10GB of your SSD FAT32 am I right? I say this because as far as I know Disk Utility automatically converts the Protective MBR on the GPT disk to a Hybrid MBR when a partition on that disk is formatted with FAT32.

It does, and it's annoying. Disk Utility also has a tendency to just obliterate the hybrid MBR in favor of a protective MBR, also without notice to the user, causing (CSM-BIOS) Windows to become unbootable (see numerous other threads about that).
 
There is apparently an efi application circulating here for setting the PCI registers. Could someone prepare one for macbook5,2 because i don’t like to wait 5 seconds?
The command from my startup.nsh file are:

<code>
mm 0010003E 1 ;PCI :8
mm 02000004 1 ;PCI :7
</code>
 
MBP 11,3 Haswell Retina (late 2013) Intel Iris in Windows 8.1

I recently bought a MBP 15" Haswell Retina. After some experimenting it was easy to install Windows 8.1 in EFI mode. The key is to not let bootcamp do the partitioning but instead do it in the Windows installer. Basically you just need to do this:

1. Use Basecamp util in OSX to create USB with Win 8.1 and bootcamp drivers.
2. Remove any partitions created by bootcamp.
3. Basecamp can have created a hybrid MBR. If so, reset the MBR so it is not hybrid. It should just contain a protection partition for GPT. If I recall correctly I did this with the gfdisk util. Not sure this step is important but I think it works best if Windows install not sees any real partitions in MBR, so it is forced to use GPT.
4. Shrink the OSX partition so there is available space to create new partitions in Windows installer
5. Boot on the USB created by basecamp in EFI mode. You do this by holding down alt/option key and select EFI boot.
6. Windows installer should now run in EFI mode, you see this because the resolution makes everything tiny but it is still readable.
7. When the disk selection comes up, select the empty space and create new partition. It will create two partition, one 128MB MSR, and one for the rest of the space. Now select the second partition it created (not the MSR) and format it. Then select it and go ahead with the install.

Thats it!

Now my problem is that I cannot see the Intel Iris 5200 graphics in Windows 8.1, only the nvidia card is available. I want the Intel graphics since otherwise the battery time is really bad, at least compared to OSX that can use Iris. I don’t really understand why Windows should not be able to use Iris.

I have read this whole thread and there are some good info in here regarding setting the graphics card. Also the apple-gmux.c driver for ubuntu contains some good information. I have done a lot of experiments with the mm commands. Here are my current conclusions, which may not be correct, I need some help confirming this:

I boot to rEFInd and start the EFI shell, I do a pci -b and can see:

Seg Bus Dev Func
--- --- --- ----
00 00 02 00 ==> Display Controller - VGA/8514 controller
00 01 00 00 ==> Display Controller - VGA/8514 controller

So the Iris is at 00 02 00 and the Nvidia is at 01 00 00. If I then check all PCI/PCI bridges none of them has the VGA enable bit set at 3E. Also if I do pci 000200 I can see that the command register (04) has been set to (08) for Iris. The Iris is directly connected to the CPU (bus 00) and need no PCI bridge. So my conclusion from this is that I am now at this point using Iris in the EFI shell since nvidia has no bridge? Would this be correct?

If I just go ahead and boot windows now by calling the bootloader at /EFI/Microsoft/Boot/bootmgfw.efi then I would expect Iris to be available but not Nvidia. But it turns out it is the other way around, Iris is not available but Nvidia is. Why?

I have tried to use the code from the ubuntu gmux driver to turn off the nvidia. Since it is the newer gmux it requires “indexed IO” to check that each call is completed. This can be emulated by having some waits between calls. This is what I have in a startup.nsh file:

echo New version of outb(2, 0x728) = switch ddc
mm 7c2 ;IO :1
stall 1000000
mm 7d4 ;IO :28

echo New version of outb(3, 0x710) = switch internal display
mm 7c2 ;IO :2
stall 1000000
mm 7d4 ;IO :10

echo New version of outb(3, 0x740) = switch external display
mm 7c2 ;IO :2
stall 1000000
mm 7d4 ;IO :40

echo Power down discrete graphics
mm 7C2 1 ;IO :1
stall 100000
mm 7D4 1 ;IO :50
stall 100000
mm 7C2 1 ;IO :0
stall 100000
mm 7D4 1 ;IO :50

If I run this the screen goes black and nothing else happens. Specifically if I just run the last part manually in the EFI shell like this:

mm 7C2 -pci 0
…wait some..
mm 7D4 -pci 50

Then it also goes black…. Not sure how to proceed, comments from anyone with some experience would be much appreciated!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.