- Running Mac OS 9 and Mac OS X 10.0 — 10.4 on Apple Silicon (M1) & Intel via QEMU
- Requirements
- Step 1: Install QEMU
- Apple Silicon
- x86 Intel Macs
- Step 2: Create a disk image
- Step 3: Launching the emulated computer and the tricky part: Formatting the HDD
- Step 3.5: Special considerations between operating systems
- Step 4: after the installer fininshes
- Step 5: mounting disk images
- Bonus round: Trying for x86 64 Windows 10
- Step 6: Multi CD-Rom Installs or swapping Disk Images
- Run mac os on qemu
- Latest commit
- Git stats
- Files
- README.md
- About
- Mac OS X в эмуляторе QEMU под Linux
Running Mac OS 9 and Mac OS X 10.0 — 10.4 on Apple Silicon (M1) & Intel via QEMU
QEMU is an open-source emulator for virtualizing computers. Unlike VMWare, it’s able to both virtualize CPUs and emulate various CPU instruction sets. It’s pretty powerful, free, and has a macOS port. There are alternate versions and different ways to install it. Still, in this example, I’m using Homebrew, a package manager for macOS/OSX that allows you to install software via the CLI and manage easily.
Now, this post wouldn’t be very exciting if I tried this on my Mac Pro, but I decided to try it on my MacBook M1. Thus far, the community has succeeded in getting QEMU to install the ARM version Windows, so I decided to do the more silly path and get PPC and X86 working on Apple Silicon. I encountered very little resistance, which surprised me as I haven’t seen/read anyone trying this route. It’s surprsingly very usable but the usefulness is going to be limited. I was able to play Sim City 2000 on Mac OS 9.2 at a fairly high resolution. For the sake of brevity, I’m going to skip over installing Homebrew on an Apple M1, but you’ll want to use the arch -x86_64 method, which requires prepending. I’ve gotten OS 10.0 and nearly gotten Windows 10 working on my M1.
Included below is the instruction for both Apple Silicon and Intel Macs.
Requirements
- Basic understanding of the terminal in OS X/macOS
- Apple Silicon (M1) computer (or Intel) Mac
- Xcode
- xcode-select (CLI Tools) xcode-select —install
- Homebrew
Step 1: Install QEMU
This is the only step where Apple Silicon and Intel Macs differ. You’ll need to install the x86 version of QEMU for the Apple silicon macs first.
Apple Silicon
x86 Intel Macs
Step 2: Create a disk image
The rest of the steps do not need any specification for M1 vs. Intel.
You can specify a route, but I just used the default pathing, the 2G = 2 GB below. You can get away with much less for OS X OS 9. If you’d like more space, change the size of the simulated HDD. .
Step 3: Launching the emulated computer and the tricky part: Formatting the HDD
Now that we have a blank hard disk image, we’re ready to go.
Let’s break this down so it’s not just magic. The first command is the qemu core emulator, you can use things like 64-bit x86 CPU qemu-system-x86_64 or a 32-bit CPU qemu-system-i386 , but we’re using a PPC, so we are using qemu-system-ppc .
Next, we’re declaring PC bios with -L pc-bios , I’m unsure if this is necessary. This seems to be the default even in Mac QEMU. After that, the -boot flag declares the boot drive. For those who remember the days of yore, C is the default drive for PCs, D is the default for the CD-Rom like a PC. It’s weird, I know. -M is the model flag. It’s pretty esoteric, but QEMU uses OpenBIOS, and mac99 is the model for Beige G3s. The lowercase -m is memory, expressed in megabytes, but you can use 1G or 2G for 1 or 2 gigabytes like the format utility. -hda is the image we’re using. Finally, -cdrom is the installer image
Step 3.5: Special considerations between operating systems
I discovered that OS X 10.0’s installer has a significant flaw: It doesn’t have a disk utility. The disk images are black disks thus have no file system. If you want to run OS X 10.0, you’ll need to first launch an installer that can format HFS like OS 9 or later versions of OS X, run the disk utility, format the image and then exit out of the emulator. The process would look like this:
Then format the drive from the utility, quit the emulator (control-c on the terminal window).
Tiger and Leopard requires USB emulation so you’ll need to add -device flags for a usb keyboard and a usb mouse, also both like a few extra -prom-env flags.
Power PC Leopard I can get to boot but it crashed twice during installs, this could be
Step 4: after the installer fininshes
You will end up seeing a failed boot screen after the installer finishes. This is normal. Either quit the QEMU instance or use control-c in the terminal to close it. Now that it’s installed, we want to boot off the internal drive.
MacOS 9 seems to do slightly better when adding the via=pmu and specifying the graphics.
Step 5: mounting disk images
There’s not a lot to do with an OS without software. You can mount plenty of disk image formats
Bonus round: Trying for x86 64 Windows 10
Step 6: Multi CD-Rom Installs or swapping Disk Images
Older applications and OS installers require mutliple disk images. This can be done from via the CLI inside QEMU.
On the QEMU window press:
- Control-Alt-2 to bring up the console
- change ide1-cd0 /path/to/image
- Control-Alt-1 to bring back the GUI
Thus far my Windows 10 experiment has been a lot less successful, I’ve gotten through the installer (it’s unbearably slow) but it seems to hand on booting. It looks very feasible. I might have better luck using the 32 bit verison of windows.
Источник
Run mac os on qemu
Run macOS on QEMU/KVM. With OpenCore + Big Sur support now! Only commercial (paid) support is available now to avoid spammy issues.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This README.md documents the process of creating a Virtual Hackintosh system.
Note: All blobs and resources included in this repository are re-derivable (all instructions are included!).
💚 Looking for commercial support with this stuff? I am available over email for a chat for commercial support options only.
Working with Proxmox and macOS? See Nick’s blog for sure.
Yes, we support offline macOS installations now 🎉
This project can always use your help, time and attention. I am looking for help (pull-requests!) with the following work items:
Documentation around running macOS on popular cloud providers (Hetzner, GCP, AWS). See the Is This Legal? section and associated references.
Document (share) how you use this project to build + test open-source projects / get your stuff done.
Document how to use this project for XNU kernel debugging and development.
Document the process to launch a bunch of headless macOS VMs (build farm).
Document usage of munki to deploy software to such a build farm .
Enable VNC + SSH support out of the box or more easily.
Robustness improvements are always welcome!
(Not so) crazy idea — automate the macOS installation via OpenCV.
A modern Linux distribution. E.g. Ubuntu 20.04 LTS 64-bit or later.
A CPU with Intel VT-x / AMD SVM support is required ( grep -e vmx -e svm /proc/cpuinfo )
A CPU with SSE4.1 support is required for >= macOS Sierra
A CPU with AVX2 support is required for >= macOS Mojave
Note: Older AMD CPU(s) are known to be problematic. AMD FX-8350 works but Phenom II X3 720 does not. Ryzen processors work just fine.
KVM may need the following tweak on the host machine to work.
To make this change permanent, you may use the following command.
Install QEMU and other packages.
This step may need to be adapted for your Linux distribution.
Add user to the kvm group (might be needed).
Clone this repository on your QEMU system. Files from this repository are used in the following steps.
Fetch macOS installer.
You can choose your desired macOS version here. After executing this step, you should have the BaseSystem.dmg file in the current folder.
ATTENTION: Let the Big Sur setup sit at the Country Selection screen, and other similar places for a while if things are being slow. The initial macOS setup wizard will eventually succeed.
Note: Modern NVIDIA GPUs are supported on HighSierra but not on later versions.
Convert the downloaded BaseSystem.dmg file into the BaseSystem.img file.
Create a virtual HDD image where macOS will be installed. If you change the name of the disk image from mac_hdd.img to something else, the boot scripts will need to be updated to point to the new image name.
NOTE: Create this HDD image file on a fast SSD/NVMe disk for best results.
Now you are ready to install macOS 🚀
CLI method (primary). Just run the OpenCore-Boot.sh script to start the installation process.
Note: This same script works for Big Sur, Catalina, Mojave, and High Sierra.
You are all set! 🙌
(OPTIONAL) Use this macOS VM disk with libvirt (virt-manager / virsh stuff).
Edit macOS-libvirt-Catalina.xml file and change the various file paths (search for CHANGEME strings in that file). The following command should do the trick usually.
Create a VM by running the following command.
Launch virt-manager and start the macOS virtual machine.
Note: You may need to run sudo ip link delete tap0 command before virt-manager is able to start the macOS VM.
Setting Expectations Right
Nice job on setting up a Virtual Hackintosh system! Such a system can be used for a variety of purposes (e.g. software builds, testing, reversing work), and it may be all you need, along with some tweaks documented in this repository.
However, such a system lacks graphical acceleration, a reliable sound sub-system, USB (3) functionality and other similar things. To enable these things, take a look at our notes. We would like to resume our testing and documentation work around this area. Please reach out to us if you are able to fund this area of work.
It is possible to have ‘beyond-native-apple-hw’ performance but it does require work, patience, and a bit of luck (perhaps?).
See networking notes to setup guest networking.
I have the following commands present in /etc/rc.local .
This has been enough for me so far.
Note: You may need to enable the rc.local functionality manually on modern Ubuntu versions. Check out the notes included in this repository for details.
To passthrough GPUs and other devices, see these notes.
Need a different resolution? Check out the notes included in this repository.
Trouble with iMessage? Check out the notes included in this repository.
The «secret» Apple OSK string is widely available on the Internet. It is also included in a public court document available here. I am not a lawyer but it seems that Apple’s attempt(s) to get the OSK string treated as a trade secret did not work out. Due to these reasons, the OSK string is freely included in this repository.
Gabriel Somlo also has some thoughts on the legal aspects involved in running macOS under QEMU/KVM.
My aim is to enable macOS based educational tasks, builds + testing, kernel debugging, reversing, and macOS security research in an easy, reproducible manner without getting ‘invested’ in Apple’s closed ecosystem (too heavily).
These Virtual Hackintosh systems are not intended to replace the genuine physical macOS systems.
Personally speaking, this repository has been a way for me to ‘exit’ the Apple ecosystem. It has helped me to test and compare the interoperability of Canon CanoScan LiDE 120 scanner, and Brother HL-2250DN laser printer. And these devices now work decently enough on modern versions of Ubuntu (Yay for free software). Also, a long time back, I had to completely wipe my (then) brand new MacBook Pro (Retina, 15-inch, Late 2013) and install Xubuntu on it — as the OS X kernel kept crashing on it!
Backstory: I was a (poor) student in Canada in a previous life and Apple made my work on cracking Apple Keychains a lot harder than it needed to be. This is how I got interested in Hackintosh systems.
About
Run macOS on QEMU/KVM. With OpenCore + Big Sur support now! Only commercial (paid) support is available now to avoid spammy issues.
Источник
Mac OS X в эмуляторе QEMU под Linux
Здравствуйте хабровчане. Недавно понадобилось писать на Objective C под Mac OS X. Железо у меня не самое подходящее для всяких сборок, да и сидеть полностью в этой ОС религия не позволяет. Решил поставить Mac OS X в на виртуальную машину Qemu в Linux.
Вот список всего, что я использовал:
—Gentoo Linux 64 bit
—Qemu 0.10.5
—KVM (Kernel-based Virtual Machine) 88-r1
—Поддержка KVM в ядре Linux
—Процессор с поддержкой Intel Virtualization Technology (в моем случае это Core2Duo E6400)
—Linux kernel>=2.6.20
-Сборка Mac OS X iATKOS v7 (Leopard 10.5.7)
Переходим к настройке, в ядре необходимо добавить KVM. Качаем исходники, распаковываем, запускаем make menuconfig:
Processor type and features->Paravirtualized guest support
Отмечаем:
—KVM paravirtualized clock
—KVM Guest support
—Paravirtualization layer for spinlocks
Далее в корне настройки ядра появляется новая опция Virtualization
Переходим туда и отмечаем:
—Kernel-based Virtual Machine (KVM) support
—KVM for Intel processors support
—KVM trace support
—PCI driver for virtio devices
—Virtio balloon driver
Собираем, устанавливаем, и перезагружаемся с новым ядром.
Теперь устанавливаем Qemu с поддержкой KVM, и сам KVM
USE=«kvm» emerge qemu
emerge kvm
Теперь переходим к шаманствам с виртуальной машиной.
Создаем виртуальный жесткий диск:
qemu-img create -f raw macos.disk 30G
Если собираемся запускать Qemu не от рута, необходимо дать прав другим пользователям на чтение/запись на устройство /dev/kvm:
chmod 0666 /dev/kvm
Запускаем:
kvm -boot d -hda macos.disk -m 900 -net nic,model=rtl8139 -net tap -usb -no-reboot -no-shutdown -vga std -cpu core2duo -cdrom 10.5.7.iso
-hda путь к нашему виртуальному жесткому диску
-cdrom пусть к образу
-no-shutdown -no-reboot необходимы для того чтобы в случае ошибки окно эмулятора «замораживалось» и можно было прочитать ошибку
-net nic,model=rtl8139 эмулируем сетевую карту Realtek 8139
-net tap чтобы гостевая система видела по сети хостящую необходим TAP девайс
-m 900 количество памяти отдаваемое гостевой системе
-boot d грузимся с сидирома
-usb поддержка USB
-cpu core2duo эмуляция процессора Core2Duo
Грузим диск. Размечаем жесктий диск при помощи Disk Utility (выбираем из меню сверху).
Настройка драйверов.
Перед тем как нажать кнопку Install обратите вниманине на кнопку Customize
Вещи которые нам необходимо выбрать:
x86 ACPI
Disabler
OHR
Remove TyMCE
CardBus
USB
Intel SATA/IDE
Kernels
Apple PS/2
Можно устанавливать. Ждем примерно 30 минут.
Mac OS X установлена, настраиваем.
Теперь в строке для запуска меняем -boot d на -boot c чтобы грузится с жесткого диска.
Загружаемся. Теперь надо придумать чтонибудь с сетью.
Ищем в интернете PCGenRTL8139Ethernet.kext, устанавливаем его, очень легко установить с помощью программы kextinstaller. Пока нету сети необходимые файлы передавать в систему можно через флешку например, добавляем -hdb /dev/sdb (путь к устройству флешки)
Перезагржаем гостевую ОС.
Теперь чтобы сеть в Mac OS X заработала необходимо зайти в управление сетью, выбрать Ethernet девайс, выключить его (Off), а затем включить и настроить нужный IP (например 192.168.1.1), а в хостящей системе настроить девайс tap0:
ifconfig tap0 192.168.1.2
Вот вообщем то и все.
UPD. Автор поста появился на хабре vinnishtein
Источник