MacOnLinuxHowto

Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2005-06-15 10:39:07
Size: 8985
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Revision 12 as of 2006-01-02 18:58:57
Size: 11174
Editor: 66-62-174-1
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= MacOnLinuxHowto =
Line 9: Line 7:
http://www.ubuntulinux.org/wiki/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
attachment:IconsPage/PicDocs.png

[[TableOfContents]]
Line 23: Line 15:
=== 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
= 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
Line 35: Line 27:
   deb !http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
   deb-src !http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
   deb http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
   deb-src http://archive.ubuntu.com/ubuntu warty main restricted universe multiverse
Line 51: Line 43:
Note <!> '''Note'''
Line 56: Line 48:
mol-modules-source {{{mol-modules-source}}}
Line 59: Line 51:
build-essential {{{build-essential}}}
Line 62: Line 54:
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.

http://www.ubuntulinux.org/wiki/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.
{{{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.)
Line 80: Line 79:
Line 81: Line 81:
Line 100: Line 101:
=== 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
= 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
Line 107: Line 116:
Line 115: Line 125:
http://www.ubuntulinux.org/wiki/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.

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.
Line 125: Line 136:
Line 130: Line 142:
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
}}}

http://www.ubuntulinux.org/wiki/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*.
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}}}.
Line 152: Line 165:
mol {{{mol}}}
Line 155: Line 168:
mol-drivers-linux {{{mol-drivers-linux}}}
Line 158: Line 171:
mol-drivers-macos {{{mol-drivers-macos}}}
Line 161: Line 174:
mol-drivers-macosx {{{mol-drivers-macosx}}}
Line 164: Line 177:
==== Running Mac-on-Linux as a normal user ==== = Running Mac-on-Linux as a normal user =
Line 172: Line 185:
==== Configuring and running Mac-on-Linux ==== = Configuring and running Mac-on-Linux =
Line 180: Line 193:
In {{{/etc/mol/molrc.osx}}} (molrc.macos for Mac OS 9) find{{{
 
ram_size: 96}}}
and change to atleast 128

Its possible to give mol more RAM then you physically have, and linux will deal with putting stuff into swap, but you are likely to end up with a slow system.
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.)
Line 196: Line 208:
==== Configuring Network ==== = Configuring Network =
Line 200: Line 212:
You will need to install ipmasq dnsmasq and dhcpd using synaptic or You will need to install ''ipmasq'', ''dnsmasq'' and ''dhcpd'' using ''synaptic'' or
Line 206: Line 218:
Then enable dhcp for the tun0 interface that mol uses, in /etc/default/dhcp, put the line Then enable ''dhcp'' for the {{{tun0}}} interface that ''mol'' uses, in {{{/etc/default/dhcp}}}, put the line
Line 212: Line 224:
Then in /etc/mol/molrc.net add the line Then in {{{/etc/mol/molrc.net}}} add the line
Line 217: Line 229:
and in /etc/mol/tunconfig at the bottom just before
and in {{{/etc/mol/tunconfig}}} at the bottom just before
Line 222: Line 235:
Line 227: Line 241:
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 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.
Line 234: Line 249:

= 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-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 [KernelBuildPPCHowTo].

#3) Download the patched MOL that Joe Jezak has kindly provided. [[http://dev.gentoo.org/~josejx/mol-0.9.71_pre6.tar.bz2]]

#4) Extract it using tar -jxvf

#5) Build it using make.

#6) Set up MOL using the section above.


CategoryDocumentation

attachment:IconsPage/PicDocs.png

TableOfContents

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)

Info <!> Note

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

Info <!> 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

Info <!> 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

Info <!> 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

Info <!> 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

  • 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

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-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 [KernelBuildPPCHowTo].

#3) Download the patched MOL that Joe Jezak has kindly provided. http://dev.gentoo.org/~josejx/mol-0.9.71_pre6.tar.bz2

#4) Extract it using tar -jxvf

#5) Build it using make.

#6) Set up MOL using the section above.

CategoryDocumentation

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