Tag Archives: Mac OS X

How to run Ubuntu on your Intel Mac, from a USB stick.

When I discovered Virtual Box I vowed never to install Linux again. But then came the crashes. And then I upgraded to Snow Leopard. Screw this, I need some kdevelop goodness now….

So, today I found myself installing ubuntu on a USB stick. Here’s how it goes:

  1. Download, burn and boot from your ubuntu disk of choice. Running a MacBook Pro from July this year I chose the amd64 disk, as a liveCD. To boot from CD just hold down “C” when you hear the angels as your Mac turns on.
  2. Choose “try ubuntu without changing your system” from the menu to boot the OS from the liveCD.
  3. Run the install as usual, specifying the USB drive you plugged in as your disk and selecting “use entire drive” from the partitioning options.
  4. This is where it gets tricky. Restart, and hold down left option (alt). Observe that only the “proper” hard disks are listed – intel Macs don’t natively support USB booting. 😦 cheer up and boot OS X – there is a solution.
  5. Download and install rEFIt – an open source EFI bootloader for just this type of occasion.
  6. Reboot one more time, holding down option, and choose refit.
  7. Choose your “legacy” OS (it only says it in that patronising manner because it’s jealous of the MBR goodness) and fly all the way to open source Heaven without breaking your precious OS X install!

I hope you enjoy this one – you’ll need a fairly decent USB stick though. Cheap ones are terribly slow to write to, so installing and updating may take you well over the 2 hour limit of my how-tos. If you can, I recommend a proper USB HDD in an enclosure – much less worrysome and much quicker.

EDIT: This actually isn’t complete and leaves you with a grub error because the ubuntu installer is a moron and overwrites the MBR on the bootcamp drive, even though you haven’t installed it on that HDD. (my way around this on my previous laptop was to remove the HDD before starting – but I couldn’t quite bring myself to on the shiny new unibody MBP…) you need to resync the MBR with the refit EFI data using the partitioning tool here on the boot menu:

Apologies for the brokenness and thanks to bagellord (see comments) for pointing this out!


MAMP / phpwiki

Today I got a personal wiki working in well under 2 hours on my Mac.

If you are a Mac user and would like an easy way to keep track of rough draft thoughts and your own personal memory jogging how-tos in a secure and simple way, I recommend the following:

  • Download MAMP (Mac Apache, MySQL and PHP)
  • Install by dragging to your applications folder as normal.
  • Use the myPhpAdmin web-software (available at localhost:8888/MAMP/) to configure your database server (mysql) to accept connections from a new user (phpwikiuser, for example) and add a new database for it (e.g. phpwiki).
  • Download phpwiki, and extract the archive using

    tar -xzf phpwiki-version.tar.gz

    (you may not need the z if the extension is just .tar, as safari automatically gunzips the file when it finishes downloading.)

  • Rename the folder to whatever you like (e.g. phpwikiname) and move it into the docroot (default is /Applications/MAMP/htdocs, but you can reconfigure it in preferences).
  • Finally, you will need to open the config file and enter the database login details for it, e.g.

    pico lib/config.php

    or whichever your favourite text editor. (If you just use textedit or word, then you can go to the location (e.g. /Applications/MAMP/phpwikiname/lib/config.php) in finder and double click on the file, choosing TextEdit if no default is set.)

  • Change the db type to mysql, and make sure that the database login details further down (in the mysql section!) match what you entered when you created the account. You could just use ‘root’ and ‘root’, but I would advise a less privileged user which only has permissions over the phpwiki database so it can’t break anything else you end up using MAMP for later.

Thats it! Navigate to localhost:8888/phpwikiname/ and edit your front page. Advantages of phpwiki are that it is small and light, has very simple creating and editing (just creating a link creates the page) and it does the job. It’s disadvantages (very insecure as anyone can edit and see who has been editing down to the IP address) are irrelevant if you are using them on a personal system, although you may prefer something a bit prettier (like mediawiki, which is what wikipedia uses; although I don’t use it because it is a sledgehammer to crack a nut for a personal wiki on your laptop – the instructions would be roughly the same though.).

That’s my 2 hours for today, tomorrow I will be covering the basics of theming a drupal web site.