Foreword
Apple Intel and recent PC computers use a newer incarnation of BIOS called (U)EFI. When Windows 7 was released in 2009, (U)EFI was still new technology; it can understand most of what is going on with one exception: very early in the boot process it tries to communicate with the graphics card using 1980s calls. Most PCs and earlier Macs have a compatibility layer that accommodate these calls but Apple decided enough is enough and removed this legacy code from its recent machines. Unable to initialize graphics the old way, Windows 7 hangs.
(See a more thorough explanation by @d3vi1 here.)
The Workaround
I wrote a little app that:
Requirements
By following this guide you should end up with a dual booting OS X + Windows setup where Windows gets assigned the majority of HDD space. If you need a different config, modify accordingly. The guide is pretty detailed to enable as many people as possible to follow; sorry if it's too verbose for your level.
Prepare an OS X install USB
May not be necessary but this is what I did at the very beginning. Follow any of the many guides on the web; I used this one.
Partition Mac Hard Drive
You can download the entire pack here. Alternatively, Bootcamp 5.1.5769 may be downloaded from Apple website; Bootcamp 6.0.6133 is unfortunately only available via the Boot Camp Assistant OS X app or on torrent sites. Either way, this is what I installed on MacBookAir7,2:
- As far as I am aware this is the first successful attempt at getting Windows 7 to natively run on Air Early 2015.
- What I present here really is a case of standing on the shoulders of giants and would not be even remotely possible without several projects and individuals credited at the end of this post. Hats off to them for sharing their knowledge and code with others!
- This is not the solution. It is not even a solution but more of a workaround. It is a little hacky, requires some computer literacy to pull off, comes with a few caveats, and could be a lot more elegant. While it worked for me it may not work for you (diferent hardware or firmware) or will not work for the future you (if Apple updates its firmware to shut the door once and for all). Set your expectations accordingly.
- Needless to say, this method is not supported by Microsoft or Apple. I will try to help as much as I can but I no longer have the Air or other recent Apple machines to test.
- This works on MacBook Air 13" Early 2015 A1466 i5-5250U. I aimed to make it as general as possible so it should work for all configurations in the Early 2015 family and perhaps other models. While we may be able to tweak the binaries to work with other models, I personally have no other machines to test.
- TL;DR: you'll be far better off upgrading to Windows
Spy Edition10
Apple Intel and recent PC computers use a newer incarnation of BIOS called (U)EFI. When Windows 7 was released in 2009, (U)EFI was still new technology; it can understand most of what is going on with one exception: very early in the boot process it tries to communicate with the graphics card using 1980s calls. Most PCs and earlier Macs have a compatibility layer that accommodate these calls but Apple decided enough is enough and removed this legacy code from its recent machines. Unable to initialize graphics the old way, Windows 7 hangs.
(See a more thorough explanation by @d3vi1 here.)
The Workaround
I wrote a little app that:
- Pretends to Windows 7 the initialization stuff it wants to do gets done.
- Responds to Windows 7's legacy queries about video mode enabling it to draw stuff on screen.
- Displays Windows boot animation.
Requirements
- Two pendrives (8GB or more for El Capitan, 6GB or more for Windows).
- Access to OS X 10.6 or later (can be the one you want to install Windows on).
- Access to Windows where you can get local admin rights.
- Windows 7 SP1 x64 install CD or ISO.
- VgaShim (download a release from GitHub or build from source).
By following this guide you should end up with a dual booting OS X + Windows setup where Windows gets assigned the majority of HDD space. If you need a different config, modify accordingly. The guide is pretty detailed to enable as many people as possible to follow; sorry if it's too verbose for your level.
Prepare an OS X install USB
- Download El Capitan installer from the Mac App Store and follow any of the many available guides to create a bootable USB installer. (I had luck with method one in this guide. If you have a more recent OS X you should also be able to use DiskMaker X.)
- Make sure it boots before proceeding.
- Download the required files:
- Latest Intel USB 3.0 Windows 7 x64 drivers (v4.0.4.51 at the time of writing).
- Hotfix KB2775511 (this makes Windows happy about Apple Bootcamp drivers' digital signature) from Microsoft or web (google the exact filename AMD64-all-windows6.1-kb2775511-v2-x64_ec18cc10e27faf443c17e7a8073c9eba773eb13e.msu).
- do_boot.wim.bat.txt and do_install.wim.bat.txt attached to this post; remember to remove the .txt extension.
- Prepare folders and files for integrating USB 3.0 drivers and the above hotfix into Windows 7:
- Create a C:\inject, C:\inject\drivers and C:\inject\hotfixes folders.
- Copy AMD64-all-windows6.1-kb2775511-v2-x64_ec18cc10e27faf443c17e7a8073c9eba773eb13e.msu to C:\inject\hotfixes.
- Unzip USB 3.0 drivers somewhere and copy contents of Drivers\HCSwitch\x64 and Drivers\Win7\x64 to C:\inject\drivers.
- Copy sources\boot.wim and sources\install.wim from your Windows 7 SP1 x64 CD or ISO to C:\inject.
- Copy do_boot.wim.bat and do_install.wim.bat to C:\inject.
- Your C:\inject folder structure should now look like in the screenshots.
- Perform actual integration:
- Make note of the size of your boot.wim and install.wim files.
- Right click do_boot.wim.bat and run it as administrator.
- Right click do_install.wim.bat and run it as administrator. You will be asked which of the Windows 7 install images (Home, Professional, etc) stored inside install.wim you want to modify. The script will also try to copy bootmgfw.efi to your desktop which you will need later.
- Make sure the size of boot.wim increased by about 10MB and that of install.wim by about 250MB.
- Prepare an EFI-compatible pendrive:
- Connect your pendrive.
- Open administrative command prompt.
- Run diskpart
- list disk
- Check what number was assigned to your pendrive by looking at disk sizes.
- select disk <number>
- clean
- convert gpt
- create partition primary
- format fs=fat32 quick
- exit
- (Finally!) Copy the right files on your pendrive:
- The entire contents of your Windows 7 CD with the exception of sources\boot.wim and sources\install.wim.
- C:\inject\boot.wim and C:\inject\install.wim to sources.
- Copy bootmgfw.efi from your desktop to efi\microsoft\boot.
- Rename VgaShim.efi to bootx64.efi, VgaShim.bmp to bootx64.bmp and copy both files to efi\boot (you will need to create this folder).
- Create an empty file or copy a small file of a known name to the root of your pendrive. It is there only so that you can easily recognize your pendrive just by looking at a file listing. (I created a file named HELLO.)
May not be necessary but this is what I did at the very beginning. Follow any of the many guides on the web; I used this one.
Partition Mac Hard Drive
- Make sure you've backed up all your data on the target MacBook.
- Boot from your OS X install media.
- Run Utilities > Disk Utility.
- Click Partition.
- Configure your drive to have two partitions: one for OS X, formatted as "OS X Extended (Journaled)", and one for Windows also formatted "OS X Extened (Journaled)". This is important because if you format it as FAT32, Disk Utility will create a hybrid MBR and Windows 7 will refuse to install on a non-pure-GPT. (See screenshots.)
- Boot from your Windows 7 install media.
- It will show a blank screen for the first 30 seconds as it loads the WindowsPE environment but should then display the familiar setup welcome screen.
- If your touchpad or keyboard do not work you did not integrate USB 3.0 drivers correctly — both devices are internally sitting on the USB bus.
- Do not press any installer buttons but Shift+F10 to bring up a command line window. We will need to tell setup where your install.wim file is located because otherwise it complains about not being able to find it; this is where the empty HELLO file will come in handy.
- Run dir c: to list files on this volume. If you do not see your magic file, try dir d:. If that does not work you can run diskpart and then list volume to list all available letters.
- Run setup /installfrom:<your letter>:\sources\install.wim
- Choose your language, accept license, select Windows version you want to install and then Custom (advanced) to access disk partitioning.
- Select the Windows partition you created earlier using Disk Utility.
- Click Drive options (advanced) to see all options and then Format the partition.
- Click Next and watch Windows copy and unpack files.
- When it reboots immediately press left option key so that you do not let Windows finish installation at this point. We have some business to take care of first.
- Remove your Windows 7 install media, plug OS X install media and boot from it.
- Install OS X on the OS X partition you created earlier using Disk Utility.
- When it asks you for password, do specify one — otherwise Terminal will complain when you try to run commands as superuser.
- Boot into OS X.
- Open Terminal and mount the hidden ESP partition which holds the boot loader:
- mkdir /Volumes/esp
- sudo mount -t msdos /dev/disk0s1 /Volumes/esp
- Plug your Windows 7 install media.
- In Finder copy the efi\boot folder from Windows 7 install media to the EFI folder on the ESP volume you just mounted.
- In the Terminal window run sudo bless --mount /Volumes/esp --setBoot
- Reboot your computer, this time not holding any option keys. You should see the Windows flag quickly animate (this is VGA Shim doing its business in the background) and then Windows completing the installation, eventually booting into desktop.
- Install latest Intel HD 6000 (v15.40.10.4300 at the time of writing) and then all other Bootcamp drivers. You can find a list of what I used below.
You can download the entire pack here. Alternatively, Bootcamp 5.1.5769 may be downloaded from Apple website; Bootcamp 6.0.6133 is unfortunately only available via the Boot Camp Assistant OS X app or on torrent sites. Either way, this is what I installed on MacBookAir7,2:
- Apple Null Driver v5.1.4.0 from Bootcamp 6.0.6133
- Apple Camera v5.0.22.0 from Bootcamp 5.1.5769
- Apple Keyboard v5.1.6160.0 from Bootcamp 6.0.6133
- Apple SD Card Reader v1.0.0.1 from Bootcamp 6.0.6133
- Apple Trackpad v5.1.5900.0 from Bootcamp 6.0.6133
- Cirrus Audio CS4208 v6.6001.3.24 from Bootcamp 6.0.6133
- Broadcom USB Bluetooth v6.0.6100.0 from Bootcamp 6.0.6133 $WinPEDriver$ folder, v12.0.1.700 should also possibly work
- Broadcom BCM4360 wifi v7.12.39.28 from the web
- Intel Chipset INF Update v10.1.1.14 from Intel website
- Intel HD 6000 v15.40.10.4300 from Intel website
- Intel Management Engine v11.0.0.1202 from Intel website
- Boot Camp Control Panel (BootCamp.msi) v5.1.5769 from Bootcamp 5.1.5769
- As on many other EFI computers, hibernation does not work.
- Full screen DOS apps may not work anymore (say bye to Prince of Persia).
- You will need to be careful when updating GPU drivers.
- Not sure if Microsoft memtest works, did not try.
- Boot animation. The supplied bootx64.bmp boot animation was pulled from Windows 7's bootres.dll. It can be:
- Replaced with any other animation. The file is assumed to have floor(long_side / short_side) frames of size short_side × short_side. Frames can be stacked either top-to-bottom or left-to-right. Each frame is displayed for approx. 20ms. File has to be a 24-bpp, uncompressed Windows bitmap.
- Replaced with a square logo. File has to be a 24-bpp, uncompressed Windows bitmap.
- Removed, and then a built-in static logo (final frame of the supplied bootx64.bmp) will be displayed.
- Debug mode. If you keep 'v' (for 'VGA Shim') pressed during boot, you will enter debug mode that will tell you what the program is doing. Can be useful if it does not seem to work correctly or when we try to make it work on machines other than MacBook Air Early 2015.
- Safe Mode. Works as expected but you need to keep pressing F8 even though you see the boot animation being played. The program will detect the F8 keypress, display a message and switch to text mode to enable Windows Boot Manager to display its prompts.
- my wife for her patience over many coding evenings
- ReactOS for sharing code that helped me understand what Windows is trying to do
- Tianocore / EDK II / OVMF for making EFI app development possible and source of a similar workaround
- @d3vi1 for essential initial research
- @rockinrobstar for his DISM wiki
- @Pockets69 for accompanying me along the way
- Microsoft and Apple for for making this enjoyable journey necessary
Attachments
Last edited: