De Windows à Linux à Mac

Le Père Noël est passé plus tôt que prévu cette année et a déposé :

Mac book Pro 13.3" 2.4 GHz 4Go 250Go Mac OSx 10.6

un Mac book Pro 13.3″ 2.4 GHz 4Go 250Go Mac OSx 10.6 au pied de mon sapin.

J’avais l’habitude de développer sous un PC Linux avec twinview (2 écrans) et sur des netbooks (Asus EEEPC 10″ (Windows XP) et Asus N10 (Windows Vista)) et j’avais besoin de soulager ma vue quelque peu. J’avais donc l’intention d’acheter un notebook 13″. J’avais toujours été un peu réticent à acheter un matériel Apple puisqu’il est toujours un peu plus cher que son “équivalent hardware” en PC. Cette fois-ci, j’ai changé d’avis et choisi un MacBook Pro 13.3″ qui a coûté environ 1.100 €.

Pas besoin de préciser que je n’ai aucun regret : au delà du bel objet, il est fourni avec un lot de logiciels très efficaces comme Time machine (sauvegarde auto des données sur un HD externe et possibilité de restaurer une sauvegarde antérieure), Automator (pour créer des scripts à charger au démarrage, par exemple),…

Pour le développement Web, j’ai aussi installé :

  • Aptana
  • Mamp (Apache, MySql & PHP pour Mac)

Installer des logiciels sur Mac est très aisé (usage simple de fichiers .dmg) et Aptana (éditeur PHP basé sur Eclipse-Java) est très avide de ressources sous Windows et Linux OpenSuse mais semble beaucoup plus léger sur le MacBook.

La configuration du MacBook à mes besoins m’a pris une demi journée à peine alors que mon dernier netbook Windows m’avait pris une semaine (pour que l’OS effectue précisément ce que je voulais qu’il fasse).

From Windows to Linux to Mac

Santa Claus has dropped a present a bit earlier than usual, this year :

Mac book Pro 13.3" 2.4 GHz 4Go 250Go Mac OSx 10.6

a Mac book Pro 13.3″ 2.4 GHz 4Go 250Go Mac OSx 10.6

I used to develop on a Linux desktop with twinview (2 screens) and on netbooks (Asus EEEPC 10″ (Windows XP) and Asus N10 (Windows Vista)) and I needed to relieve my eyesight. So, I wanted to buy a 13″ screen notebook. I had always been a bit reluctant to buying Apple stuff since they’re a bit more expensive than “hardware equivalent” solutions. This time, I’ve changed my mind and chose this MacBook Pro 13.3″ which cost about 1.100 €.

Needless to say I have no regrets. It’s a beautiful object with great embedded apps like Time machine (auto save of data on external HD), Automator (creating script to load at startup, for example),…

For Web developing purposes I’ve insatlled :

  • Aptana
  • Mamp (Apache, MySql & PHP for Mac)

Installling software is very straightforward (simple use of .dmg files) and Aptana (PHP editor based on Eclipse-Java) is very resource-hungry under Windows and Linux OpenSuse but seems much lighter on the MacBook.

It took me half a day to first start the MacBook and configure it to my needs whereas my last Windows netbook took me a week to configure (to have the OS precisely do what I wanted it to do).

Windows + OpenSuse dual boot configuring GRUB

You can read more about “Installing Opensuse 11.2″ and “OpenSUse Linux driver issues”.

GRUB (GRand Unified Bootloader) is a free multiboot software that is loaded at boot and displays available OS. Under OpenSuse 11.2, you’ll find GRUB configuration file in /boot/grub/menu.lst. Open a terminal and type

kdesu kwrite /boot/grub/menu.lst

to open and edit GRUB configuration file (you’ll be asked root password).

GRUB structure

GRUB configuration file has the following structure :

  • options : Default OS => OS that loads at boot by default
  • timeout : time GRUB loader screen will be displayed before automatically booting
  • several sets of configuration lines associated with each available OS

Setting default boot

In order to set the default OS in GRUB file, simply change the line

default 0

This will load the first OS listed in GRUB file while default 1 will load the second OS listed instead.

