Sunday, 2 June 2013

Dual boot OSX and Ubuntu

This has been one of the least pleasant Linux experiences, but then aren't they all!

As Mike Orr put it:

Linux Air
Disgruntled employees of all the other OS airlines decide to start their own airline. They build the planes, ticket counters, and pave the runways themselves. They charge a small fee to cover the cost of printing the ticket, but you can also download and print the ticket yourself. When you board the plane, you are given a seat, four bolts, a wrench and a copy of the Seat-HOWTO.html. Once settled, the fully adjustable seat is very comfortable, the plane leaves and arrives on time without a single problem, the in-flight meal is wonderful. You try to tell customers of the other airlines about the great trip, but all they can say is, "You had to do what with the seat?"

Many sites cheerfully claim that there is no problem dual booting a mac to run Ubuntu. eg life hacker. I beg to differ!

My mac is a MacBookPro8.2, 2011 build. As shown by:

dmidecode |grep -i macbookpro

A twist is that it has an SSD where its optical drive should be, so I have to install from an external USB CD drive (I tried from a USB memory stick but ran into other problems).

It seems as though there were problems with the previous (12.04) version of the Ubuntu installer such that a problem with the usb cd provoked an issue with the video driver, or some such. I installed rEFIt and fiddled around for an age. I produced black backgrounds, purple backgrounds and even turquoise backgrounds, but no X.

I managed to install a server version of Ubuntu, but could not get ubuntu-desktop to load. By removing quiet and splash from the grub config I could see the X server crash.

Fatal server error:
no screens found

From wikipedia:MacBookPro I found I have dual graphics cards, an Intel card and an AMD Radeon HD 6490M.

From recovery mode boot I was able to see the real culprit:

fb: conflicting fb hw usage inteldrmfb vs EFI VGA - removing generic driver

I reinstalled from the ubuntu mini iso the latest (13.01) Ubuntu. Got the same conflict error. I installed the latest rEFId using a .deb. Still the same error, but now understand it is a conflict between the driver installed by rEFId and the Radeon driver.

From this thread I was able to find an incantation which worked!

  outb 0x728 1 
  outb 0x710 2 
  outb 0x740 2 
  #Power down ATI 
  outb 0x750 0
  linux /boot/vmlinuz-3.5.4-030504-generic root=/dev/sda4 video=efifb i915.modeset=1 i915.lvds_channel_mode=2 i915.lvds_use_ssc=0

This can be put into /etc/grub.d/00_header and then

grub-mkconfig -o /boot/grub/grub.cfg

No comments:

Post a Comment