How to install Ubuntu dual system on Mac

Do not believe in Ubuntu’s official site on this

Ubuntu + MacOS

Motive

Although I have installed Ubuntu in VMware, the virtual machine has a vital problem, that it cannot solve hardware problems. It fails to recognize most externel devices that are intended for Linux. In order to develop and test on hardware platforms (which is exactly why I am using Ubuntu!), we end up with no other choice but to install a dual system.

Introduction

I use a Macbook Pro with El Capitan System. Ubuntu 14.04.4 was installed. System matters really much as Mac is constantly chaging some of its bottom system configurations and what we are going to do is so bottom as to reach those changes, which are otherwise inperceptible.

This is not difficult by nature, however, we are running high risks due to the fact that we are alternating the entire disk of our Mac. I, for example, ended up erasing the entire disk before I could get back to my Mac that is functioning. I would say thanks to Apple’s TimeMachine team and I would strongly recommend y’all to complete a total backup before tending on this.

Most information of this tutorial can be found online. I will include all the references, however, no single tutorial I found online was completely functionable, so I ended up mixing up several tutorials. I will include all essential information in this tutorial though, as content online is constantly changing and linkings can go out. So do not go to those linked sites unless you have come across any problem.

As of July 2017, I would suggest you not trust Ubuntu’s official site as its guide was utterly malfunctioning on my mac, along with many other peoples’, according to my research.

Basically, the installation can be decomposed into several small steps as follows:

  • Partitioning Mac’s disk
  • Creating a bootable USB Ubuntu installer
  • Finding a proper way to enable users to choose between two systems when booting
  • Installing ubuntu from the USB installer
  • Testing and solving problems on installed Ubuntu

Step 1: Partition

Also see Lifewire’s tutorial.
Partition

We will only create one partition. Reasons see below.

Simply use DiskUtility on Mac to partition a small portion and name it as you like. I allocated a 30 GB space for my Ubuntu. Follow the picture above as to configuration choices.

Why Create Just One Partition Now?

We’re going to use the disk partitioning utility included with Ubuntu to actually create the needed storage space. What we need the Mac’s Disk Utility to do for us is define that space, so it’s easy to select and use when installing Ubuntu. Think of it this way: when we get to the point in the Ubuntu install where the drive space is assigned, we don’t want to accidentally choose the existing Mac OS drive, or any of the Mac OS data drives you use, since creating the space will erase any information on the selected volume.

Instead, we’ll create a volume with an easy to identify name, format, and size that will stand out when it comes time to select a volume for the Ubuntu installation.

There’s one more reason from DigitalOcean:

Although swap is generally recommended for systems utilizing traditional spinning hard drives, using swap with SSDs can cause issues with hardware degradation over time. Due to this consideration, we do not recommend enabling swap on DigitalOcean or any other provider that utilizes SSD storage. Doing so can impact the reliability of the underlying hardware for you and your neighbors.

As my Mac uses SSD instead of HDD, I will follow DO’s suggestion on this and not create a swap disk for it.

Step 2: Creating USB Installer

This answer will help us create a really bootable USB installer on Mac. I have tried unetbooting in different ways but they did not work.

  • Download Ubuntu Desktop
  • Convert the .iso file to .img using the convert option of hdiutil:

    hdiutil convert -format UDRW ~/path/to/target.iso -o ~/path/to/ubuntu.img
    

Note: OS X tends to put the .dmg ending on the output file automatically.

Run diskutil list to get the current list of devices
Insert your flash media
Run diskutil list again and determine the device node assigned to your flash media
(e.g. /dev/disk1)

Run:

diskutil unmountDisk /dev/diskN

(replace N with the disk number from the last command; in the previous example, N would be 1)

Execute the following command while replacing /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).

sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m

Step 3: Use rEFInd as the Boot Manager

Mac does not have a boot manager that can support Linux. So I used Ubuntu’s grub as the boot manager in my first installation. The consequence was, when my Ubuntu went wrong, I could no longer log into my MacOS. This is terrible and even if your Ubuntu does well, it makes you feel unsafe thinking that the booting of your entire computer relies on some extruder. When the computer finaly goes wrong (which it often does in our situation), we still have to resort to Mac’s own mechanism to restore it, so it would be better to rest our boot manager within MacOS in the first place.

The installation instruction on Lifewire works fine this time. We would use a third-party manager installed on MacOS to help us with this.

First, disable SIP (which is a new feature of El Capitan). We need to first enter Mac’s recovery mode (reboot and press & hold cmd+R; if failed then reboot and press & hold opion key, then choose the recovery disk). Open terminal (select DiskUtility first then select terminal in the menu). Type csrutil disable. Restart. Now SIP is disabled.

We then download the rEFInd beta, an EFI boot manager utility in our normal system. After that, extract the zip file and run the executable refind-install. Now rEFInd is installed.

Last, we can enable SIP back again. Go to recovery mode and run csrutil enable.

Step 4: Install Ubuntu from USB

Finally we come to the step of installation. Plug in the USB drive and reboot the computer. Since rEFInd is already installed, we might be able to see the USB drive (EFI Drive). This is what they say. However, in my case, I still could not see it. I solved this by pressing option key and manually boot into the USB.

Select ‘Try Ubuntu without Installing’ at the next interface. Actually we can install directly, but this choice seems safer and can help us see if our Ubuntu has any problems. Click the app on our desktop to install Ubuntu into our computer disk. In my case, I did not tick the ‘download updates’ or ‘install third party’, since update could be done after installation. And my Mac also encountered a problem in installation last time because of the bcmwl-kernel-source installation. See this thread, that is the exact problem I encountered.

In the next page, we select ‘do something else’, and find the disk that we allocated for our Ubuntu previously. Click on it and click ‘change’, apply ext4 journalling file system. In the mount point box write ‘/‘ without the quote. For the bootloader, just use the default. Then click ‘continue’ to proceed, all the way till the system is installed.

Last, we click ‘reboot’ as prompted by Ubuntu installer. Done!

The Linux Penguin

Note: There might still be problems with our wireless net and other various issues. But since they can be solved using google, we will not discuss them one by one here. Enjoy your Ubuntu!

Share