Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, 20 October 2012

Installing Ubuntu 12.10 on MacBookPro9,1 and all is good

Short Version

You need rEFInd, Ubuntu 12.10, 3.6 kernel, macfanctld.

All is good - except Nvidia drivers that did not work so well, especially by breaking resume which is something I must have.

Details


This is what I am doing:

Getting Ubuntu

Download ubuntu 12.10 - why not consider donating as well?
Burn to DVD.
Eject DVD.

Booting to Live Ubuntu

Shutdown MacBookPro9,1 (MBP).
Hold down 'option' key from here on.
Turn on MBP.
Push in DVD.
Hold down 'option' until you see pictures of hard drives and perhaps CDs and USBs.
Wait a while. Eventually you will see two DVDs: 'Windows' and 'EFI Boot'.
Click on 'EFI Boot'.
Select 'EFI Boot' with arrow keys and hit Enter.
Select 'Try Ununtu without installing' and hit Enter.
Ubuntu Live will start. This will take a few minutes.

Installing

Double-click 'Install Ubuntu 12.10'.
I then selected English and due to my own special requirements, I selected 'something else'.
You might like to try 'Install Ubuntu alongside...'

Note: if you select 'Erase disk and install Ubuntu' then you will get exactly that - my guess is that you DO NOT want to do that.

