Discussion of this wiki can be found here

INTRODUCTION

imacquantal.jpg

" Quantal came to imac, with a friendlier attitude "

  • First of all, let me make clear which this guide is only to the imac model mentioned above, the farther your hardware is from the above, the more it is probably this guide will not help you, or may even cause you problems. I'm almost sure what I have experienced regarding the above model and ubuntu 12.10(Quantal) applies to all computers with this specific model(21,5 inches, radeon hd 6770m, quad core i5), but you will be following this guide at your own risk even then. Ubuntu 12.10 for mac behaves better than its predecessor, but some important things still must be solved to use it.

KNOWN ISSUES

The current known issues, which may or may not be fixed in the near(or far) future are below, please note the differences from the original 12.04 observation to the observation at its side and consider them on the instructions which comes next(avoid unneeded steps):

Cannot boot ubuntu without rEFInd or similar(probably no longer necessary on 12.10, but it still simplifies things)

Noisy screen(most noticeable against dark-grey backgrounds): https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1020374(Must retest on 12.10)

Cannot properly use the mac default EFI system without running Super Grub 2 Disk once to enter the ubuntu OS you installed(must retest on 12.10).

Overall bad apple keyboard and mouse recognition.

Brigthness control not working by default, very bright screen by default: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1020373(it does worked at some point in 12.10, must test to see how)

For Brazilian language you will need to do additional configuration. https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1012695

The Ubuntu open source driver for radeon hd 6770m is hugely slow, mainly for games and other graphic intensive tasks; no ubuntu packaged AMD driver will work out of the box due to video memory recognition issues(https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1004546).(default driver works better on 12.10, but not enough. ubuntu packaged drivers work on 12.10, but with a detail discussed later)

You will need the usb keyboard to choose ubuntu at rEFInd, otherwise you will have to pair again your keyboard as described at mac manual at OS X everytime you want to do the above. You will also need a usb mouse or wacom tablet.(Seems to still apply on 12.10 ubuntu)

Everytime you switch which OS you load, that OS will take over the keyboard and mouse, and you will have to setup them again at the other OS to get it to work there, which in turn will make the other OS lose keyboard and mouse input again until pairing is done again there. In resume, currently you will never get both OS's to have simultaneous wireless keyboard and mouse input.(must retest on 12.10)

Your headphones will not work, just built-in speaker(https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1003039). Workaround already avaible.(workaround still needed on 12.10)

Needs patience to setup keyboard and mouse at ubuntu with the default bluetooth manager(bluez, https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1001825); maybe installing blueman speeds things a bit, thought bluez seems more reliable after device detection(may be just me).(seems still true on 12.10)

IF THINGS GET NASTY(ubuntu 12.04 specific)

  • If you got a black screen after the AMD driver install and nopat does not work(in ubuntu 12.04 case), at grub 2 boot loader

enter your current linux kernel image under recovery mode > ¨drop to root terminal¨ > type and confirm:

  • mount -rw -o remount /
    This will allow you to make changes to your failed ubuntu install, then type and confirm:
    reboot
    This may allow you to have a working ubuntu(if not temporary) at the next ubuntu boot; sometimes you also may need to type ¨amdconfig –initial -f¨ before the reboot command above. If that does not work. Type and confirm the following(the first line only if you installed the no distribution specific AMD site driver):
    sudo sh /usr/share/ati/fglrx-uninstall.sh
            sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
    The first line above only if you installed the amd site radeon driver without generating ubuntu packages.
    sudo apt-get remove --purge xserver-xorg-video-ati xserver-xorg-video-radeon
            sudo apt-get install xserver-xorg-video-ati
            sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
            sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
            sudo rm -rf /etc/ati
    This will revert ubuntu to the default open source non AMD driver, which usually works.

    If the above does not work use the ubuntu live cd>test ubuntu, start terminal(ctrl+alt+T) and do(X is the number of your root / partition):

    sudo mount /dev/sdaX /mnt
            sudo chroot /mnt
    The above will give you acess to the lost ubuntu install; from there do the video driver full cleanup and revert to open source said above.

    If everything else fails, use the live cd > install ubuntu, and format and reuse the root partition as root, also reuse but DO NOT FORMAT the home partition. This last attempt is almost guaranteed to work.

