Emaculation.com
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ppc-osx-on-qemu-for-osx [2018/02/17 03:06]
cat_7 [Networking]
ppc-osx-on-qemu-for-osx [2018/09/11 02:18] (current)
cat_7 [Experimental builds]
Line 13: Line 13:
  
 Installations of other versions of Mac OS or OSX (roughly) follow the same path. \\ Installations of other versions of Mac OS or OSX (roughly) follow the same path. \\
 +
 +If you need to boot from a real CD, see the section Booting from a real CD below. \\
 ==== Qemu installation ==== ==== Qemu installation ====
  
Line 28: Line 30:
   cd "​$(dirname "​$0"​)"​   cd "​$(dirname "​$0"​)"​
   ​   ​
-  qemu-system-ppc -boot d -M mac99 -m 512 -prom-env '​auto-boot?​=true'​ -prom-env  +  qemu-system-ppc ​-L pc-bios ​-boot d -M mac99,​via=pmu ​-m 512 -prom-env '​auto-boot?​=true'​ -prom-env  
-  '​boot-args=-v'​ -prom-env '​vga-ndrv?​=true'​ -drive file=MacOS9.2.iso,​format=raw,​media=cdrom -drive file=MacOS9.2.img,​format=raw,​media=disk ​-device usb-mouse -device usb-kbd ​-netdev user,​id=network01 -device sungem,​netdev=network01+  '​boot-args=-v'​ -prom-env '​vga-ndrv?​=true'​ -drive file=MacOS9.2.iso,​format=raw,​media=cdrom -drive file=MacOS9.2.img,​format=raw,​media=disk -netdev user,​id=network01 -device sungem,​netdev=network01
  
   * Save qemu.command and make it executable:   * Save qemu.command and make it executable:
Line 40: Line 42:
 cd "​$(dirname "​$0"​)"​ set the path for the executable to current folder\\ cd "​$(dirname "​$0"​)"​ set the path for the executable to current folder\\
 qemu-system-ppc starts qemu with all the following as parameters:​\\ qemu-system-ppc starts qemu with all the following as parameters:​\\
 +-L pc-bios points qemu to some required files, including openbios-ppc and the vga driver qemu_vga.ndrv. \\
 -boot d defines to boot from a drive entry marked as a cdrom, “-boot c” would define to boot from a drive entry marked as disk.\\ -boot d defines to boot from a drive entry marked as a cdrom, “-boot c” would define to boot from a drive entry marked as disk.\\
--M mac99 defines the mac model used.\\+-M mac99,​via=pmu ​defines the mac model used (*).\\
 -m 512 defines the amount of memory (in Mb) for OS9/OSX.\\ -m 512 defines the amount of memory (in Mb) for OS9/OSX.\\
 -prom-env '​auto-boot?​=true'​ -prom-env '​boot-args=-v'​ define boot parameters for openbios and Mac OSX. The “-v” makes the boot process verbose\\ -prom-env '​auto-boot?​=true'​ -prom-env '​boot-args=-v'​ define boot parameters for openbios and Mac OSX. The “-v” makes the boot process verbose\\
Line 47: Line 50:
 -drive file=MacOS9.2.iso,​format=raw,​media=cdrom defines the name, location, format, and type of a cdrom image file to be used\\ -drive file=MacOS9.2.iso,​format=raw,​media=cdrom defines the name, location, format, and type of a cdrom image file to be used\\
 -drive file=MacOS9.2.img,​format=raw,​media=disk defines the name, location, format, and type of a hard disk image file to be used\\ -drive file=MacOS9.2.img,​format=raw,​media=disk defines the name, location, format, and type of a hard disk image file to be used\\
