Darwin 8.0.1 (corresponding to Mac OS X 10.4) seems to be the latest available full installer image, at least, until the
PureDarwin project produces a new one.
More recent versions of packages are available in source form:
Download and extract installation CD image:
-
Start VM:
$ qemu -net none -drive file=darwin.qcow2,cache=writeback -cdrom darwinx86-801.iso -boot d
Other useful qemu options: -m 512 and -enable-kqemu
Installation steps:
Configure VM for normal startup:
Change QEMU flags: -net user → -net user,hostfwd=tcp:127.0.0.1:10022-:22 (pick any port instead of 10022)
Log in to VM, enable SSH:
Connect to VM with
Optionally add an alias to host ~/.ssh/config to simplify connecting:
Host darwin-vm
HostName localhost
Port 10022
User root
Connect to VM with
Install public key to simplify logging in:
Add -nographic to QEMU flags to disable console window, which is no longer required
# echo "alias ll='ls -l'" >>/etc/bashrc
# echo "alias la='ls -lA'" >>/etc/bashrc
Using a temporary disk image to build software helps keep the main disk image file smaller.
$ qemu-img create -f qcow2 scratch.qcow2 10G
Add QEMU flag: -drive file=scratch.qcow2,cache=writeback and boot
Figure out which disk number corresponds to the scratch drive:
# mount
# ls /dev/rdisk*
It's the one that isn't mounted and doesn't have any partitions (sn-suffixed files)
It's usually, but not always, /dev/rdisk1
# newfs_hfs -v scratch /dev/rdisk1
# reboot
Available as /Volumes/scratch on next boot
The VM sometimes fails to boot with “panic(…): nfs_boot_init failed”; if this happens, restart it.
This is optional.
-
-
Building:
# cd /Volumes/scratch
# tar xzf dyld-46.16.tar.gz
# cd dyld-46.16
# sed -i.tmp '/case CPU_TYPE_X86_64:/,/break;/d;/__pthread_tsd_first/d' src/dyld.cpp
# ln -s libstdc++.a /usr/lib/gcc/i686-apple-darwin8/4.0.0/libstdc++-static.a
# bsdmake -f dyld.mk VERSION_DYLD=46 install