Here I have to setup my partition manually - you will not have to do this.
If you are interested in my setup, I have this:
sda1: efi 209 MB (EFI partition)
sda2: hfs+ 70 GB (OS-X)
sda3: hfs+ 650 MB (OS-X recover?)
sda4: biosgrub 200 MB (don't remember)
sda8: swap 20 GB
sda5: ext4 20 GB (linux root)
sda6: ext4 20 GB (linux root No. 2)
sda7: ext4 350 GB (/home)

(Boot loader on sda)

Selected Sydney, English(US) keyboard layout, created my user account, selected an icon, and Ubuntu started to install.

It was very quick to install for me.

Shutting Down

Hit 'Restart Now' button.
DVD ejected.
Hit Enter.
Hold down 'option' as soon as you here your MBP starting up.

Booting into Ubuntu

Hold down 'option' until you see pictures of hard drives and perhaps CDs and USBs.
Select 'Windows' and hit Enter.
I got an unhelpful 'Grub Recovery' prompt.
RATS!

Fixing Grub Recovery

I suspect that grub could not read or find my Ubuntu partition. Just a guess.
Odd. It is not as if there aren't very many MacBookPro9,1's around...
I have rEFInd installed so I tried that.
You can install rEFInd from OS-X. See here.
You may be able to use rEFIt if you have that installed, but I recommend rEFInd.

Booting using rEFInd

Shutdown.
Power on.
Select Ubuntu.
After some dodgy screen effects, Ubuntu booted to a blue background.

Getting 'Everything' Working

Ubuntu first wanted me to install language support.
To do this you will need a wired Ethernet connection to your Internet router.

Wireless

Install these packages
  • b43-fwcutter
  • linux-firmware (this should already be installed)
  • linux-firmware-nonfree
Reboot.

Note: I think a friend suggested bcmwl-kernel-source instead of these files, but it did not work for me - perhaps I misunderstood.

Kernel Upgrade

My previous experience suggests that a 3.6 kernel works better.
So I have installed four files from here - you can pick what kernel you want. Install the 'all' file, then the other header file followed by each image file.

UPDATE: I have found that only 3.7.0 and 3.7.5 (so far) work.

After a reboot, I noticed that my initial screen was no longer corrupted.

Fan

You have to have fan control or else your MBP will run too hot.
I used macfanctld from mactel support PPA (precise version).
I also have also written my own for a MBP4,1 that I'll test someday.

Summary

You need rEFInd, Ubuntu 12.10, 3.6 kernel, macfanctld.
Since Fan and sleep/wake are working now, I'm happy to turn this MBP into my daily compute.

I have also tried various Nvidia drivers - some work, but at a high cost of not resuming after standby. So I have removed these.



This works fine, but requires rEFInd. This is not a bad thing as rEFInd is really good, well documented and seems to be maintained by someone who knows a lot about EFI.

But, I want to try to boot to Linux without rEFInd. This may not be possible.

Another Attempt


Boot to OS-X.
Instructions taken from here - Read these. Below is just what I did, not something you should just blindly copy.
Download and install gdisk.
Open a terminal.
sudo gdisk /dev/disk0
I deleted my unwanted Linux partitions from previous attempts.
I created a new partition: id 99, 128M, type ef02 as per instructions.
Restart OS-X, hold down 'option' key and insert Ununtu DVD.
When available, select 'EFI Boot'.
Select 'Install Ubuntu'.
Select 'Something Else'.
Setup a 1 GB reiser boot, 19 GB ext4 root, 19 GB spare, 20 GB swap and rest is ext4 home.
After install, boot to OS-X.
sudo gdisk /dev/disk0
Follow instructions to remove hybrid MBR.
I made a Super Grub 2 Disk but it could not identify any grub 2 installation.

This got me no where, except I no longer have a 'dangerous' hybrid MBR.












Saturday, 27 June 2009

Cloud Computing

Cloud computing is all about running a service or a server using a pool of computers. The computers could be your own or you could lease time on a commercial cloud.

Who's Who


Some of the big names in this space are Amazon, Google, GoGrid and ElasticHosts. Apart from Google, they allow you to run a complete operating system and whatever other software you like on their infrastructure - which is why it is called Infrastructure as a Service (IaaS). Google's is a bit different, it is a Platform as a Service (PaaS). Google also offers applications like Google Docs (word processor, spreadsheet, etc.) which is known as Software as a Service (SaaS).

Infrastructure as a Service

Infrastructure as a Service interests me at the moment. It promises to disrupt current practice. No longer does a company need to buy servers for their business. They can lease time from one or more providers without having to outlay any capital. Nor do they need to maintain or upgrade any hardware.

How does it work?


An example may help.
Your IT department wants to upgrade one third of your servers. A normal request that you might get each year. Instead of investing in new machines they suggest that the company leases time on ElasticHosts (EH) server cloud and on Amazon's AC2 as a backup site.

The IT people would setup accounts, request a certain number of virtual servers and copy the disks of the current servers to EH and AC2. Each virtual server would be configured to have the necessary number of CPUs, RAM and network bandwidth. The IT department would then administer the servers from your offices just as if they are real servers: They can start them, pause them and stop them just like a real server.

But, they can also upgrade them in an instant. And, they tell you, it costs 25c per hour for 1GHz CPU, 1GB RAM, 1000GB disk and 100GB network traffic - $180/month. But they say that at night they can turn half the servers off so it would cost about $120/month on average. They can do the same on weekends and on public holidays too.

And if the company had a busy period, they could order more servers or upgrade the existing ones almost instantly and afterwards they would downgrade them.
Private Clouds

It sounds like magic. But these clouds can also be established using your existing infrastructure and if you need additional capacity you can lease it by the hour.

Making a Virtual Server


I wondered how hard it might be to make a disk image to run on a cloud. It turns out to be rather easy.

I have a Ubuntu linux virtual machine running in VMWare Fusion. It allows me to run linux on my Mac and it works well (I should mention Sun's VirtualBox here as well which does the same job and is free and Open Source).

Ubuntu provide a program to make the creation of virtual machines an amost trivial task.

sudo ubuntu-vm-builder kvm jaunty

'sudo' allows the program to run as an administrator.
'kvm' specifies that I want a virtual machine that will run on a kvm based cloud such as ElasticHosts. I could have used EC2 to make an image that would run on Amazon's EC2.
'jaunty' specifies the version of Ubuntu server that I wanted it to be.


(I used some additional command line options that are not needed.)

A little while later, I had a directory containing a disk image and the command necessary to run it. With some other configuration changes it it possible to create a VM in a few minutes.

Since my Ubuntu machine is itself a virtual machine running on a Mac I did not think that I could test the new VM. But I thought that I would try to run it to see what it might do. It began by complaining that it could find KVM support and then ran the VM in an emulator (QEMU).

The machine booted like a real PC and eventually gave me a login prompt.


Appliances


Some companies are now offering their applications or operating systems as a VM to download - ready to go. VMWare has a large selection of pre-build VMs.

The Future


It looks interesting. Some other work in this area focuses on standardising the management interface for a cloud of VMs, standardising the VMs so that any VM can run on and public or private cloud and schedulers so that an administrator can prioritise VMs and schedule the start-up and shutdown of any VM. Read more about OpenNebula and Haizea.

Sunday, 15 March 2009

Ubuntu 8.10 (Intrepid) on a MacBook Pro (4,1)

As the title suggests, I decided to get Ubuntu 8.10 working on my MacBook Pro.

My aim, for a long time, has been to get linux running well on a Mac.


I think that the Ubuntu Team have packaged a brilliant distribution that supports the MacBook Pro very well, but a few tweaks are required.

These mods are documented here.

The process is long and not suitable for beginers. I thought that these changes could be turned into a script that would work for most users that are dual/multi-booting their Mac.

The scripts can be found on a Ubuntu post that I just posted.

Tuesday, 3 March 2009

Dual boot Windows XP/linux fails to boot Windows XP

I had a problem: my dual-boot PC would boot into linux (Ubuntu) fine, but I could not boot into Windows XP.



The Windows boot process would stop after loading hpdskflt.sys (in my case) and then it would restart.

It turns out to be my fault: I changed the hard drive configuration in BIOS to SATA rather than IDE. Switching it back to 'SATA Native=Disable' in my case allows Windows XP to boot normally.

Other BIOSs are likely to have a similar setting such as SATA Mode=IDE or SATA or RAID etc.

A friend, who had the same problem, later found this site which explains the problem in detail.