Pioneering in Linux -- Macbook Pro Retina

Tuesday, July 9, 2013

Small update:

Recently I installed Linux Mint 15 KDE when it came out. Using the hardware acceleration from the nouveau drivers seems to have acceptable performance and using nouveau+kde means the desktop resolution changing is much better than it is under nvidia with my script. KDE's compositor works really well with this screen. So far I'm quite happy with it, although I need to see how well really intensive programs work. Portal worked quite happily with nouveau and mesa and that library set before it crashed, but I'm not sure whether that was a function of graphics or something else, as there weren't any error messages.

Thursday, March 7, 2013

If you are using an ubuntu-based distro on a macbook pro retina, I recommend grabbing this package here: http://packages.ubuntu.com/raring/bcmwl-kernel-source, as the latest version of the bcmwl package supports the BCM4331 card of the macbook pro retina, and it has support for more modes than the b43 drivers do.

Tuesday, January 15, 2013

Well, after having this set up, I wanted to be able switch resolutions (the screen is really tiny, and it drops the frame-rate of games rather significantly) I tried all of the standard xorg.conf configuration, addmode, newmode, all of that. But nothing worked.

Today, I stumbled on a solution: xrandr's --scale option. This allows you to scale that screen to almost any resolution you want.

for example:

xrandr -q

(this returns certain names e.g. mine is DP-2. Another is HDMI-0. One will say "connected" and that's the one you need.

xrandr --output DP-2 --scale .5x.5

This scales it to a 1440x900 resolution.

One thing to note. Sometimes trying to go from one scaled resolution to another will fail with an error. Don't panic: just change the scale back to 1x1, and the next scale you choose will work. The scaling numbers don't have to be simple: I managed to get ~1650x1050 by putting the scale value as .5729x.5729.

EDIT: I found a way to fix the trackpad settings.
I followed this advice here: uselessuseofcat.com/?p=74ls,
but it didn't quite help with the trackpad's tap-click.
I then found this package: gpointing-device-settings

sudo apt-get install gpointing-device-settings

This installs a utility that is launched by running
gpointing-device-settings
in the terminal.

This is a graphical configuration for your trackpad, so you should be able to customize your mouse however you want.

Sunday, December 16, 2012

Over the past few days I have embarked on a journey: to install and run Linux on a Retina Macbook Pro. (15-inch 2.3 GHz base model) The main issues were the kernel not supporting it and the lack of internet connections that work immediately without extra hardware. (As well as the lack of solid instruction, which is why I created this guide.)

Other places I have seen this topic discussed have been focused on current releases, which is understandable. However, looking at these changes for Ubuntu 13.04, one of which states that it will be compatible with this computer, I decided to try the daily build.

The daily build of Ubuntu 13.04 has kernel support for this computer. This first post will describe the current state of Ubuntu 13.04 and the various steps I used to get Ubuntu working.

When partitioning, it is better to let Linux do the partitioning of free space in the installer rather than creating an msdos partition in Mac OS X. This prevents the creation of a hybrid MBR and creates a protective MBR which has a standard.

Installing to an external drive--Important Note

Your disk's partition table needs to be GUID/GPT (GPT and GUID are the same thing). External drives can be checked in disk utility under partitions. Underneath the picture of the partitioning scheme, there is a button named options. Click it, and you should be able to see what the partition table format is. If it is GPT, you can proceed. if it is not, the EFI bootloader will not work.

To make the drive GPT, it will need to be reformatted, erasing all the data on the disk, so don't convert unless you have somewhere to put those files.

Before you begin:

Create enough free space (unformatted) for Ubuntu to fit.

Grab a 1GB or larger flash drive and a DVD-R, or a 4GB or larger flash drive.

Recommended: an ethernet adapter that works with the retina mac

Now for the actual guide. Hopefully it is easy enough
that people who are newer to linux can follow it.

1: Install rEFInd

The install.sh should be run in a Mac OS X partition with the --drivers option and I (personally) installed it to the Mac partition rather than the EFI (ESP according to the rEFInd guide). For more information, the creator of rEFInd has this information organized already: http://www.rodsbooks.com/refind/

so unzip the files, run the install.sh.

If you want to have Linux on an external hard drive, or want to dual-boot, you may run either option:

./install.sh --alldrivers

but if you want only Linux on your internal hard drive, you must run this:

This uses the kernel (which should be above 3.7 if you are following this guide) as the bootloader, with no requirements for grub. (Grub can be safely ignored, as with this setup the mac cannot see grub as a boot option)

If you upgrade your kernel, you will need to also copy it inside the ubuntu folder like before.

Wireless Drivers

If you have Ethernet working

open with the archive manager and extract wl_apsta.o to your home folder.

run
sudo apt-get install b43-fwcutter

then run

sudo b43-fwcutter -w /lib/firmware/`uname -r` ~/wl_apsta.o

sudo modprobe b43

Wireless networking should be working. If it isn't, reboot.

Without Ethernet

Mount your flash drive and move the files to your home folder.

Open the driver package with the archive manager and extract wl_apsta.o to your home folder.

sudo dpkg -i b43-fwcutter.deb

sudo b43-fwcutter -w /lib/firmware/`uname -r` ~/wl_apsta.o

sudo modprobe b43

Wireless networking should be working. If it isn't, reboot.

Nvidia graphics

Nvidia drivers work from the standard repository (run

sudo apt-get update; sudo apt-get install nvidia-current

in the terminal), but the setting must be configured by the Nvidia x Server settings program to display properly.

Reboot after install. I saw 3 mirrored 800x600 screens stacked on top of each other, with garbage to the right.

Open the x server settings.

Selection: change to X screen 0

click advanced

click X server Display Configuration

click the first button after "metamode" and select nvidia auto-select

hit apply. if the screen goes back to looking like a 2880x1800 screen, reopen x server settings if it closed, check the configuration to make sure it's the same, and click "save to X configuration file" This will keep this setting throughout reboots.

*For changing the resolution, after the NVIDIA graphics is set up correctly, my second post has a scrip that you can use.*

Changing the desktop environment:

This should work. If you speakers stop working after installing it, run

Installing cinnamon desktop destroyed detection of sound card, though
it can be fixed by reinstalling alsa-core and pulseaudio and running
sudo alsa force-reload

At this point, everything that I have tested works. The system
usually reports a couple crashes early on after login which don't affect
the stability. One freeze has been seen while changing the auto-hide
option in the cinnamon settings, but later attempts to recreate failed, so no confirmed
bugs.

The trackpad is sensitive to the lightest tap, so a USB mouse in
recommended, though I had heard of someone editing the trackpad
config... which if I get around to it I will include in another post. The keyboard works normally, AFAIK.

With the latest updates and the proper libraries, steam and TF2 work,
although TF2's frame-rate is choppy and resolution cannot be changed in
TF2 in fullscreen mode. Unknown whether this is an issue
with hardware or optimization by Valve being incomplete or something
else entirely.