2017-10-30 10:27:15

========================================
Installing Windows and Linux together on a Mac.
========================================
1. Introduction
So, hello and welcome in my first guide. I will show you how to install Linux and Windows together on a Mac computer. Doing triple boot is also possible, if you would like to keep MacOS, but I lack knowledge to provide the detailed instructions.
2. Prerequisites
*A Mac computer, of course smile
*Two pendrives, unless you have a second computer.
*An external sound card, (Macs before 2014 don't support sound in Windows when its installed in EFI mode)
*An ethernet connection (only during the installation)
*A legal Windows copy, it can be bound to your hardware.
*It also helps, if you have a place to back up your data.
2. Let's download and burn our operating systems!
So, if you meet al the requirements, we can start preparing our USB drives with Linux and Windows.
In this example, I will be using Antergos as the Linux distribution, from the operating systems I have tested, this one has the best Mac support.
You can get it from
http://antergos.com
Windows is easily optainable from Microsoft, so I will skip this step.
I will also skip steps for burning the Linux image, as it is different for each host operating system.
For burning the Windows image, it is recommended to use diskpart, as some files needs to be removed.
So, if you have the Windows image downloaded, enter diskpart
Win R
cmd
diskpart
list disk
sel disk disknumber (where disknumber is the number shown in the previous command. Make sure it's your pendrive, otherwise you will lose your data)
clean
convert gpt
format quick fs=fat32 label=disklabel (where disklabel is the name you want to call your disk)
exit
exit (to exit diskpart and the main cmd)
Then, mount the ISO image of Windows and copy all files from it to the USB stick, and remove bootmgr and bootmgr.efi files from it.
Our Windows stick is now prepared, keep in mind, that even if it's the latest version of Windows10 you won't have speech unless you plug in the external soundcard.
3. Let's install Linux!
OK, so I assume you have your data backed up, as we will be converting the partition table from hybrid MBR to GPT.
*Boot your PC from the Linux stick
#1. Shut down your mac
#2. Plug in the pendrive with Linux
#3. Power on your mac
#4. When you hear the ding sound, hold down left alt key for about 10 seconds
#5. Press left arrow once and enter to boot the computer from external drive.
#6. Wait about a minute to allow the system to load, then press alt f2, type orca and press enter.
The speech might be quite quiet, press f12 to turn up the volume.
As the antergos installation can be a bit tricky with the screenreader, I will try to explain it  alittle.
You will be asked if you want to install Antergos, select no, then press alt f2, type gnome-terminal and press enter.
While in the terminal window, type cnchi and press enter.
You will be placed in the installer's window. The first box is used to select your language, you do it by pressing up and down arrows. When you are done, press ctrl tab and then enter on the button.
The next step is a bit tricky, because here the hardware tests are performed.
Wait about 30 seconds, press alt tab and go back to the window again.
here the tab key might not work, if this is the case, use Orca's object navigation to select the second unlabelled button.
Then, the installation is straightworward, but we will have to partition our disc soon.
If you have the GPT partition table, you can skip the below step.
If you are running the mBR partition table, you will have to convert it to gpt by selecting "new partition table" button and selecting GPT.
***Warning***
This will remove all of your data from the hard disc!
OK, I assume you have your table converted, now we can start partitioning.
keep in mind that you will be installing Windows on the same HDD so leave some place for it.
You have to create two partitions. The first one is where your data and Linux itself are kept. It should be mounted at the default place, just leave the mount point as it is.
It should be ext4 filesystem. Ext4 should be selected by default, but you can check if it's really ext4.
The second partition must meet the following requirements.
*The size should be 576 MB
*The filesystem should be FAT32
*The mount point should be /boot/efi.
OK, if the partitions are created correctly, select the second unlabelled button.
I recommend you select the gnome desktop as your default, I will cover this in detail in the next article about Linux.
After the system is installed, select the reboot option.
Wait about 2 minutes for the system to reboot and you will be placed in the lightdm log in screen.
Press enter and type your password to login.
Then, press alt f2, type orca and enter.
You should have speech. Next connect to your wi-fi network if you want.
OK, so the Linux side of things is properly configured, now we can move on.
4. Installing the rEFInd boot manager.
As you probably know, Mac's hardware is quite differend from the computers you have probably seen. It means, the special steps need to be taken in order for the dual boot to work correctly.
Thanks to Roderick Smith we have very good, flexible and blind accessible rEFInd boot manager. Using this tool, we can safely install Windows and Linux on a mac!
*Getting rEFInd.
rEFInd can be optained from the following link
https://sourceforge.net/projects/refind/files/
We are interested in the Unix binary, don't download the rpm or deb packages.
*Installing rEFInd
If you have downloaded the file, extract it and open the folder in your terminal.
If you are in rEFInd's main folder, execute the following command
chmod +x ./refind-install
This will make the ./refind-install script executable.
Then execute the following
./refind-install
The script will ask for the password, type it and press enter.
Read the log carefully to make sure the installation went well.
You can reboot to check if the rEFInd menu will pop up. If yes, press enter to boot to Linux again.
5. Installing Windows
So, hopefully we have the boot manager installed and working.
Now, we can install Windows.
Boot in to Windows same as we did with linux, but remember, you have to plug in the external soundcard.
Windows installation is easy, so I won't cover it in detail, but I just want to point out some things.
*Remember to not accidentally overwrite your linux installation
*This is not Linux, you won't have wi-fi access unless you install the bootcamp drivers.
*After the first restart, the computer won't load. Here's how to workarround this problem.
Shut down the computer with the power button, if it's stuck on the white screen.
Power it and enter the boot menu as we did twice already
Press enter twice to boot the computer from the hard disc.
Now the installation will go well.
6. Repairing rEFInd
After the installation and basic configuration of Windows, it's time to go back and play some more with Linux, but how?
As some of you might already know, Microsoft has its own bootloader which overides rEFInd or any other boot loader we can have installed on our computers.
We will have to reinstall rEFInd from the chroot environment.
#1. Boot from the Linux stick as we did before
#2. Mount your EFI partition. You can check which one it is by executing the lsblk command. You will recognise the EFI partition, because it will be 576 MB in size.
mount /dev/sdax /mnt where x is the number of the efi partition.
#3. Remove the rEFInd directory
sudo nautilus /mnt
Right arrow to EFI
enter
Right arrow to rEFInd
Shift delete, confirm
#4. Clear your NVRAM.
In order to clear the NVRAM entries, do the following
*power off your PC
*Power it back on
*After the ding sound, hold down windows, left alt, r and p keys till you hear the sound again.
#5. Reinstall rEFInd.
*Boot the Linux stick again
*Mount your main Linux partition, use the lsblk command to find out which one it is.
mount /dev/sdax /mnt
*Chroot to your HDD system
sudo arch-chroot /mnt
*Move to the directory where you have the rEFInd installation files.
cd /home/username/Downloads/foldername
*Execute the ./refind-install script.
#6. Reboot and enjoy!
Now, your rEFInd is properly installed. When your PC will boot up, you will be presented with rEFInd's main menu.
The menu is non wrapping so you can go some times left and the first option will be Linux, the second option will be Windows, third and fourth are the operating systems again, fifth is booting from the USB (method above will also work) and the sixth option is the memory test.
7. Conclusion
After properly following this article, your dual boot should work correctly.
If you have any questions feel free to mail me at nuno at nvps dot pl. Replace at and dot with @ and ., respectively.
I would like to say a very big "thank you" to one of my teachers. Without her. this article would never be created because I wouldn't have my dual boot set up correctly.
I would also like to thank you Roderick Smith for rEFInd. Without him, booting Linux and Windows together wouldn't be possible at all!
Also thank you to my friends who taught me Linux smile.
And last but not least, thank you, dear Reader for stopping by and reading this article!

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com