DOING IT

  • Before anything download the mac only 64bits desired ubuntu image and burn it to a media (cd, dvd). Ubuntu 12.10 images can be found in the 12.10 release page, and here's a direct link to the ISO. It is not recommended, but Ubuntu 12.04 images can be found in the 12.04 release page and here's a direct link to the ISO. Go to the OS X disk utility and ask it to split the hd single partition into two equally sized partitions, let the new partition be 'Free Space'.

    Go grab yourself a cheap usb keyboard and mouse(the more popular the device brand is the merrier), you WILL need them, Ubuntu keyboard and mouse support is lacking currently. Then Download and burn to a disk Super Grub 2(http://www.supergrubdisk.org/category/download/supergrub2diskdownload/), so you can actually properly boot your ubuntu later using the imac system default EFI stuff; also at your OS X system, download rEFInd(http://sourceforge.net/projects/refind/files/latest/download) and install, which will let you choose between ubuntu and os x at mac startup(rEFInd may be unnecessary for 12.10 ubuntu, but it does still make booting faster). With the ubuntu media mentioned before burn and ready, restart your imac. After the startup sound keep the keyboard alt key pressed until a menu appears, choose the cd wrongly labeled 'windows', if it does not show up, wait a bit until it do. Do not try to let the imac automatically detect the disc, because or it will not, or it will actually refuse it. If you apple mouse do not work at first at the test/install screen, click it a bit and it will, enable the onscreen keyboard(probably the apple keyboard will not work) at the little man symbol at the right-top area(apple keyboard will not work) or use the usb keyboard(easier). Choose your language, mark the third-party stuff checkbox, and DO NOT mark for ubuntu to update already(to avoid wasting your internet limit if any, just do so when the video driver is truly working later), WHEN ubuntu ask if you want to overwrite your OS X, place it side by side or manual, go manual. Use that space you previously freed with diskutility at OS X as 10gb or more as / with ext4, 2mb for grub bios partition, 4gb for the swap, and all the rest to a /home with ext4 too(do not forget to create this /home partition); select for boot loader install the partition which you configured as root /(check the labels which the partition manager show you above), do not install boot loader at the hd root. Proceed until install is complete and click reboot, use the usb keyboard to finish the boot when requested. In case you wonder, splitting ubuntu between /home and / is usefull in case you need to reinstall ubuntu, you will have to do so only at /, /home will be kept intact, with all your files safe.

    Ensure your wireless keyboard is working at startup(Super Grub 2 Disk cannot recognize usb keyboard), otherwise pair it at OS X like the mac manual says(system conf>keyboard>bluetooth conf, shutdown keyboard(press the keyboard power button until it shut down, dont just touch it) and turn it on again there), then press Alt at startup, but with the super grub 2 disk at the your cd reader instead, select somethind like 'detect even if the MBR is overwritten', select the only entry which will appear and boot ubuntu normaly, but just due to super grub disk 2. Try the 'detect grub.cfg' if the last entry don't work.

    Under Ubuntu system configuration > keyboard layout, use English(Macintosh) for the apple keyboard keys to work properly; you can do this later too. If you are Brazilian, type this at terminal:

    setxkbmap us -variant intl

    You will now have support for Brazilian accents(http://digitalareablog.wordpress.com/2011/12/22/configuracao-acentuacao-no-linux-ubuntu-11-10-virtualizado-no-macbook/). Thought you will need to do so every time the computer sleeps, restarts or is shutdown. This also outputs wrong quotes characters, useless and dangerous in programming(must file bug report).

    For Video, if you use 12.04, go to Ubuntu system configurations > proprietary drivers and install the “ATI/AMD fglrx proprietary driver”(do not install the post updates one for 12.04), there is a detail thought only for 12.04 we will see later. For 12.10, DO NOT install throught the ubuntu gui, instead pop up terminal, and simply type there:

    sudo apt-get install linux-source linux-headers-generic fglrx-updates

With 12.10, after that everything will work right away after boot.

  • Since you are at terminal, update the system known packages with: sudo apt-get update

    After that, if you use 12.04 do the procedure mentioned here from step 19 to 28: http://www.rodsbooks.com/ubuntu-efi/index.html , otherwise if you use 12.10, at the line which says 'sudo grub-install', you must use the live cd at 'try it' mode, and do instead:

sdXY is the / partition of your ubuntu(ex: mine was sda7), sdX is the root of the ubuntu hd(ex: sda at my last example)

  • sudo mount /dev/sdXY /mnt
    
     sudo grub-install --root-directory=/mnt/ /dev/sdX

From ubuntu 12.04 to 12.10, it seems grub-efi now demands an additional argument after grub-install keywords.

  • Go to OS X and edit rEFInd.conf to always select by default OS X, the path to the file is macintosh hd>EFI>rEFInd>refind.conf. You will need to command+i > change permission((be sure to remember how the permissions are now)) of the refind folder and refind.conf to be able to edit it with a text editor; You will know what line is responsible for rEFInd entry as the the file is well commented(at the comment it will mention which you can put a number between 1 and 9), change the default entry to 2 and save. Don't forget to command+i the two(refind folder and refind.conf) again and restore the permissions as they were(probably read only to everyone eles, read-write to system group). It is very probable ubuntu will boot with a black/blank screen after boot if you installed the video card proprietary driver AND use ubuntu 12.04(if done right, 12.10 will never had this issue), if that happens, leave your ubuntu entry at grub bootloader highlighted, and press e; at the line with “quite splash”, add to its end “nopat”(without quotes of course) and press F10; you will have to do that at every ubuntu startup, if it works more than twice you can change your grub file só it always include that parameter for you, if só:

    sudo gedit /etc/default/grub
    Add “nopat” to “quiet splash”, turning it in “quiet splash nopat”, save the file and exit. Then update the grub configuration by running:
    sudo update-grub

nopat is not needed for ubuntu 12.10.

  • For your headphones to work, go to terminal then:
    sudo gedit /etc/modprobe.d/alsa-base.conf
    Add to the last line of this document, the following, save and reboot:
    options snd-hda-intel model=imac27_122
    Reboot. The ubuntu screen will become fully bright, if you value your eyes you will need to do this at terminal(if 0.7 is still too bright, try 0.6 or lesser):
    xrandr --output LVDS --brightness 0.7
    Your ubuntu should now be working in the limits currently possible for an imac 2011, now you can update your system software, language support and install your favorite programs.

TESTING UNSUPPORTED NEWER KERNELS

  • You may want to test newer linux kernels to see if there are any improvements into how ubuntu behaves at a mac computer; I will not teach you how to do that, but I will teach you how to get rid of such kernels if your experiments start to mess everything up, more specifically AMD video driver experiments(http://www.liberiangeek.net/2011/11/remove-old-kernels-in-ubuntu-11-10-oneiric-ocelot/). Check your current working kernel with:

    uname -r
    Check all the current installed kernels:
    dpkg --info | grep linux-image 

    Remove the desired kernels(replace target_linux_image with the kernel image name, just ctrl+shift+c then ctrl+shift+v), do not remove your current kernel image(remember the above uname -r):

    sudo apt-get purge target_linux_image 
    Update the Grub 2 boot loader(that black screen before ubuntu with many entries, one of them marked as grey)
    sudo update-grub2

CONSIDERATIONS

  • Hope this guide helps you, as I discovered a lot of the things above the hard way; if you discover a better way of working around the current ubuntu 12.04 issues on an imac 2011, let me know; it is good to test yourself if the information provided is the indeed the best one(thought doing so is quite dangerous, I 'stained' for quite some time my imac screen pixels recently). Ubuntu 12.10 for mac is much better than 12.04 was, althought it still has important blocking bugs to begginners, thought the system do not ceases to be interesting due to things mentioned at the guide introduction; I guess Ubuntu team actually tries to make a working mac ubuntu, as it gets better with time at mac. Also, if you find a problem with ubuntu on an imac, even if it is tiny, let people know at launchpad, do not wait for others to submit the bug report for you; otherwise the problem will take longer to be solved, or will not be solved at all. Help at the bug links I presented at the 'Know Issues' section of the guide, just by saying there these bugs affects you(click the "it affects me too" button at the top there) or by providing additional information.

CREDITS


CategoryMac

ubuntupreciseon2011imac (last edited 2012-11-07 22:13:10 by m153)