- Qemu ��������� mac os
- About
- openfirmware / instructions.md
- Download QEMU
- Source code
- Build instructions
- Linux
- macOS
- Windows
- Version numbering
- Hosts/Mac
- Contents
- Notes
- Installing QEMU using a package manager
- Building QEMU for macOS
- Errors on old compilers
- Build with LLVM/Clang 7
- Contacts
- Mac OS X в эмуляторе QEMU под Linux
Qemu ��������� mac os
Documentation to set up a simple macOS VM in QEMU, accelerated by KVM.
By @FoxletFox, and the help of many others. Find this useful? You can donate on Coinbase or Paypal!.
New to macOS and KVM? Check the FAQs.
You’ll need a Linux system with qemu (3.1 or later), python3 , pip and the KVM modules enabled. A Mac is not required. Some examples for different distributions:
Run jumpstart.sh to download installation media for macOS (internet required). The default installation uses Catalina, but you can choose which version to get by adding either —high-sierra , —mojave , or —catalina . For example:
Note: You can skip this if you already have BaseSystem.img downloaded. If you have BaseSystem.dmg , you will need to convert it with the dmg2img tool.
Create an empty hard disk using qemu-img , changing the name and size to preference:
and add it to the end of basic.sh :
Note: If you’re running on a headless system (such as on Cloud providers), you will need -nographic and -vnc :0 -k en-us for VNC support.
Then run basic.sh to start the machine and install macOS. Remember to partition in Disk Utility first!
Step 2a (Virtual Machine Manager)
- If instead of QEMU, you’d like to import the setup into Virt-Manager for further configuration, just run sudo ./make.sh —add .
- After running the above command, add MyDisk.qcow2 as storage in the properties of the newly added entry for VM.
Step 2b (Headless Systems)
If you’re using a cloud-based/headless system, you can use headless.sh to set up a quick VNC instance. Settings are defined through variables as seen in the following example. VNC will start on port 5900 by default.
To fine-tune the system and improve performance, look in the docs folder for more information on adding memory, setting up bridged networking, adding passthrough hardware (for GPUs), tweaking screen resolution, and enabling sound features.
About
Tools to set up a quick macOS VM in QEMU, accelerated by KVM.
Источник
openfirmware / instructions.md
QEMU Mac OS 9 Instructions
Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.
Clone QEMU fork
You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).
Start by cloning the fork of QEMU with experimental audio support:
Then configure the source to use MacOS CoreAudio. I have also enabled LibUSB, KVM, HyperVirtualization Framework, and the Cocoa UI. In this case I am only compiling the emulator for PPC (32-bit).
This will create a binary in qemu-screamer/ppc-softmmu/qemu-system-ppc that we can use.
Create HD for Mac OS 9
We will need to have a hard drive image for our emulated system. I made mine 5 GB in size, which is plenty for Mac OS 9.
In our qemu-screamer directory, we will use qemu-img to create the disk image.
Get a Mac OS 9 Installer
If you have an ISO of a Mac OS 9 install disc (a Mac OS X classic install disc won’t work), then you can use that in the next step. If you don’t have one, you can download one from Mac OS 9 Lives: Mac OS 9.2.2 Universal Install.
Install Mac OS 9
This won’t install quite like Mac OS 9 did, but instead use Apple System Restore to restore an image onto the hard drive.
Start up QEMU with the following options:
A breakdown of that command:
- -L qemu-screamer/pc-bios sets the BIOS. May not actually need this.
- -cpu «g4» emulate a G4 CPU
- -M mac99,via=pmu will define the Mac model and enable USB support
- -m 512 use 512 MB of RAM, could go lower probably
- -hda macos92.img use our generated disk image for the hard drive
- -cdrom «
/Downloads/Mac OS 9.2.2 Universal Install.iso» use the ISO for the cdrom
Once it starts up, you will be able to run Disk Initializer to format your hard drive image. Go ahead and do that, using Mac OS HFS Extended as the file system. One partition is good.
After initializing the disk, run Apple System Restore with the Mac OS 9 lives disk image as the source and your disk as the destination. This will take a minute to restore. Once done, shut down the emulated system.
Similar to the last command, except we start up from the disk we created.
It should boot up and you will have a running Mac OS 9 with audio!
When the emulator is shut down, just make a copy of the hard disk image to create a backup. If something breaks your Mac OS 9 installation then you can restore the file.
You can dynamically attach CDs/DVDs to the emulated system by going to the menu bar on your host system for the QEMU application and selecting the option to attach to the CD IDE drive. It will open a dialog letting you select your ISO.
Источник
Download QEMU
Source code
Grab the source code for the latest releases and compile it yourself! Detailed compilation instructions can be found in the wiki for Linux, Win32 and macOS.
- 6.1.0 Aug 24st 2021
signature — changes - 6.0.0 Apr 29th 2021
signature — changes - 5.2.0 Dec 8th 2020
signature — changes
or stay on the bleeding edge with the git repository!
Build instructions
To download and build QEMU 6.1.0:
To download and build QEMU from git:
The latest development happens on the master branch. The stable trees are located in branches named stable-X.YY branch, where X.YY is the release version.
Linux
QEMU is packaged by most Linux distributions:
Arch: pacman -S qemu
Debian/Ubuntu: apt-get install qemu
Fedora: dnf install @virtualization
Gentoo: emerge —ask app-emulation/qemu
RHEL/CentOS: yum install qemu-kvm
SUSE: zypper install qemu
macOS
QEMU can be installed from Homebrew:
QEMU can be installed from MacPorts:
QEMU requires Mac OS X 10.5 or later, but it is recommended to use Mac OS X 10.7 or later.
Windows
Stefan Weil provides binaries and installers for both 32-bit and 64-bit Windows.
Version numbering
Since version 3.0.0, QEMU uses a time based version numbering scheme:
major incremented by 1 for the first release of the year minor reset to 0 with every major increment, otherwise incremented by 1 for each release from git master micro always 0 for releases from git master, incremented by 1 for each stable branch release
The implication of this is that changes in major version number do not have any bearing on the scope of changes included in the release. Non-backward compatible changes may be made in any master branch release, provided they have followed the deprecation policy which calls for warnings to be emitted for a minimum of two releases prior to the change.
Источник
Hosts/Mac
Contents
Notes
Some system emulations on Linux use KVM, a special emulation mode which claims to reach nearly native speed. KVM is mainly used for x86 (32 and 64 bit) emulation on x86 hosts running Linux. Should you want to run Qemu with KVM support on a G5, depending on your distribution, you might have to compile your own kernel with KVM support.
If your host’s (your computer) architecture matches the guest’s (QEMU) architecture and is running Mac OS 10.10 or higher, then you could speed up execution to near native speed using this option: -accel hvf
Installing QEMU using a package manager
Building QEMU for macOS
The system requirements are:
- One of the two most recent versions of macOS (currently Catalina or Big Sur)
- The clang compiler shipped with the version of Xcode for that OS X. GCC might also work, but we recommend clang
Additional build requirements are:
make (when installed through brew, make is installed as gmake, so use gmake)
After downloading the QEMU source code, double-click it to expand it.
Then configure and make QEMU. The target-list option is used to build only the machine or machines you want. If you don’t specify it, all machines would be built. Probably not what you want.
This way doesn’t require you to wait for the configure command to complete:
If your system has the ‘say’ command, you can use it to tell you when QEMU is done
You can use ‘./configure —help’ to see a full list of options.
Here are all the currently available machines:
- aarch64-softmmu
- alpha-softmmu
- arm-softmmu
- cris-softmmu
- i386-softmmu
- lm32-softmmu
- m68k-softmmu
- microblaze-softmmu
- microblazeel-softmmu
- mips-softmmu
- mips64-softmmu
- mips64el-softmmu
- mipsel-softmmu
- moxie-softmmu
- or32-softmmu
- ppc-softmmu
- ppc64-softmmu
- ppcemb-softmmu
- s390x-softmmu
- sh4-softmmu
- sh4eb-softmmu
- sparc-softmmu
- sparc64-softmmu
- tricore-softmmu
- unicore32-softmmu
- x86_64-softmmu
- xtensa-softmmu
- xtensaeb-softmmu
We recommend building QEMU with the -default compiler provided by Apple, for your version of Mac OS X (which will be ‘clang’). The configure script will automatically pick this.
Errors on old compilers
Note: If after the configure step you see a message like this:
you may have to install your own version of gcc. You can build it from source (expect that to take several hours) or obtain third party binaries of gcc available from Homebrew or MacPorts.
You can have several versions of GCC on your system. To specify a certain version, use the —cc and —cxx options.
Build with LLVM/Clang 7
If you need to compile with newer versions of clang (to get f.i. AVX/AVX2 support), you can install llvm through e.g., brew.
Note that building for machines with CPUs supporting such extensions will exclude running your binary on earlier machines.
Contacts
If there are any issues with this web page, please let me know.
Источник
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
Источник