--device usb-mouse and -device usb-kbd make Qemu present an usb mouse and usb keyboard to the emulated system\\ 
 -netdev user,​id=network01 -device sungem,​netdev=network01 tells qemu to use the sungem network device on a qemu-internal DHCP server\\ -netdev user,​id=network01 -device sungem,​netdev=network01 tells qemu to use the sungem network device on a qemu-internal DHCP server\\
 +
 +(*)The mac model entry accepts 3 options for the via parameter: \\
 +mac99,​via=pmu (this option supports usb mouse and keyboard)\\
 +mac99,​via=pmu-adb (this allows some older Mac OS/Mac OS server builds to use a keyboard and mouse through the adb bus)\\
 +mac99,​via=cuda (this is the default setting, allowing the use of the older, now less supported cuda) \\
  
   * Double-click qemu.command. This starts Qemu and boots the MacOS9.2.iso installation CD image.   * Double-click qemu.command. This starts Qemu and boots the MacOS9.2.iso installation CD image.
Line 54: Line 61:
  
 To install Mac OS, you first need to partition the hard disk, so after you booted from the CD go into the "​Utilities"​ folder and start the "Drive Setup" program. Select the entry "<​not initialized>"​ and click "​Initialize"​ and again in the next window. After initialization has finished and a disk icon has appeared on the desktop, quit the program. \\ To install Mac OS, you first need to partition the hard disk, so after you booted from the CD go into the "​Utilities"​ folder and start the "Drive Setup" program. Select the entry "<​not initialized>"​ and click "​Initialize"​ and again in the next window. After initialization has finished and a disk icon has appeared on the desktop, quit the program. \\
-You can then start the installation of Mac OS. Shut down Mac OS after the installation has finished.+You can then start the installation of Mac OS. Shut down Mac OS after the installation has finished.\\ 
 +Please note that the initialization step has to be repeated for any NEW disk added to Mac OS.
    
 ==== Booting the installed Mac OS ==== ==== Booting the installed Mac OS ====
-To boot the installed Mac OS, you need to edit the qemu.command file: Change the "-boot d" argument to "-boot c"​. ​If you have no need for the cd rom disk to be available, you can remove the entry from the command line. Otherwise reverse ​the order in which your disk and cd rom entry are listed in qemu.command. ​When booting with "-boot c", make sure your hard disk image file is listed first. Save the file. Double-click qemu.command and Mac OS will boot from the hard disk. \\+To boot the installed Mac OS, you need to edit the qemu.command file: \\ 
 + 
 +  * Change the "-boot d" argument to "-boot c"​. ​ 
 +  * Reverse ​the order in which your disk and cd rom entry are listed in qemu.command. ​ 
 + 
 +So, when booting with "-boot c", make sure your hard disk image file is listed first. If you have no need for the cd rom disk to be available, you can remove the entry from the command line. Save the file. Double-click qemu.command and Mac OS will boot from the hard disk. \\
  
 Done. Done.
