grub-mkstandalone produces an invalid PE/COFF binary inside Alpine's chroot (likely because /usr/lib/grub/x86_64-efi/ isn't populated as expected), causing a "Load Error" when the EFI shell or firmware tries to launch it. grub-install --target=x86_64-efi correctly collects modules, produces a valid EFI binary, and is the standard mechanism Alpine uses for EFI setups. --removable installs to EFI/BOOT/BOOTX64.EFI; --no-nvram skips the NVRAM update that can't be done from inside a chroot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| build-chroot-efi.sh | ||
| build-chroot.sh | ||
| macos9.img.gz | ||
| Makefile | ||
| newworld86.rom | ||
| README.md | ||
Mac OS 9 Appliance
An Alpine Linux-based VM appliance that boots directly into Mac OS 9 via SheepShaver. On boot, the system autologs in and launches SheepShaver full-screen. When SheepShaver exits, a menu lets you shut down, restart the emulator, or drop to a shell.
Building the VM image
The Makefile produces a bootable QCOW2 image using alpine-make-vm-image. Building requires sudo, wget, qemu-img, and a working QEMU user-static setup if cross-compiling.
make
This will:
- Download
alpine-make-vm-imagefrom the Alpine Linux project. - Copy the ROM and compressed disk image into a skeleton directory.
- Invoke
alpine-make-vm-image(withsudo) to create an 8 GB QCOW2 image, installing packages and building SheepShaver from source inside a chroot.
The output is macos9-appliance.qcow2.
Build options
| Variable | Default | Description |
|---|---|---|
ARCH |
x86_64 |
Target architecture (x86_64 or aarch64) |
IMAGE |
macos9-appliance.qcow2 |
Output image filename |
IMAGE_SIZE |
8G |
Size of the output disk image |
Example — build an aarch64 image:
make ARCH=aarch64
Clean up
make clean
This removes the output image, the skeleton directory, and the downloaded alpine-make-vm-image script.
Running the image
The image can be run with QEMU. Example for x86_64:
qemu-system-x86_64 \
-enable-kvm \
-m 512 \
-drive file=macos9-appliance.qcow2,format=qcow2 \
-vga std \
-display sdl
For aarch64, use qemu-system-aarch64 with an appropriate machine type (e.g. -machine virt -cpu cortex-a57).
How it works
- SheepShaver is compiled from source inside the chroot to ensure compatibility with the Alpine musl libc environment.
- Autologin is configured on
tty1via/etc/inittab. /root/.profiledetectstty1and startsstartx, which runs SheepShaver via/root/.xinitrc.- Sound uses OSS emulation (
snd-pcm-oss,snd-mixer-oss) loaded at boot via/etc/local.d/oss.start. - Networking uses SheepShaver's built-in slirp (user-mode networking, no host bridging required).
- RAM allocated to the Mac environment is 128 MB (configurable in
~/.sheepshaver_prefs).