Wednesday, May 23, 2007

Getting parallels to boot from fedora core paritition on macbook

I recently bought a macbook (2gig ram, 2ghz intel, 80gig hd). It runs both fedora and osx. I can boot to the same fedora core partition both from parallels and in the native dual boot mode. I use the rEFIt boot loaded to choose between linux and osx initially, if I choose linux then control passes from rEFIt bootloader to grub. rEFIt is a bootloader for EFI based systems like Intel macs. EFI is similar to bios on macs. I don't have a clear understanding of firmwares like EFI and BIOS. rEFIt bootloader provides a nice terminal which you can access even before you boot your machine.

The trickier part is to getting parallels to boot from the dualboot fedora root partition. I used bootcamp only to create a partition for linux initially. I tried resizing the OSX partition with parted, but ended up corrupting the OSX partition. So I had to reinstall OSX from scratch. So I advise people to use bootcamp to resize the OSX partition.

Steps involved in getting parallels to boot from dualboot fedora/ubuntu/debian/gentoo partition

1)Use bootcamp to create a new partition for linux.
2)Install rEFIt bootloader
3)Install fedora/ubuntu/gentoo/debian on the new partition
4)Make sure to install grub on SDA/HDA or whatever is the main disk. This happens by default in fedora, I am not sure about how other distros handle this
5)Now when you boot, you should find rEFIt bootloader with two primary options, one to boot OSX and another to boot Linux
6)Boot to OSX and install parallels
7)Start parallels and create a custom distro, for harddisk choose bootcamp option.
8)Edit the pvs file corresponding to the custom distro you created in parallels as follows.
In the [IDE devices] session change the line "Disk 0:0 image = Boot Camp;" to "Disk 0:0 image = Boot Camp;disk0s3"
9)Boot to the linux in parallels. You will find your grub broken. I landed in the grub prompt.
10)In the grub prompt enter as follows
configfile (hd0,0)/etc/grub.conf
11)If everything goes well you will see the grub menu
12)Boot to linux in parallels.
13)If you had already booted linux as a native OS, you will need to reconfigure your X.
14)I have fuse sshfs installed both on OSX and Fedora, So I can mount the OSX partitions in linux and linux partitions in OSX. Eventually I can access all data in my harddisk from both the operatings systems.
15)Choose shared network option in parallels so that you can mount your sshfs paritions using a fixed IP.
16)I use firefox with google browser sync plugin. So I share the same bookmarks and history on both the operating systems.

These steps should ideally work for any linux/unix flavors. It works for me with Fedora Core 6. I am waiting for the Fedora Seven release.

Unsolved Problems
1)Sometimes the keyboard does not work after you choose linux from rEFIt bootloader. So you can't change the options you have set in your grub. you will end up booting to the default one. This seems to be a bug in apple firmware (EFI ??). It has been documented in the rEFIt website.
2)Every time I boot to linux from parallels, I have to enter "configfile" option manually. This is because grub can work only for one set of configuration. I have grub working for dual boot configuration. So I have to manually enter "configfile" option everytime I boot to fedora in parallels.
3)If you choose ram option to some number other than 512mb or 1024mb, you reach kernel panic in parallels.
4)I cannot use function keys on linux when i boot from parallels. Am not sure why parallels is not capturing it. I badly want to use ctrl+alt+f1 to get the ttys. ctrl+alt is used for releasing mouse from parallels. Haven't yet figured a way to getaround this. There seems to be sendkey option in parallels. Will have to explore that.
5)The X-configuration changes when you shift from dualboot linux to parallels linux.


Harish Mallipeddi said...

I'm using VirtualBox instead of Parallels (not as cool as Parallels). It's opensource and needless to say free :)

Anonymous said...

After entering the 'configfile ...' at the grub commandline, I get the following error

Error 18: Selected cylinder exceeds maximum supported by BIOS

I found one thread on the web discussing this, but no solution.

Anonymous said...

Interesting story you got here. I'd like to read something more about that topic. Thnx for sharing this information.
Sexy Lady
Call girls