MacOnLinuxHowto

Differences between revisions 23 and 25 (spanning 2 versions)
Revision 23 as of 2006-05-24 05:52:08
Size: 12414
Editor: S0106000fb085cc63
Comment: add cat cleanup
Revision 25 as of 2006-05-24 12:49:18
Size: 8404
Editor: 80-41-23-7
Comment: fix wikilink
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
Line 11: Line 10:
|| Note: installing MOL on dapper has become much simpler. I'll make a MacOnLinuxHowtoDapper, and then after the dapper release there can be a name change and rearange.|| = Introduction =
Line 13: Line 12:
This document tries to explain how to install Mac-on-Linux on Ubuntu. Mac-on-Linux is available in the universe repository, but you'll have to build the {{{mol.ko}}} and {{{sheep.ko}}} kernel modules yourself. There are no binary packages of these modules available for the default Ubuntu kernel. Mac-on-Linux (MOL) allows you to run MacOS 9 and MacOS X from within Linux. It requires a Mac OS (9/X) and PowerPC computer. As it does not need to emulate a processor it runs at near native speeds. see http://www.maconlinux.org/ for full details.
Line 15: Line 14:
Mac-on-Linux cannot be installed on machines with an Intel compatible processor. It is only available for !PowerPC. This howto assumes that you have a working install on MacOS on your computer. It is also possible to use MOL to install MacOS into a disk image, see {{{man mol}}} for more details.

The MOL kernel modules are included in DapperDrake so it is no longer necessary to compile and install them manually.
Line 19: Line 20:
To install all of Mac-on-Linux, you'll need to enable the universe and multiverse (for Mac OS X support) repositories. You do this by editing your {{{/etc/apt/sources.list}}} file. In this file, change the lines To install all of Mac-on-Linux, you'll need to enable the universe and multiverse, see AddingRepositoriesHowto for details.
Line 21: Line 22:
{{{
   #deb http://archive.ubuntu.com/ubuntu warty main restricted universe
   #deb-src http://archive.ubuntu.com/ubuntu warty main restricted universe
}}}
= Pre DapperDrake systems =
Line 26: Line 24:
to look like this Previous to Ubuntu 6.06 DapperDrake it was necessary to build the MOL modules from source. Please follow the instructions at ["MOLModulesHowto"] before continuing.
Line 28: Line 26:
{{{
   deb http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
   deb-src http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
}}}
= Installing Mac-on-Linux =
Line 33: Line 28:
After editing, you'll need to resynchronise your package index files with the command You will need to install the following packages
{{{mol}}}
and
{{{mol-drivers-macosx}}}
and/or
{{{mol-drivers-macos}}}
for MacOS X and/or MacOS 9 support.
Line 35: Line 36:
{{{
   bash:~$ sudo apt-get update
}}}

Now you can install all the needed packages with the command

{{{
   bash:~$ sudo apt-get install mol-modules-source build-essential linux-headers-$(uname -r)
}}}

