Create Duel-Boot Windows on Hackintosh Drive

Create Duel-Boot Windows on Hackintosh Drive

INTRODUCTION

Installing Windows onto a Hackintosh using the installer has always been a royal pain or worse. I documented this technique for Windows 7 years ago somewhere on InsanelyMac (I think). Windows 10 uses a similar technique. I’ll try to fully explain it here. This technique will be relatively easy to accomplish on the same drive with Mac OS using APFS. I appoligize in advance for the poor quality photos. I’m working with a cell phone camera… Also, I used an old 120GB Apple SSD for the examples. It's a little tight, but it worked!

Ideally, I prefer to setup the drive for Duel Booting before installing Mac OS, reserving the space for Windows between the EFI Partition and the APFS Container used by Mac OS. When Windows is installed later, space is only available following the APFS Container. This works just as well but can be a little confusing when examining the drive layout later.

The first step is to clear some space after the APFS Container partition. I recommend a minimum of 64GB for installing Windows. Be sure to make a backup of your Macintosh before proceeding. Just in case…

CREATING THE SPACE FOR WINDOWS

Boot from your USB Installer since you’re editing the Boot Drive. Once at the Installer window appears, select Disk Utility and click Continue.

Installer Home Screen

At the Disk Utility window, go to the View menu and select Show All Devices (Cmd-2).

Show All Devices

Select the drive name above your Mac OS Volume.

Click the Partition button at the top of the window (Shift-Cmd-P). Since this is an APFS volume, you will be presented with a message that you may want to add to the APFS volume instead. You don’t want to do that, so confirm your intent by clicking the Partition button.

Ignore This. Click Partition

Press the Plus (+) button under the circular image of the drive. This will reduce your Mac volume to its minimum size based on the space used, or half the drive, whichever is larger.

Add Partition

Select the new, Unnamed partition and enter the size you wish to reserve for Windows. Name it Windows and set the Format to Mac OS Extended (Journaled). Do not format it as APFS! Click the Apply button to create the new partition. When it’s finished, exit Disk Utility by closing the window.

Define the Windows space

FREE UP THE SPACE FOR WINDOWS

Select Terminal under the Utilities menu. When the Terminal window appears, I prefer to enlarge the text to make it easier to read by pressing Cmd-Plus multiple times (Old Man Eyes).

Terminal under Utilities menu

Type:

diskutil list disk0 

If this is your primary drive, you will see 3 partitions: EFI, Container disk1 and Windows. If not, try disk1.

To clear the space for windows, enter:

diskutil eraseVolume free free disk0s3 

Remove the new Partition

diskutil list 

This will wipe the partition you just created. You need that space unused! The new listing will show the Windows partition is no longer present.

Space Released!

You are now finished with the Mac Installer. Select Shut Down from the Apple menu.

NOW FOR THE FUN PART!

I’m going to assume you’ve already created your USB Windows Installer either through Apple’s Boot Camp utility, or by other means. There are plenty of tutorials to do this. Google it, if need be.

Insert your USB Windows Installer and boot from it. Once the Language window appears, click the Next button.

Windows Installer

At the Install Now window, select Repair your computer in the lower left corner. Click Troubleshoot on the next screen and Command Prompt on the next.

Click - Repair Your Computer

Click - Troubleshoot

Click - Command Prompt

Yes. I know there are other ways of getting to the Command Prompt. Get there any way you wish!

At the X:\Sources> prompt enter diskpart and press enter to launch DiskPart.

Now type list disk to locate your target drive based on its size.

Type select disk X, where X is your drive number and list part to list its partitions. If you don’t see, System (Your EFI Partition) and Unknown (Your Mac OS Partition), you didn’t select the right disk. Try again…

Select Disk

Now you’re going to create Windows’ partitions starting with Recovery. Carefully enter the following lines:

create part primary size=450 format quick fs=ntfs label=Recovery assign letter=R set id=“de94bba4-06d1-4d40-a16a-bfd50179d6ac” gpt attributes=0x8000000000000001 

Create Recovery

Next create the “Reserved” partition. Windows expects it, so you should supply it. Don’t worry, it’s tiny.

create part msr size=16 

That’s it! Now create the “Windows” partition.

create part primary format quick fs=ntfs label=Windows assign letter=W 

Reserved & Windows Partitions

Type list part to see the end result.

You still need to give the EFI/System partition a letter.

select part 1 assign letter=S list volu 

DiskPart Result

The last line will show all mounted volumes with their associated drive letters. Now you can exit DiskPart and proceed with the install.

exit 

DOING THE INSTALL

Now the fun part! You’re finally going to install Windows 10! Carefully enter the following commands:

dism /Apply-Image /ImageFile:C:\sources\Install.wim /Index:1 /ApplyDir:W:\ /Compact /EA 

Wait for the install to finish. Now install the boot files:

W:\Windows\System32\bcdboot W:\Windows /s S: 

Save that line for later! It will fix Windows’ Blue Screen most of the time…

Finally, build the Recovery partition.

md R:\Recovery\WindowsRE xcopy /h W:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\ W:\Windows\System32\Reagentc /Setreimage /Path R:\Recovery\WindowsRE /Target W:\Windows 

The Entire Windows Installation!

INSTALL COMPLETE

You can now close the Command window and restart your computer, removing the USB Installer. Windows will launch and have you set it up. Go ahead and do your setup and updates if needed.

GETTiNG BACK TO CLOVER OR OPENCORE

Using the keyboard shortcut for your computer to select the boot drive, select the option to Launch File. Navigate to your EFI Partition, locate and select \EFI\BOOT\BOOTx64.efi.

In Clover, press the F12 key to reset NVRam.

In OpenCore, press to spacebar to reveal ResetNVRam and select it.

You should now be presented with the choice between Mac OS or Windows! Both should work. If not, you will need to edit your config.plist to add a custom Windows entry.

That’s it! In both Clover and OpenCore, you can now use System Preferences -> Startup Disk to set your Default boot.

Please comment with any corrections, critiques or questions. Thanks!

submitted by /u/ADSaxton
[link] [comments]