Jump to content


Photo

How-to: Install Ubuntu on a MacBook Pro (Retina 2013)


  • Please log in to reply
No replies to this topic

#1 John

John

    Administrator

  • Administrators
  • 73 posts

Posted 24 November 2013 - 01:49 PM

If you've got a MacBook Pro or MacBook Pro Retina (2013) then you probably know you can dual boot to Microsoft Windows via Bootcamp. But you cannot install any other operating system with Bootcamp. So how do you install Ubuntu for example and is it difficult? I'll show you how to do it and I'll also show you that it's not hard at all.
 
Before we start I want to tell you that the folks at Ubuntu did a wonderful job, because *everything* works out of the box when installing Ubuntu 13.10 or above.  So the FaceTime HD cam works, wifi works, ethernet via Thunderbolt adapter works, etc etc.
 
Let's start. First you'll need to download an ISO from http://www.ubuntu.com/download/desktop (you will need the 64-bit version), then we'll need to convert the ISO to an IMG.
In a terminal window type this:
hdiutil convert -format UDRW -o ubuntu ubuntu-13.10-desktop-amd64.iso
mv ubuntu.dmg ubuntu.img
OS X creates a .dmg automatically, that's why we rename it to .img
 
Now we are going to create a bootable USB stick for installation purposes. Run "diskutil list" in a terminal box, it will show you the devices currently connected. Insert the USB stick in your MacBook and type "diskutil list" again and see what device has been added. For example /dev/disk1.
$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh SSD           401.6 GB   disk0s2
   3:                 Linux Swap                         8.0 GB     disk0s5
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *32.0 GB    disk1
   1:        Apple_partition_map                         4.1 KB     disk1s1
   2:                  Apple_HFS                         2.3 MB     disk1s2
In the above example output /dev/disk1 is the USB stick.
 
Next we are going to put Ubuntu on the USB stick:
diskutil unmountDisk /dev/diskx (replace the x)
sudo dd if=ubuntu.img of=/dev/rdiskx bs=1m (replace the x and mind the "r" in /dev/rdiskx
This will take a while and when it's done, OS X will probably give an alert that it cannot read the device. Ignore that. The USB stick is ready now.
 
Now we are going to install a new boot loader called Refind. The installation is pretty straightforward, download the latest version (binary zip file) from http://www.rodsbooks...nd/getting.html and unpack it. Then install the bootloader via the install script:
./install.sh
The installer will prompt you with the password so it can run with administrator privileges. When the script is done, Refind is installed at /EFI/refind.
 
Warning: If you have encrypted your harddrive with FileVault, then you need to install Refind on the recovery partition. You can do this by running the installer like this:
./install.sh --esp
Now we are going to install Ubuntu. You should have free space available on your SSD / HDD to install Ubuntu. You can do this by shrinking your Mac OS X partition in DiskUtility. For more information about this, see http://macs.about.co...ilitysize_3.htm (Disk Utility - Add, Delete, and Resize Existing Volumes).
 
Reboot your MacBook and Refind should show up. Refind should see the USB stick you created before. Boot from it and select "Try Ubuntu". If you are running on a MacBook with a Retina display, then Ubuntu will boot in 2880x1800 mode. You can change the display settings to 1680x1050 (16:10) for example.
 
Because we are using EFI rather then a BIOS we want to install Ubuntu without a Grub bootloader. Open a terminal and type:
ubiquity -b
This will launch a graphical user interface and you can install Ubuntu now. Be sure to install it on the free diskspace! If you install on an unencrypted (non FileVault) disk, then Ubuntu will select "install Ubuntu alongside Mac OS X".
 
When you are done with the installation, do not reboot because we need to do some things. Select "Continue Testing".
 
We need to configure Refind and therefore we need some files and the GUID of the partition where we installed Ubuntu on. You can upload the information to a remote server or place it on an USB disk. Open the Nautilus File Manager and navigate to the /boot folder on your Ubuntu volume.
 
Copy the following files to an USB stick or upload it to a server on the internet:
initrd.img-3.11.0-12-generic
vmlinuz-3.11.0-12-generic
 
Last but not least we need the UUID of the Ubuntu Volume. In a Terminal window type the following
sudo blkid /dev/sda4
You should see something like this:
/dev/sda4: UUID="91c78bec-0ad0-42ff-8edd-f6f4ec2849a9" TYPE="ext4"
If you do not see this, then try another number behind "sda", for example sda3, sda5, etc. You'll need to find a volume with TYPE="ext4".
 
Copy / paste the UUID to a text file and save it on your USB stick or upload it on a server on the internet. Now reboot to your Mac OS X installation.
 
In the /EFI directory we need to create a new directory. Let's call it "ubuntu". You can do this in Finder, just navigate to the /EFI folder on your Macintosh HD and right click and create a new folder. So the new directory will be /EFI/ubuntu.
 
Place the files that you put on the USB disk to the /EFI/ubuntu directory.  Now we are going to edit the refind.conf file in /EFI/refind. Because we need administrator privileges we will do this in a terminal:
sudo vim /EFI/refind/refind.conf
Create a menu entry like this at the end of the file:
 
menuentry Linux {  
      icon EFI/refind/icons/os_ubuntu.icns  
      volume 5:  
      loader EFI/ubuntu/vmlinuz-3.11.0-12-generic  
      initrd EFI/ubuntu/initrd.img-3.11.0-12-generic  
      options "ro root=UUID=91c78bec-0ad0-42ff-8edd-f6f4ec2849a9"  
      #disabled  
 }  
Make sure you change the UUID to your UUID (remember you had to note it down in a text editor?). 
 
Now reboot your MacBook and boot Ubuntu or Mac OS X! 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users