If you are running Breezy you will also need gcc-3.4
{{{
   bash:~$ sudo apt-get install gcc-3.4
}}}
To set gcc-3.4 as the default compiler run
{{{
   bash:~$ sudo ln -sf /usr/bin/gcc-3.4 /usr/bin/gcc
}}}
at the end of the building process you will need to set the default compiler back to gcc-4.0 using the command
{{{
   bash:~$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc
This can be done using Synaptic Package Manager or by running the following commands
{{{sudo apt-get install mol
sudo apt-get install mol-drivers-macosx # for MacOS X
sudo apt-get install mol-drivers-macos # for MacOS 9
Line 59: Line 43:
<!> '''Note'''
  If you run into problems modifying the sources.list file, check out this document: http://www.ubuntulinux.org/wiki/AddingRepositoriesHowto.

Short overview of the necessary packages:

{{{mol-modules-source}}}
  This package contains the source for the mol kernel modules.

{{{build-essential}}}
  A metapackage that depends on the applications and tools necessary to build Ubuntu packages.

{{{linux-headers}}}

just do
{{{
$ uname -r
}}}

and it will resolve to your current kernel version insuring that your kernel and headers source version match.

= Editing the kernel headers =
A bug in the Ubuntu kernel headers maycause the compilation of the Mac-on-Linux to fail.

This seems to be fixed in version 2.6.12.9-powerpc, but in case of problem, this issue is reported in Bugzilla as [https://bugzilla.ubuntu.com/show_bug.cgi?id=2728 bug #2728]

Only a small change is needed to make sure the modules will compile.

attachment:IconsPage/IconNote.png

<!> '''Note'''
  This is a hack. It just bypasses a bug in the kernel headers. You do not have to do this in Hoary. Only the Warty kernel headers have this problem. (The hack may be necessary if you upgraded from Warty to Hoary but kept the old kernel.)

You'll need to edit a file called setup.h within the hierarchy of the linux kernel headers.
{{{
   bash:~$ sudo gedit /usr/src/linux-headers-2.6.8.1-4-powerpc/include/asm/setup.h
}}}

In this file, you need to comment out the line {{{#include <asm-m68k/setup.h>}}} so the file will look like this:

{{{
   #ifdef __KERNEL__
   #ifndef _PPC_SETUP_H
   #define _PPC_SETUP_H

   #define m68k_num_memory num_memory
   #define m68k_memory memory

   /* #include <asm-m68k/setup.h> */
   /* We have a bigger command line buffer. */
   #undef COMMAND_LINE_SIZE
   #define COMMAND_LINE_SIZE 512

   #endif /* _PPC_SETUP_H */
   #endif /* __KERNEL__ */
}}}

Now you are ready to start compiling the kernel modules.

= Building the mol modules =

<!> '''Note'''
Before building the package you need to make sure you have {{{debhelper}}} and {{{m4}}} packages. If you don't the build will fail. So, to be sure :
{{{
   bash:~$ sudo apt-get install debhelper m4
}}}


The package {{{mol-modules-source}}} installed a file {{{mol-modules.tar.gz}}} in the directory {{{/usr/src}}}. Unpack the file with the commands

{{{
   bash:~$ cd /usr/src
   bash:~$ sudo tar xzvf mol-modules.tar.gz
}}}

Next, set some environment variables. These are needed for the compilation.
{{{
   bash:/usr/src$ export KVERS="$(uname -r)"
   bash:/usr/src$ export KSRC="/usr/src/linux-headers-$(uname -r)"
   bash:/usr/src$ export KEMAIL="your@email.address"
   bash:/usr/src$ export KMAINT="Your Name"
   bash:/usr/src$ export KDREV="ubuntu0"
}}}

attachment:IconsPage/IconNote.png

<!> '''Note'''
  You should, of course, replace {{{your@email.address}}} and {{{Your Name}}} with your actual email address and your name. These are used for the Maintainer field in the debian package you're about to create.

Use the following commands to actually build the modules:
{{{
   bash:/usr/src$ cd modules/mol
   bash:/usr/src/modules/mol$ sudo debian/rules build
}}}

After compiling the modules, create a debian package of the modules with the command
{{{
   bash:/usr/src/modules/mol$ sudo debian/rules binary-mol-modules
}}}

This will result in a debian package {{{mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb}}} in the directory {{{/usr/src}}}

= Installing Mac-on-Linux =

The first package you need to install are the kernel modules you just built. This is because they provide the virtual package {{{mol-modules}}} on which the ''mol'' package depends.

{{{
   bash:~$ sudo dpkg -i /usr/src/mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb
}}}

attachment:IconsPage/IconNote.png

<!> '''Note'''
  The file name will change as modifications are made to the *mol* source, so, make sure that you change the above line to match the file name as it exists on your computer. As of December,1st 2005, the file name is called {{{mol-modules-2.6.12-9-powerpc_0.9.70+ubuntu0_powerpc.deb}}}.

Now you can install the rest of the Mac-on-Linux packages

{{{
   bash:~$ sudo apt-get install mol mol-drivers-linux mol-drivers-macos mol-drivers-macosx
}}}

Short overview of these packages:

{{{mol}}}
  The actual Mac-on-Linux emulator.

{{{mol-drivers-linux}}}
  Package containing the drivers needed to run Linux within the emulator.

{{{mol-drivers-macos}}} (Not found)
  Package containing the drivers needed to run Mac OS 9 and earlier within the emulator.

{{{mol-drivers-macosx}}} (Not found)
  Package containing the drivers needed to run Mac OS X within the emulator.

= Running Mac-on-Linux as a normal user =

By default, Mac-on-Linux requires root privileges to run. The following command makes sure you can run Mac-on-Linux as a normal user.

{{{
   bash:~$ sudo dpkg-statoverride --update --add root root 4755 /usr/lib/mol/bin/mol
}}}

= Configuring and running Mac-on-Linux =
= Configuring Mac-on-Linux =
Line 216: Line 58:
You basically type 'y' to try out a confuration, and then 'y' if you can see a nice gradient on the screen. The red screen comes out as a stripes, but it seems to work anyway. If you get a random mess, blank screen or some other problem then press 'n' You basically type 'y' to try out a configuration, and then 'y' if you can see a nice gradient on the screen. The red screen comes out as a stripes, but it seems to work anyway. If you get a random mess, blank screen or some other problem then press 'n'
Line 218: Line 60:
Now you should be able to run {{{startmol --osx}}}     (just startmol for Mac OS 9), and Mac OS X will boot up in a window or on a new virtual terminal. You need to install the MOL package that you find on the desktop. This provides sound and network drivers. == Running Mac-on-Linux as a normal user ==

By default, Mac-on-Linux requires root privileges to run. The following command makes sure you can run Mac-on-Linux as a normal user.

{{{
sudo dpkg-statoverride --update --add root root 4755 /usr/lib/mol/bin/mol
}}}

= Running MOL =

Now you should be able to run {{{startmol --osx}}} (just startmol for Mac OS 9), and Mac OS X will boot up in a window or on a new virtual terminal. You need to install the MOL package that you find on the desktop. This provides sound and network drivers.
Line 221: Line 73:

If the video modes are correctly configured then pressing CTRL + ALT + F8 (sometimes higher F keys) will take you to a full screen MOL. CTRL + ALT + F7 should take you back to your Linux desktop.

If you want mol to always start full screen, edit /etc/mol/molrc.video and change {{{enable_xvideo: yes}}} to {{{
enable_xvideo: no
}}}
Line 258: Line 116:
Now run {{{startmol --osx}}}, and we can set up the network on the Mac OS X side. MOL creates a network tunnel called tun0 at the linux end, and en3 on the Mac OS X end. Now run {{{startmol --osx}}}, and we can set up the network on the Mac OS X side. MOL creates a network tunnel called tun0 at the Linux end, and en3 on the Mac OS X end.
Line 263: Line 121:

== Alternative - Networking without DHCP ==

Do as above, but without installing dhcpd. Once you have completed the setup, run ifconfig to check the ip address for the tun0 interface. Mine was given as follows:
{{{
tun0 Link encap:Ethernet HWaddr DA:68:17:7B:32:C1
          inet addr:192.168.40.1 Bcast:192.168.40.255 Mask:255.255.255.0
          inet6 addr: fe80::d868:17ff:fe7b:32c1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:45 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:6259 (6.1 KiB) TX bytes:6 (6.0 b)
}}}

In OS X, then set up the en3 network port manually, by allocating an appropriate IP (in my case 192.168.40.2 was a good choice), set Router and DNS server to the ip associated with your tun0 interface in linux (192.168.40.1) and the subnet mask to 255.255.255.0. Now you should be ready to go.
Line 280: Line 154:
= OS 9 Double Click and Slow Response Trouble = == OS 9 Double Click and Slow Response Trouble ==
Line 284: Line 158:
= To run Tiger and Eliminate Annoying Sluggish Behavior on MOL Install this Patched Version = == To run Tiger and Eliminate Annoying Sluggish Behavior on MOL Install this Patched Version ==
Line 308: Line 182:
 

attachment:IconsPage/PicDocs.png TableOfContents

Introduction

Mac-on-Linux (MOL) allows you to run MacOS 9 and MacOS X from within Linux. It requires a Mac OS (9/X) and PowerPC computer. As it does not need to emulate a processor it runs at near native speeds. see http://www.maconlinux.org/ for full details.

This howto assumes that you have a working install on MacOS on your computer. It is also possible to use MOL to install MacOS into a disk image, see man mol for more details.

The MOL kernel modules are included in DapperDrake so it is no longer necessary to compile and install them manually.

Preparing your system

To install all of Mac-on-Linux, you'll need to enable the universe and multiverse, see AddingRepositoriesHowto for details.

Pre DapperDrake systems

Previous to Ubuntu 6.06 DapperDrake it was necessary to build the MOL modules from source. Please follow the instructions at ["MOLModulesHowto"] before continuing.

Installing Mac-on-Linux

You will need to install the following packages mol and mol-drivers-macosx and/or mol-drivers-macos for MacOS X and/or MacOS 9 support.

This can be done using Synaptic Package Manager or by running the following commands {{{sudo apt-get install mol sudo apt-get install mol-drivers-macosx # for MacOS X sudo apt-get install mol-drivers-macos # for MacOS 9 }}}

Configuring Mac-on-Linux

If you are not comfortable with editing text look at NanoHowto.

This assumes that you have a working install of Mac OS X or 9, on a partition on you harddrive somewhere.

There are a few settings you may want to play with be for you use mol. One of them is memory. The default is 96mb, which is barely enough to boot Mac OS X (although ok for Mac OS 9 if you arn't planning to do much).

In /etc/mol/molrc.osx (molrc.macos for Mac OS 9) find ram_size:   96 (or  ram_size:   48 in molrc.macos) and change to at least 128

Its possible to give mol more RAM than you physically have, and linux will deal with putting stuff into swap, but you are likely to end up with a slow system. (It may also crash if you give too much RAM; I had to keep a ram_size of 48 in my molrc.macos.)

Then it is worth setting up the video modes, run sudo molvconfig

You basically type 'y' to try out a configuration, and then 'y' if you can see a nice gradient on the screen. The red screen comes out as a stripes, but it seems to work anyway. If you get a random mess, blank screen or some other problem then press 'n'

Running Mac-on-Linux as a normal user

By default, Mac-on-Linux requires root privileges to run. The following command makes sure you can run Mac-on-Linux as a normal user.

sudo dpkg-statoverride --update --add root root 4755 /usr/lib/mol/bin/mol

Running MOL

Now you should be able to run startmol --osx (just startmol for Mac OS 9), and Mac OS X will boot up in a window or on a new virtual terminal. You need to install the MOL package that you find on the desktop. This provides sound and network drivers.

To exit mol, choose shutdown from the apple menu.

If the video modes are correctly configured then pressing CTRL + ALT + F8 (sometimes higher F keys) will take you to a full screen MOL. CTRL + ALT + F7 should take you back to your Linux desktop.

If you want mol to always start full screen, edit /etc/mol/molrc.video and change enable_xvideo: yes to

enable_xvideo: no

See its manpage for more usage information.

Configuring Network

If you are using mol to use the iTunes music store, or watch flash on the web, then you will need to get networking running.

You will need to install ipmasq, dnsmasq and dhcpd using synaptic or

 sudo apt-get install ipmasq dnsmasq dhcpd

Then enable dhcp for the tun0 interface that mol uses, in /etc/default/dhcp, put the line

 INTERFACES="tun0"

Then in /etc/mol/molrc.net add the line

 netdev: tun0 -tun

and in /etc/mol/tunconfig at the bottom just before

 exit 0

add the lines

   /etc/init.d/ipmasq restart
   /etc/init.d/dnsmasq restart

Now run startmol --osx, and we can set up the network on the Mac OS X side. MOL creates a network tunnel called tun0 at the Linux end, and en3 on the Mac OS X end.

Once you have logged into to Mac OS X open up the system preferences. Make sure that en3 is set to configure with DHCP.

Now open up Safari or Firefox, and if you are lucky you should have a web connection.

Alternative - Networking without DHCP

Do as above, but without installing dhcpd. Once you have completed the setup, run ifconfig to check the ip address for the tun0 interface. Mine was given as follows:

tun0      Link encap:Ethernet  HWaddr DA:68:17:7B:32:C1
          inet addr:192.168.40.1  Bcast:192.168.40.255  Mask:255.255.255.0
          inet6 addr: fe80::d868:17ff:fe7b:32c1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:45 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:6259 (6.1 KiB)  TX bytes:6 (6.0 b)

In OS X, then set up the en3 network port manually, by allocating an appropriate IP (in my case 192.168.40.2 was a good choice), set Router and DNS server to the ip associated with your tun0 interface in linux (192.168.40.1) and the subnet mask to 255.255.255.0. Now you should be ready to go.

There is some more info at http://www.csse.monash.edu.au/~ctwardy/mol-debian-benh.html

Trouble Shooting

If you get mol module not found errors, try insmodding it manually

insmod /lib/modules/2.6.(your kernel version)-powerpc/misc/mol.ko

If OSX doesn't start, edit the blkdev settings in /etc/mol/molrc.osx. Your OSX boot partition should not be mounted under linux and should have the setting of

blkdev   /dev/hda3 -boot -rw

Obviously the hda3 part could be different for you.

OS 9 Double Click and Slow Response Trouble

If you are having very slow response with OS 9, you probably need to open the MOL Install CD that appears on the desktop and drag the MOLAudio to the System Folder. Then you need to go to the sound control panel and enable the MOL Audio for output. (Before I did this I was unable to even double click. Afterwards, the response was more snappy.) The real fix is to use a more recent version of Mac-on-Linux though. To do that, I am providing my notes below.

To run Tiger and Eliminate Annoying Sluggish Behavior on MOL Install this Patched Version

Thanks to folks on the MOL mailing list for these tips. [http://www.maconlinux.org/lists/index.html]

1) Download the latest kernel source. You can user uname -r to determine your version. Mine was 2.6.12-9-powerpc. You can also use the synaptic package manager or Adept to do this.

sudo apt-get install linux-source-2.6.12

2) Follow the instructions on this Wiki for building the kernel found at [https://wiki.ubuntu.com/KernelBuildPPCHowTo].

3) Download the patched MOL that Joe Jezak has kindly provided. [http://dev.gentoo.org/~josejx/] Look for the latest mol version he has provided.

4) Extract it using tar -jxvf

5) Build it using make.

6) Set up and start MOL using the instructions in the section above. Actually, I had better luck on the networking setup with the sheep driver. I just made the /etc/mol/molrc.net have the line:

netdev:         eth1 -sheep

You may need eth0 instead if that is your primary network interface (do an ifconfig to find out). With this setting Tiger boots and gets an IP address via dhcp from my local wireless router.

A side note: I have not been able to boot an OS 9 partition with this setup and there have been some similar notes on a Yellow Dog Linux forum. If I figure that out, I'll append this note.


CategoryDocumentation CategoryCleanup

MacOnLinuxHowto (last edited 2008-08-06 16:34:59 by localhost)