OSs boot configuration

In my own configuration, I have 2 hard disks (OpenSuse installed on the first hard disk and Windows7 installed on the second HD) :

hd0 hosts OpenSuse OS and hd1 hosts Windows 7. So GRUB configuration file should take this structure into account :

#OpenSuse 11.2
title openSUSE 11.2 – 2.6.31.8-0.1
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.8-0.1-default root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part2 resume=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part1 splash=silent quiet showopts vga=0x31a
initrd /boot/initrd-2.6.31.8-0.1-default

#Windows7
title windows7
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
chainloader +1

I’ve just added the “Windows7″ section to the original file. This configuration uses the swapping technique since Windows can’t boot if it is not installed on the first HD (hd0). As I’ve installed it on hd2 (it may be hd1 on your machine), GRUB will virtually swap the first and second HD throug map command.

Linux OS

Dealing with PHP and MySql will some day lead the web developer to scripting on another OS than Microsoft Windows.

WAMP solutions under Windows

Wamp logoIn order to run a dynamic PHP-MySql website on a local Microsoft Windows machine, the developer needs to install a WAMP software (i.e. Windows, Apache, MySql, Php) like WampServer (my favourite) or EasyPhp (the development of which stayed inactive for a while, some years ago, but which has now been updated). Those webdevelopment platforms all come from LAMP solutions, an acronym for Linux, Apache, MySql, Php. LAMP is free software and is part of many Linux OS distributions.

Choosing a Linux OS

linux logoAs Netcraft states it, websites across the net are mainly run under Apache Servers. Developing websites under a Linux OS may be the right solution if the developer :

  • feels at ease with Linux terminal command lines
  • can find hardware driver versions developed for Linux OS
  • can adapt to linux softwares

If the above requirements can be fulfilled, the developer is ready to change OS and choose the Linux distribution that suits him best. A large number of free solutions are available on the internet. If he is hesitating about the right distribution to choose, he may take the Linux distribution Chooser test (multi-lingual).

Once the distro is chosen, let’s see how it can be installed.

Having tried some Live CDs and DVDs beforehand, the developer will have a good idea of the Desktop environment (KDE or Gnome). My experience led me to choose the linux Server Distro OpenSuse.org.

Md5sum check of the downloaded distro

OpenSuse 11Once downloaded as an ISO file, OpenSuse DVD should be checked before install. This is easily done by checking the md5sum of the downloaded file. You can run Fastsum to achieve this. The result Fastsum gives you after analysis must be strictly equivalent to the md5sum provided by OpenSuse.org.

Where and how to install?

For my first Linux install as a newbie, I bought a new sata hard disk (HD). I did not want to run any risk with my Windows HD. I disconnected my Windows HD and connected the brand new HD.

I started the computer and changed configuration of the boot sequence in BIOS for my computer to start checking the DVD drive instead of the HD. So at reboot, Opensuse DVD inserted, my computer boots on the DVD drive and setup loads.

Installing OpenSuse

Opensuse is provided with a graphic install interface that allows you to install it by clicking (no command line knowledge necessary at this stage).

Just follow the steps and configure your OS. I chose KDE Desktop as environment because it provides me with softwares I need as a developer.

Linux-Windows multi-boot

It is of course possible to start Windows from Linux. Remember I chose to install Linux and Windows on 2 physical separate HD. My OpenSuse is my primary HD. I then connected my secondary Windows HD. Under Linux, you’ll have to change GRUB to be able to start Windows from Linux prompt. Indeed, Windows won’t start if it is not primary HD.

As root, you’ll have to change grub loader in /boot/grub/menu.lst. Change the line concerning Windows (or add it if necessary) :

title Windows
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1

This will re-map your HD and make the system believe HD0 is the Windows HD.

Linux drivers

Whatever your hardware configuration, it should run (somehow) under Linux. Linux is only delivered with Open Source drivers, so you may have surprises at first boot with your graphics card, for example. Refer to the Internet for support in this matter. Nvidia has developed specific drivers for Linux.

Webliography :

Netcraft survey – November 2009

WampServer

Linux distribution Chooser

OpenSuse.org

Md5sum check