SDB:Installation on a Mac
This is the home page for instructions on installing openSUSE on an Apple Computer. The instructions here were originally made for openSUSE version 11.1, later updated to openSUSE Leap 42.2, subsequently Leap 15.0.
This page will describe the background and common procedures for installing Linux on an Intel Mac, and any special issues with the general openSUSE installation procedure.
While there are several different ways to set-up a Mactel to run Linux, the procedure described here is the most commonly used and most widely supported as of summer 2018.
- 1 Preparation
- 1.1 Update OS X
- 1.2 rEFInd
- 1.3 Re-size The OS X Partition
- 1.4 Download WiFi drivers
- 1.5 Making a bootable USB pen drive on MacOS
- 2 Booting From Install CD / DVD
- 3 Partitioning
- 4 Multi-Booting With Windows (pre 2012)
- 5 openSUSE Installation
This chapter describes the steps you should do before you install openSUSE on your Mac.
Remember to always back-up your data first!
You can choose to install only openSUSE, multi-boot OS X and openSUSE, or OS X, Windows and openSUSE. It is recommended that you keep OS X even if you don't intend to use it, as this will allow you to install any firmware updates that Apple releases.
If you intend to install only openSUSE, you can skip all the Preparation steps.
Update OS X
In OS X run the Software Update tool to check for OS and Firmware updates.
rEFInd manages the EFI based boot process. It is installed into one of the disk's partitions, the choice of which is up to you after being exposed to the options the rEFInd installation instructions offer. openSUSE Leap 42.3 and 15.0 overwrite the default EFI boot manager, leaving impossible to load MacOS. Therefore it is necessary to install rEFInd after installing Linux. On some of the Mac hardware a special WiFi driver is needed (see below), so best download the zip file beforehand.
NOTE: rEFInd requires one clean boot cycle to properly install. You don't need to even login to OS X, just click shutdown and the next boot screen should be rEFInd. If you have Oracle's VirtualBox installed in OS X, it will prevent that boot cycle from succeeding. Simply move /Library/StartupItems/VirtualBox (directory) out of the StartupItems, do the boot cycle, and put it back later. Ouila! Be advised other 3rd party programs may similarly prevent the full boot cycle. (May 2012)
rEFInd includes a useful tool to synchronize the GPT and MBR partition details. You should run this after any change to your partitioning scheme either in Mac, Linux or Windows. From the rEFInd initial boot screen, choose "Start Partitioning Tool", carefully read the output, and type 'y' to confirm. Be aware that rEFInd assumes an American keyboard layout. (before 2012, migrated from the old wiki)
Re-size The OS X Partition
The OS X partition has to be re-sized to make space for Linux (and Windows if desired). This can be achieved using the graphical Disk Utility. You should shrink the large system partition. Do NOT TOUCH the EFI (and recovery if it exists) partitions.
Using Disk Utility in OS X 10.5 Leopard or OS X 10.6 Snow Leopard (pre 2012)
This is the recommended method as it both natively shrinks the HFS+ partition and writes a guaranteed valid GPT partition table. Under Applications / Utilities or using Spotlight launch the Disk Utility and resize the OS X partition to the required size. It is also recommended that you set up your chosen partition scheme for Linux and Windows here as well to ensure your GPT partition table is valid. Simply create all the required partitions in the required size and set the type to HFS+, except for your intended Windows partition which you should make NTFS. See the notes on Partition Schemes below.
Using BootCamp in OS X 10.5 Leopard or OS X 10.6 Snow Leopard (pre 2012)
Bootcamp provides a simple GUI to split the exisiting OS X drive into two partitions, non-destructively shrinking the first partition for OS X and creating a second partition as FAT32, which can be re-partitioned later as you require. Once finished partitioning, exit BootCamp without installing Windows, even if you plan a triple-boot set-up. The Disk Utility method is preferred as it is more flexible.
Using diskutil in OS X 10.4.6 or later (pre 2012)
BootCamp was originally released in beta form for OS X 10.4, but is no longer available for download. An alternative is to use the Mac OS X program diskutil. The ability to non-destructively re-size volumes was added to diskutil in OS X 10.4.6 (for more information see macgeekery.com).
The following command example assumes that "disk0s2" is the OS X partition and will resize it to 60 gigabytes):
$ sudo diskutil resizeVolume disk0s2 60G Started resizing on disk disk0s2 Mac OS X Verifying Resizing Volume Adjusting Partitions [ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ] Finished resizing on disk disk0s2 Mac OS X /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *149.1 Gi disk0 1: EFI 200.0 Mi disk0s1 2: Apple_HFS Mac OS X 59.9 Gi disk0s2 $
Warning: this may or may not work depending if your partition has been re-sized before.
Disable journaling in MacOS, boot to Linux, use Parted to re-size the MacOS partition and turn journaling back on in MacOS and have the filesystem checked.
Download WiFi drivers
Some of the mac wireless cards may not be supported by open source drivers. if you have no wired connection to the internet, you should download the driver beforehand. otherwise you can skip the following and use yast later. There is a relatively complete list of macs and their hardware support on ubuntu help. You can find your Mac version by:
- Open "About This Mac" under the Apple menu
- Click the "System Report" button
- The "Model Identifier" will be in the default dialog.
The closed source driver is called broadcom-wl in openSUSE and bcmwl-kernel-source in Ubuntu based distributions. There are two (!) packages to install, one of them is a kernel module and needs to match the kernel version.
Making a bootable USB pen drive on MacOS
On MacOS you can also use dd, but the command is slightly different:
dd if=/downloaded/iso/file.iso of=/dev/rdisk42 bs=1m
Note that of goes to rdisk (otherwise it can take hours) and the bs takes small letters instead of capital ones.
Booting From Install CD / DVD
To make your Mac boot from a Linux or Windows CD or DVD, you need to hold down the 'Alt' key as the Mac starts up (EFI-Boot), keep holding it down until it is obvious the CD is booting (pre 2012).
On a MacBook Air (booting from a pen drive) the alt/option key needs to be pressed. Boot to the installation via the EFI method (you should see a selection after pressing the alt/option key).
All that is needed is to ensure that:
- The first partition (/dev/sda1) is kept for the EFI boot partition, do NOT delete or format. However it MUST be mounted in /boot/efi during Linux installation.
- The second partition (/dev/sda2) is kept for OS X, do not delete or format.
- The third partition (/dev/sda3) is kept for GRUB, so use for either Linux / or /boot
- The fourth partition (/dev/sda4) is kept for Windows
- The fifth and subsequent partitions are used for Linux as required, e.g. /, /home, /tmp, swap, etc.
- There is a an EFI Grub option that should be selected automatically. However, ensure that it is. Do NOT under ANY circumstances overwrite the first partition. Go through EVERY page in the GRUB page of the installer and make sure of that. (In case you wonder what would happen: As far as I understand, EFI boot managers stop working, which includes the one from MacOS. I was able to boot into recovery, then crashed the complete EFI partition (also called ESP) and somehow managed to restore it in just a day.)
- OS X can actually be on any partition other than the ESP, but is easiest left where it already is. As with Linux, or Windows for that matter, OS X can have more than one partition, such as one for the operating system, and another for user data analogous to /home.
- Most references to specific partitions here assume that Linux (and Windows) would be added to an existing Mac OS installation. It's just as possible to install to a new or wiped disk openSUSE first, then Windows then Mac, or Windows, then Mac, then Linux, or Linux, then Mac, then Windows. The important points are creation of an ESP partition at the start of the disk, and smart allocation of space on the rest of the disk. I decide in advance what partitions to create, what size, and where, and create them before starting the first OS installation. One can just as well use the openSUSE installer's partitioner to either create them all before installing any OS, or just create the ones openSUSE will use, leaving blank space for others.
Multi-Booting With Windows (pre 2012)
You can multi-boot your Mac with OS X, Windows 7, 8, and/or 10, and Linux. If you want to do this, it is commonly advised to install Windows first before openSUSE. You will need to re-partition the hard-drive to your chosen scheme for Windows AND openSUSE before you install Windows.
It is strongly recommended to use the built-in OS X Disk Utility as this will guarantee a valid GPT table. Alternatively use a Linux Live CD with a GPT capable partition tool (parted > x.x.x), such as openSUSE >= 11.1 or Ubuntu >= 8.10 or Mandriva >= 2010 to boot your Mac and set up your partition scheme (see partitioning below).
Now proceed with your Windows install. You cannot use BootCamp to do this, as it only supports a Mac/Windows partition scheme. Instead boot your Windows install CD directly. Ensure you have either a full Windows install disk, or if you have an upgrade disk a second external CD drive, as you cannot manually eject the main install CD on most Macs when required to insert your original licensed disk. Afterwards install the Mac drivers from your OS X install DVD.
Once Windows is installed, you can then proceed with your Linux install.
The normal openSUSE installation process is followed so is not covered here in detail. This section will only discuss where the Mac install differs from the normal.
kepp in mind that
- The first partition (/dev/sda1) is kept for the EFI boot partition, do NOT delete or format. It MUST be mounted in /boot/efi during installation.
- Install into the space that you previously made in MacOS.
- In the summary before starting the actual installation process, open the GRUB page. There is a an EFI Grub option that should be selected automatically. However, ensure that it is. Do NOT under ANY circumstances overwrite the first partition. Go through EVERY tab in the GRUB page of the installer and make sure of that.
when the system is installed, unpack the refind zip and run refind-install as root
Once the installation process is finished, you may encounter a boot message about firmware issues, like the one below:
b43-phy0 ERROR: Firmware file "b43/ucode16_mimo.fw" not found b43-phy0 ERROR: Firmware file "b43-open/ucode16_mimo.fw" not found b43-phy0 ERROR: Please open a terminal and enter the command "sudo /usr/sbin/install_bcm43xx_firmware" to download the correct firmware for this driver version. For an off-line installation, go to http://en.opensuse.org/HCL/Network_Adapters_(Wireless)/Broadcom_BCM43xx and follow the instructions in the "Installing firmware from the RPM packages" section.
As of this writing, these instructions are not entirely complete: after installing the firmware as directed, you must run sudo mkinitrd to ensure that the firmware is loaded at the appropriate time during the boot process. (This extra step may be resolved in a future bugfix.)
Once that's done, you can install the WiFi drivers from the USB pen drive via Software Management (right click and open on the RPM in Dolphin) or Zypper. Note that the packaging system will complain that the RPMs are broken. this is because the signing key is not installed in the system. Note also, that Software Management will complain about missing dependencies (the two packages require each other and Software Manager does not look into the directory), just press ignore.
if you have problems with wifi after a suspend, this needs to be executed
rmmod wl; modprobe wl;
on Linuxmint, pm-utils deals with calling it, but i believe openSUSE uses a different system.
On certain models (like MBP 2015) the WiFi driver is installed by default. Sometimes YaST doesn't recognize it during the installation though. The solution for this is opening YaST, then Network Configuration and selecting "use Network Manager" instead of Wicked service. After the reboot, WiFi should work.
Keyboard Issues (pre 2012)
It has been reported that sometimes the built-in keyboard of the MacBook and Macbook Pro is not recognized during the boot. If the openSUSE install menu (with install/rescue/options) hangs on the 'boot from hard-drive option', try rebooting your MacBook. A workaround is connecting a USB keyboard to your MacBook when the installation menu starts.
The keyboard backlighting will certainly work but needs some help. I have successfully compiled lightum. You will need to add these packages (pre 2012, worked fine in Leap):
Compile as root, run it as user. Test with a "-f" for foreground -> lightum -f
If the webcam doesn't work (try starting `cheese`), and is a FaceTime Camera:
user@macbook:~> sudo lspci | grep -i facetime 05:00.0 Multimedia controller: Broadcom Limited 720p FaceTime HD Camera
Then there are drivers which may well work.
sudo zypper install kernel-devel cd /tmp # or wherever you keep developer repos git clone https://github.com/patjak/bcwc_pcie.git cd bcwc_pcie/firmware make sudo make install cd .. make sudo make install sudo depmod sudo modprobe facetimehd
After that, in the "sudo lspci -vd 14e4:" output (14e4 is the Broadcom vendor ID), you should see the Facetime HD Camera with "facetimehd" in the "kernel driver in use" field.
Suspend to RAM
There is an issue with the backlight in MacBook Airs 6-x as the brightness setting stops working, documented here, including a solution. there are OBS packages for Leap 42.3 and 15.0 and Tumbleweed, you can install via one click install.
If you are testing suspend and the display is dark after wake up, try to make it brighter with the keyboard. Try with and without Fn key, because the function can be swapped. Try pressing it often, because you don't see whether it's changing something or not.
i had problems with the laptop waking up seconds after the suspend.
for i in $(cat /proc/acpi/wakeup | grep enabled | grep -o -E "^[A-Z0-9]+"); do echo $i > /proc/acpi/wakeup; done
This needs to be executed at every start of the system. i switched to Linuxmint and put it into /etc/rc.local, not sure it also works in openSUSE. the laptop does not wake up automatically anymore if you open the screen or press a random button, but the power button does work. not that on some hardware you could get problems because you are basically switching off the events that can wake the system up. but in the worst case you have to wait until the system drains the battery, and the hardware reset should always work.
- To reduce energy consumption, I recommend the installation and activation of tlp (it is in the default repositories, but needs manual activation in system services is WONTFIX).
- there are more power saving options for Mac laptops here (that is specific for MacBookAir6-2, but others are probably similar. i'm still testing).
- there is more documentation on the apple keyboard, including a link to a patch for switching Fn and Ctrl buttons. Not that if you only want to switch command and alt button, that's also possible by default in KDE's System Settings -> Input devices -> Advanced -> Configure keyboard options -> Alt/Win key behaviour -> Alt is swapped with Win.