MacOnLinuxHowto
attachment:IconsPage/PicDocs.png
Index
- Preparing your system
- Editing the kernel headers
- Building the mol modules
- Installing Mac-on-Linux
- Running Mac-on-Linux as a normal user
- Configuring and running Mac-on-Linux
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 cannot be installed on machines with an Intel compatible processor. It is only available for !PowerPC.
Preparing your system
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
#deb !http://archive.ubuntu.com/ubuntu warty main restricted universe #deb-src !http://archive.ubuntu.com/ubuntu warty main restricted universe
to look like this
deb !http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse deb-src !http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
After editing, you'll need to resynchronise your package index files with the command
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)
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-$(uname -r)
- $(uname -r) will resolve to your current kernel version insuring that your kernel and headers source version match.
Editing the kernel headers
At the moment of this writing, a bug in the Ubuntu kernel headers will cause the compilation of the Mac-on-Linux to fail. This issue is reported in Bugzilla as [https://bugzilla.ubuntu.com/show_bug.cgi?id=2728 bug #2728]
But 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
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.8.1-4-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.8.1-4-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 2005/01/22 the file name is called *mol-modules-2.6.8.1-4-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
- Package containing the drivers needed to run Mac OS 9 and earlier within the emulator.
mol-drivers-macosx
- 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
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 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'
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.
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.
There is some more info at http://www.csse.monash.edu.au/~ctwardy/mol-debian-benh.html