Loading...
 

Penguinbookpro with Ubuntu 12.04

Xubuntu 12.04 LTS + MacOSX 1.5 + Win XP Pro, on a MacBookPro 5.5 laptop.

Macbookpro

1.1. Triple boot 'Xubuntu 12.04 + MacOSX Leopard + Win XP Pro'

It took a while, but I finally managed to do it, which will allow using hardware with drivers for winXP only to work, such as the "Video to disc One Touch Recording" LG GSA-5169D.

Using rEFIt to boot the computer, WinXP to use the MBR, and Ubuntu to install biosgrub 1MB (different from the grub folder) on it's own root partition.

In general, see:


And also useful tips learned from:

1.1.1. Preliminary Notes

  • Do not keep a 1Tb+ USB disk plugged to the computer while booting, since it might stop booting completely, with no error message.
  • At Booting time:
    • Press "Alt" key to force showing the alternative booting media
    • Press "C" key to force booting from the CD rom
    • Press the left mouse button (or equivalent in the touch-pad) to force ejecting a CD while booting

1.1.2. Steps

  1. If you are not starting clean with your hard disk, you can format hard-drive into FAT32 or something MacOSX Install DVD can easily recognize, and keep that partition active.
    We did that with a Xubuntu 12.04 64 bits Live CD, that we will use it several times along this triple-boot installation.
  2. Install Mac OSX Leopard, with the installation DVD.
  3. While in a Mac OSX session
    1. Install rEFIt
    2. Use BootCamp to resize Mac partition down to 30Gb, create a partition for Windows with the rest ( aprox: 150Gb - 30Gb = 120Gb), but don't install Windows right away.
    3. Shutdown computer without installing Windows
    4. Boot twice the computer if needed until you see that rEFIt is properly installed and working.
  4. With a GNU/Linux LiveCD such as Xubuntu 12.04 64bits Live CD, start a Live Session and:
    1. Open Gparted:
      1. Remove Windows partition created from Bootcamp
      2. I left 200Mb empty before the next partitions (just in case we need in the future to install some biosgrup thingy, or in case we need to slightly move/resize partitions to round cylinders, etc)
      3. ext3 for /, 24 Gb
      4. ntfs for Windows XP, 50 Gb after the / Linux partition.
        Make sure you're installing Windows to the correct partition. (Don't install Windows in partition 2!!!) (tips from here & here )
      5. Leave the rest of the disk as empty space. We will use later on.
      6. Close Gparted
    2. Close that Xubuntu Live session
  5. Boot with Windows XP Install disk
    1. Install Win XP into that NTFS partition
    2. You will have to reboot at some point, and choose Windows in rEFIt to continue with the Windows installation
    3. Do not setup network.
    4. Shutdown computer once everything is installed.
  6. Boot with WinXP Update + SP2
    1. Install it into that NTFS partition
    2. You will have to reboot at some point, and choose Windows in rEFIt to continue with the Windows installation
    3. Do not setup network.
    4. Insert your original Mac OS X Install-CD
      It contains the necessary Windows drivers for your MacBook (at least with Mac OS 10.5). You may need to open the CD explicitly because Autostart does not seem to work with just the barebone Windows installed on the MacBook. Don't worry if it says that it's installing Boot Camp (which will probably be the case if you're using a Mac OS 10.5 CD) because that just seems to be Apple's idea of saying "installing all Windows drivers". Just let it install everything it wants to knowing that you will not need to mess with Boot Camp; you've got rEFIt.
      Make sure to active Windows if necessary (so that it keeps working), install an antivirus program (so that the integrated security thingy is happy), keep up with your Windows updates (so that your Windows installation is as up-to-date as possible) and do so all that other stuff Windows users need to do.
      Hints:
      • All the integrated devices including sound, wireless LAN, touch-pad and function keys should work now.
      • On newer Mac models "right" mouse-clicks can be done by putting two fingers on the touch-pad and then clicking the mouse key.
    5. Shutdown computer once everything is installed.
  7. Boot with Xubuntu 12.04 64 bits Live CD
    1. Start installation, and use the ext3 partition we created beforehand for all / and /home. Do not create a swap partition at this time.
    2. Make sure to install the bootloader GRUB to your Ubuntu partition (sda# in our case) and not the master boot record (MBR).
  8. Check that you can boot with WindowsXP and later on, also with Ubuntu, using rEFIt to choose the desired option.


Done!

Additionaly, you can:

  1. Improve your GNU/Linux Setup
    1. Move the /home folder out of the linux root partition, into to a partition after windows ntfs.
      ext3 for home, 19 Gb
    2. Create a swap partition at the end of the physical hard drive (2 x RAM: I provided 16Gb for swap in my case, since I have 8Gb RAM, and I want to allow suspending the computer when many programs are open and using most of that RAM ).
      16Gb for swap
  2. Fine tune your Mac
    1. Reboot with Mac to Update software programs with the integrated utility
    2. Edit rEFIt
      1. Choose GNU/Linux as the default OS (See at the bottom some option to define "L" as the default).
      2. Reduce the timeout from 20 to 3 seconds (more than enough for most boots)
    3. Install XCode on MAC for Macports
    4. Install MacPorts
    5. Test macports by means of installing something small and useful, such as "mc"
      1. sudo port install mc


1.1.3. If something has gone wrong for some reason...

Some extra tips on how to fix things, if something has gone wrong for some reason:

Fix WinXP boot loader, when it complains that you have a non working "< windows disk>\system32\hal.dll" file

  • sometimes it gets broken when you have:
    • a spare windows fat32 or ntfs partition beyond the partition to install the Windows OS
    • a biosgrub partition created by GNU/Linux
    • an MBR written by Ubuntu
  • To fix it (taken from http://kb.acronis.com/content/1507 ):
    Boot the computer from the Windows 2000/XP/Server 2003 (choose the one for your case) installation CD, start Recovery Console and run fixmbr and fixboot commands.
  • If the system partition was not restored to its original position, then the boot.ini file needs to be updated.
    This can be done with the Recovery Console command bootcfg /rebuild


If you accidentally install grub onto your MBR

  1. Don't panic
  2. Find your Mac OS DVD (and insert into drive)
  3. Reboot holding down Alt/Option
  4. Once setup has loaded choose your language
  5. Click Utilities->Terminal...
    1. Type "fdisk -u /dev/rdisk0" < ENTER>
    2. Type "y" < ENTER>
  6. Quit Terminal, Quit Installer
  7. Reboot and carry on like you didn't do anything stupid wink


1.2. Xubuntu happy-path setup

1.2.1. Enable Ubuntu Partners

First enable "partners" repos, since we will use it later to install adobe acrobat reader and skype, at least.

1.2.2. Extra repositories

Useful extra repositories

Command on a console
xavi@penguinbookpro:~$ sudo su root@penguinbookpro:/home/xavi# add-apt-repository ppa:nilarimogard/webupd8 root@penguinbookpro:/home/xavi# add-apt-repository ppa:yannubuntu/boot-repair root@penguinbookpro:/home/xavi# add-apt-repository ppa:ubuntu-on-rails/ppa root@penguinbookpro:/home/xavi# add-apt-repository ppa:danielrichter2007/grub-customizer root@penguinbookpro:/home/xavi# add-apt-repository ppa:synapse-core/ppa root@penguinbookpro:/home/xavi# add-apt-repository ppa:kubuntu-ppa/backports root@penguinbookpro:/home/xavi# add-apt-repository ppa:libreoffice/libreoffice-4-0 root@penguinbookpro:/home/xavi# add-apt-repository ppa:stebbins/handbrake-releases root@penguinbookpro:/home/xavi# add-apt-repository ppa:kazam-team/stable-series root@penguinbookpro:/home/xavi# add-apt-repository ppa:openshot.developers/ppa root@penguinbookpro:/home/xavi# add-apt-repository ppa:pj-assis/ppa root@penguinbookpro:/home/xavi# add-apt-repository ppa:xubuntu-dev/xfce-4.10 root@penguinbookpro:/home/xavi# add-apt-repository ppa:ondrej/apache2 root@penguinbookpro:/home/xavi# add-apt-repository ppa:ondrej/php5 root@penguinbookpro:/home/xavi# add-apt-repository ppa:bratherlui/geany


Press enter each time when requested.

After keys are imported, you can quit from the root session with "exit":

root@penguinbookpro:/home/xavi# exit exit xavi@penguinbookpro:/home/xavi#


Additionally, you can add a repository for R and others:

sudo nano /etc/apt/sources.list


And paste by the end:

# R deb http://ftp.heanet.ie/mirrors/cran.r-project.org/bin/linux/ubuntu precise/ # Freenx deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu precise main deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu precise main # Jitsi for Ubuntu deb http://download.jitsi.org/deb unstable/


For Macbookpro laptops, you need:

Command on a console
sudo add-apt-repository ppa:mactel-support


Nowadays, you can update your sources list, and install launchpad-getkeys:

sudo apt-get update sudo apt-get install launchpad-getkeys


Launchpad-getkeys allows you to automatically import all the missing Launchpad GPG keys. Run the following command:

Command on a console
sudo launchpad-getkeys sudo apt-get update

To use Launchpad Getkeys when you're behind a proxy:
sudo launchpad-getkeys -p http://proxydomain.com:port


And at this point, you may want to install 'pommed' already, which is a small program that won't take long to install, and it will let you take profit of the backlight of the macbookpro keyboard during the rest of the installation tasks.

Command on a console
sudo apt-get install pommed

1.2.3. Install with interaction

Install programs which require interaction, like a confirmation step, a new password or user interaction of some sort.

  • mysql-server, for the webserver in localhost, etc.
  • phpmyadmin, to manage mysqldatabases easily through a web browser
  • apachetop, for monitoring apache in real time
  • ttf-mscorefonts-installer, required by other packages (PlayOnLinux, maybe?)
  • acroread - Adobe Acrobat Reader (from 'Partners' repo), for the administration that require this closed source program to fill those complicated forms every now and then
  • isight-firmware-tools, to have the drivers from the MacBookPro isight webcam, extracted to your linux partition, so that your webcam can work out of the box.

Command on a console
sudo apt-get install -y mysql-server phpmyadmin apachetop ttf-mscorefonts-installer acroread isight-firmware-tools

1.2.4. Install the rest in one go

You can then install all the rest of the required and useful software for common tasks (including video editing, screencasting, etc). Note that the first package names until wcatalan are localization packages for our local language, and you can skip them or adapt for your language, etc.

Command on a console
sudo apt-get install -y firefox-locale-ca hyphen-ca icatalan ispell kde-l10n-ca language-pack-ca language-pack-ca-base language-pack-gnome-ca language-pack-gnome-ca-base language-pack-kde-ca language-pack-kde-ca-base libreoffice-help-ca libreoffice-l10n-ca mythes-ca thunderbird-locale-ca wcatalan awn-settings chromium-browser wine winetricks playonlinux mc thunderbird pdfsam pdfchain krusader krename gwenview gimp-plugin-registry terminator mc bum cheese ess eclipse filezilla flashplugin-installer gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gwenrename inkscape kipi-plugins openjdk-6-jre openssh-server r-recommended skype sshfs terminator texmaker kile unrar vlc htop bibus libsyntax-highlight-engine-kate-perl p7zip p7zip-full p7zip-rar pdfedit gnome-alsamixer gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-bad-multiverse myunity ubuntu-restricted-addons ubuntu-restricted-extras parcellite shutter kdesvn subversion bzr-explorer gtk-recordmydesktop r-cran-rgl r-cran-misc3d libx11-dev libxt-dev libcurl4-gnutls-dev libxml2-dev r-cran-xml libgraphviz-dev libcairo2-dev r-cran-cairodevice freeglut3 freeglut3-dev r-cran-rglpk virtualbox apt-show-versions pdfmod corkscrew uswsusp hibernate pavucontrol grub2-splashimages boot-repair gedit-gmate grub-customizer nautilus-dropbox qshutdown skype meld geany geany-plugins synapse gparted r-cran-rgl r-cran-misc3d libx11-dev libxt-dev libcurl4-gnutls-dev libxml2-dev r-cran-xml libgraphviz-dev libcairo2-dev r-cran-cairodevice freeglut3 freeglut3-dev r-cran-rglpk libgtk2.0-dev jitsi backintime-gnome luckybackup xubuntu-desktop xubuntu-restricted-addons xubuntu-restricted-extras flvstreamer kdenlive transmageddon thoggen oggvideotools ogmrip ogmtools xsane virtuoso-nepomuk mobile-atlas-creator usb-imagewriter handbrake-gtk kazam handbrake-gtk openshot openshot-doc guvcview


Other useful programs installed by hand in a later stage:

  • rstudio
  • nxclient
    • nxnode
    • nxserver
  • chrome
  • jitsi
  • gdiskdump


If you want, you can configure your boot menu with "burg":
http://howtoubuntu.org/how-to-make-your-dual-boot-better-with-burg/

And if you want to enable rw support for hfs+ partitions (from MacOSX) in Ubuntu, as well as create/manage hfs+ partitions through gparted, you need to install a few extra packages (hfsplus hfsutils hfsprogs hfsutils-tcltk). In addition, you may want to take profit of the backlight of the keyboard (pommed), if you didn't do it in an earlier step. Therefore, run this:

Command on a console
sudo apt-get install hfsplus hfsutils hfsprogs hfsutils-tcltk pommed


You can open a GUI for browsing the hfs+ disk with the tcl-tk program: xhfs

See http://www.mars.org/home/rob/proj/hfs/

1.2.5. Fine tune your desktop and boot look & feel

You can add new tools to the xfce panels, move bottom panel to the left, reduce size to 24 px, and drag & drop program launchers from the xfce menu to the left panel, so that they get added there for easier launching your favourite applications.

With grub-customizer you can add some graphical background to the grub screen when booting GNU/Linux, and reduce the waiting time before the actual boot.

Launch parcellite (clipboard manager), dropbox (and link it to your dropbox online account), reduce dropbox bandwith to half your adsl bandwidth, for instance, to avoid issues in the future when dropbox attempts to use all your bandwith to update non-urgent files and folders, etc.

1.2.6. Add Virtualbox Guest Additions

For some reason, VirtualBox doesn't come with "Guest additions" (to improve the screen management, share folders between host and client machines, etc). We can install them by hand through the command line:

Command on a console
sudo wget http://download.virtualbox.org/virtualbox/4.1.12/VBoxGuestAdditions_4.1.12.iso -c -O /usr/share/virtualbox/VBoxGuestAdditions.iso


Then we can open virtual machine, and once open, go to: "Devices > Install Guest Additions"

Last, you have to reboot the virtual machine, and you are done.

1.2.7. Add Java 6 or 7 (JRE) from Sun/Oracle

If for some reason you need Java (jre) 6 or 7 from Sun (currently Oracle), because the openjdk doesn't work for you (if you want to share your desktop with BigBlueButton, for instance, that doesn't seem to like the openjdk), you can add the proprietary java through external repositories.

For JRE 7 from Oracle, you can add the webupd8 repos

Command on a console
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer


Source:


If you need the earlier sun JRE 6 (keep in mind that you need a version like or higher than 1.6.0_23, because there were some known security holes with earlier versions):

Command on a console
sudo add-apt-repository ppa:flexiondotorg/java sudo apt-get update sudo apt-get install sun-java6


Source http://www.ubuntuupdates.org/ppa/flexiondotorg_java_?dist=precise

1.2.8. Change the Java used by default

If you need to change the Java used by default, between OpenJDK & Sun/Oracle JRE, you must run:

sudo update-alternatives --config java


Then you can choose among the installed versions:

xavi@penguinbookpro:~$ sudo /usr/sbin/update-alternatives --config java [sudo] password for xavi: Hi ha 4 possibilitats per a l'alternativa java (que proveeix /usr/bin/java). Selecció Camí Prioritat Estat ------------------------------------------------------------ 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 mode automàtic 1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 mode manual 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 mode manual * 3 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 mode manual 4 /usr/lib/jvm/java-7-oracle/jre/bin/java 1062 mode manual Premeu retorn per a mantenir l'opció per defecte[*], o introduïu un número de selecció: 0 update-alternatives: s'està emprant /usr/lib/jvm/java-7-oracle/jre/bin/java per a proveir /usr/bin/java (java) a «mode automàtic». xavi@penguinbookpro:~$

1.2.9. Upgrade Apache to 2.4 and php to 5.5

For Tiki13+, you need php5.5, which requires Apache 2.4. Therefore you need to ensure that you have added two new repositories that didn't come along ith ubuntu 12.04 by default:

Command on a console
sudo add-apt-repository ppa:ondrej/apache2 sudo add-apt-repository ppa:ondrej/php5


In addition, if you had previous websites at the document root /var/www, you need to change the default document root in your new installation to keep using the same base folder:

Edit the /etc/apache2/sites-enabled/000-default.conf to leave this part like this
ServerAdmin webmaster@localhost # DocumentRoot /var/www/html DocumentRoot /var/www


And restart apache:

Command on a console
sudo service apache2 restart

1.3. Backups

There are several options to create backups, mainly differing in the OS in which each program runs. Some nice options are the ones that run on a Live CD. Some of the more interesting ones:

Live CD:

  • REDO Live CD (GUI of partclone).
    http://redobackup.org
    • arrow That's the one I'm using to do some backups of the whole computer (partitions, mbr, etc) along the tri-boot setup (to avoid starting from zero if something fails at the end, or later on).
  • Clonezilla Live CD
    http://clonezilla.org
    (text UI for partimage and others). It's the one I used at work to clone the dual-boot laptop, storing only sectors with information, and not the whole disk. Unluckily, it doesn't work on my Macbookpro (it's dreadfully slow, and never finished booting up, after 30 minutes...)
  • Mondo Rescue Live CD.
    http://www.mondorescue.org
    We didn't use it (it's more than just a cloning disk, but a free disaster recovery software.


GNU/Linux:


MacOSX:


1.4. Older tips

1.4.1. Increase battery life

1.4.1.1. Jupiter

Jupiter is a light weight power and hardware control applet for Linux. It is designed to improve battery life of a portable Linux computer by integrating with the operating system and changing parameters of the computer based on battery or powered connection
http://www.ubuntugeek.com/jupiter-light-weight-power-and-hardware-control-applet.html

Command on a console
sudo add-apt-repository ppa:webupd8team/jupiter sudo apt-get update sudo apt-get install jupiter

1.4.1.2. TLP

TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements.

http://www.webupd8.org/2013/04/improve-power-usage-battery-life-in.html
http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html

Command on a console
sudo add-apt-repository ppa:linrunner/tlp sudo apt-get update sudo apt-get install tlp tlp-rdw

1.4.2. Use Lightum to use a daemon

(it doesn't seem to work with xfce out of the box)
https://github.com/poliva/lightum#lightum---macbook-automatic-light-sensor-daemon

sudo add-apt-repository ppa:poliva/lightum-mba sudo apt-get update sudo apt-get install lightum

1.4.3. reset keyboard backlight manually

echo '5' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness ## this adjusts the screen backlight, the values range from 1 to 15. echo '25' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness ## this adjusts the keyboard brightness and ranges from 1 to 255.

1.4.4. NVidia Powermizer tweaks

See:
http://www.recipesforlinux.com/2011/06/16/problemas-con-nvidia-powermizer-en-ubuntu/

and

http://www.recipesforlinux.com/2010/01/16/fix-problem-nvidia-geforce-965m-gt-crash-ubuntu-karmic/

Other potential things to test:
Nvidiabl:

1.4.5. Re-enable hibernate in xfce panels

See http://www.bio.brandeis.edu/~shaikh/linux/suspend.htm

sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla


Content to add:

[Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes

1.4.6. Solve gpg issues with BAD SIG

From: http://askubuntu.com/questions/127326/how-to-fix-missing-gpg-keys

For Ubuntu 12.04 Precise: Permanent solution
to this error message occurring after adding a new repository and updating repository list. This is due to a server which address is no more valid. So just change the address to a good one.

Open the file ~/.gnupg/gpg.conf with a text editor.

sudo nano ~/.gnupg/gpg.conf


then, in this file, find the following bold line (116th line) (which should be default as follow):

[...] keyserver hkp://keys.gnupg.net # keyserver mailto:pgp-public-keys@keys.nl.pgp.net # keyserver ldap://keyserver.pgp.com


then add the following bold line, to finally give the following result:

(add # to the second line as follow to comment out the old address)

[...] keyserver http://keyserver.ubuntu.com # keyserver hkp://keys.gnupg.net # keyserver mailto:pgp-public-keys@keys.nl.pgp.net # keyserver ldap://keyserver.pgp.com


Save the file

In terminal:

sudo rm /var/lib/apt/lists/* -vf sudo apt-get upgrade
Image Seed: noun \ˈsēd\ : the beginning of something which continues to develop or grow

Knowledge seeds

Switch Language