Line 88: Line 101:
 However, you can also use the realtek 8139 device. This requires installation of the appropriate drivers. You can download them from the [[http://​www.realtek.com.tw/​Downloads/​downloadsView.aspx?​Langid=1&​PNid=14&​PFid=6&​Level=5&​Conn=4&​DownTypeID=3&​GetDown=false|Realtek site]], or all drivers in one iso from [[http://​www.open.ou.nl/​hsp/​downloads3/​MacOSRealtekDrivers.zip |here]] \\ However, you can also use the realtek 8139 device. This requires installation of the appropriate drivers. You can download them from the [[http://​www.realtek.com.tw/​Downloads/​downloadsView.aspx?​Langid=1&​PNid=14&​PFid=6&​Level=5&​Conn=4&​DownTypeID=3&​GetDown=false|Realtek site]], or all drivers in one iso from [[http://​www.open.ou.nl/​hsp/​downloads3/​MacOSRealtekDrivers.zip |here]] \\
    
-There are two ways to get networking going in OSX: through slirp or tap networking+There are two ways to get networking going in OSX: through slirp or tap networking:
  
 === Slirp-based networking === === Slirp-based networking ===
Line 96: Line 109:
   * -netdev user,​id=network01 -device sungem,​netdev=network01 ​   * -netdev user,​id=network01 -device sungem,​netdev=network01 ​
  
-=== Bridging a tap device ===+=== Bridging a tap device ​manually===
  
 For OSX Mountain Lion and above, supporting network bridging: install tuntaposx and add the first line to your qemu command line, run qemu with sudo, and execute the other lines in another terminal window: For OSX Mountain Lion and above, supporting network bridging: install tuntaposx and add the first line to your qemu command line, run qemu with sudo, and execute the other lines in another terminal window:
Line 107: Line 120:
   * sudo ifconfig bridge0 up   * sudo ifconfig bridge0 up
  
-=== Running two qemu instances with networking===+=== Bridging a tap device: the easy way === 
 + 
 +Create a network bridge in your OSX host network settings and add your network device to the bridge. Install tuntaposx. 
 + 
 +Change the script with which you boot qemu: 
 +  * remove: -netdev user,​id=network0 
 +  * add: -netdev tap,​id=network0,​script=./​tap-scripts/​tap-up.txt,​downscript=./​tap-scripts/​tap-down.txt 
 + 
 +Save the boot script and run it as root.\\ 
 +If you want, you can leave the bridge intact after you quit Qemu, so it is already available next time you run Qemu with tap networking.\\ 
 + 
 + 
 +=== Running two qemu instances with networking ===
  
 If you want to run two installations of Mac OS/OSX, Qemu needs to be able to tell the network devices apart. You can add a mac address to the networking device: If you want to run two installations of Mac OS/OSX, Qemu needs to be able to tell the network devices apart. You can add a mac address to the networking device:
Line 114: Line 139:
 and make sure you add a different mac address to the second instance: and make sure you add a different mac address to the second instance:
   * -netdev user,​id=network01 -device sungem,​netdev=network01,​mac=52:​54:​00:​12:​34:​66   * -netdev user,​id=network01 -device sungem,​netdev=network01,​mac=52:​54:​00:​12:​34:​66
-Please note that adding a mac address to the network device leads to the discovery of a new network card in OSX. You need to configure that card through the network preferences.+Please note that adding a mac address ​other than the default ​to the network device leads to the discovery of a new network card in OSX. You need to configure that card through the network preferences. 
 + 
 +=== Getting files in and out of your emulated Mac through a network connection === 
 + 
 +OSX 10.3/10.4 guests: Make sure you have file sharing enabled on your host and that you share some folder. Find the current IP address of your host: open the system report and click Networking. The IP address should show behind the active network connection. \\ 
 +Start Qemu, click Go/Connect to server. Enter  
 +  afp://​ip-address-of-your-host.  
 +At Connect as select Registered user and enter your user name and password for your host. Then select a shared folder from the list and click OK. You can now read and write files to the shared folder that appeared on your desktop.\\ 
 + 
 +==== Booting from a real CD ==== 
 + 
 +To boot from a real CD, you first need to insert the CD and unmount it using e.g., Diskutility. \\ 
 +Next, run Qemu as root. So add sudo in front of ./​qemu-system-ppc and set -cdrom /dev/cdrom in your command file.\\ 
 +Example command line:\\ 
 + 
 +  #​!/​bin/​bash 
 +  cd "​$(dirname "​$0"​)"​ 
 +  sudo ./​qemu-system-ppc -L pc-bios -M mac99 -m 512 -boot d -prom-env '​auto-boot?​=true'​ -prom-env '​boot-args=-v'​ -prom-env '​vga-ndrv?​=true'​ -cdrom /dev/cdrom -netdev user,​id=network01 -device sungem,​netdev=network01 
 + 
 + 
 +If the CD was not unmounted correctly, Qemu tells you the commands you need to enter (in e.g., another terminal window) to unmount the CD. For example:​\\ 
 + 
 +  qemu-system-ppc:​ -cdrom /dev/cdrom: If device /dev/disk5 is mounted on the desktop, unmount it first before using it in QEMU 
 +  qemu-system-ppc:​ -cdrom /dev/cdrom: Command to unmount device: diskutil unmountDisk /​dev/​disk5 
 +  qemu-system-ppc:​ -cdrom /dev/cdrom: Command to mount device: diskutil mountDisk /​dev/​disk5 
 +  
 + 
 +The CD might stay unmounted after you stop Qemu. You can use diskutility to mount it again and eject it. Or use the terminal command Qemu suggests for mounting the CD. \\ 
  
 ==== Creating new disk image in OSX with DiskUtility ==== ==== Creating new disk image in OSX with DiskUtility ====
Line 133: Line 186:
  
  
 +==== Changing the mounted cdrom image ====
  
 +In Mac OS guest: First drag any mounted CD from the desktop into the trash.
 +
 +Open the Qemu Monitor by selecting View/Compat monitor from the Qemu menu \\
 +Type “info block” to find the name of the CD drive in Qemu (most likely: ide1-cd0) \\
 +Type “eject ide1-cd0” \\
 +Type “change ide1-cd0 /​path/​to/​name-of-cd-image.iso” (note the forward slashes!) \\
 +Close the Qemu Monitor by selecting View/VGA \\
 +
 +==== Mounting a real cd ====
 +
 +NOTE: you need to unmount the real cd from the desktop (using e.g., disk utility) before using it in Qemu. \\
 +
 +Open the Qemu Monitor by selecting View/Compat monitor from the Qemu menu \\
 +Type “info block” to find the name of the CD drive in Qemu (most likely: ide1-cd0) \\
 +Type “change ide1-cd0 /​dev/​cdrom” (note the forward slashes!) \\
 +Close the Qemu Monitor by selecting View/VGA from the Qemu menu \\
  
  
Line 144: Line 214:
  
 -Sound support\\ -Sound support\\
--Support for a PMU (power management unit)\\ 
  
 You can download some of these experimental builds from our forum: http://​www.emaculation.com/​forum/​viewtopic.php?​f=34&​t=8848&​p=52102#​p52102 You can download some of these experimental builds from our forum: http://​www.emaculation.com/​forum/​viewtopic.php?​f=34&​t=8848&​p=52102#​p52102
 +
 +
 +==== Various utilities ====
 +
 +=== Script to prepare a hard disk image for use with OSX Server 1.2v3 or Developer preview 2. === 
 +
 +  * Remove the # in front of the desired disksize:\\
 +
 +#!/bin/sh \\
 +
 +TARGET_IMAGE=Mac_OS_X_Server_1.0-4G.img \\
 +
 +#1G \\
 +DISKSIZE_IN_BLOCKS=2097152 \\
 +
 +#2G \\
 +#​DISKSIZE_IN_BLOCKS=4194304\\
 +
 +#4G \\
 +#​DISKSIZE_IN_BLOCKS=8388608 \\
 +
 +PRIMARY_PARTITIONSIZE_IN_BLOCKS=`expr $DISKSIZE_IN_BLOCKS - 512 - 16384 - 64` \\
 +
 +echo $PRIMARY_PARTITIONSIZE_IN_BLOCKS \\
 +
 +pdisk $TARGET_IMAGE -initialize \\
 +pdisk $TARGET_IMAGE -createPartition MOSX_OF3_Booter Apple_HFS 64 16384 \\
 +pdisk $TARGET_IMAGE -createPartition SecondaryLoader Apple_Loader 16448 512 \\
 +pdisk $TARGET_IMAGE -createPartition "​0x000001FF 0x0008 0x00" Apple_Rhapsody_Inst 16960 $PRIMARY_PARTITIONSIZE_IN_BLOCKS \\
 +
 +\\
 +
  
  
ppc-osx-on-qemu-for-osx.1518865568.txt.gz · Last modified: 2018/02/17 03:06 by cat_7
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki