Qemu ��� mac os

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

Источник

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
Читайте также:  Как установить картинку рабочего стола windows 10

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.

Источник

Qemu ��� mac os

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.

Читайте также:  No attachments in windows mail

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.

Читайте также:  Linux найти все исполняемые файлы

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.

Источник

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)

  1. If instead of QEMU, you’d like to import the setup into Virt-Manager for further configuration, just run sudo ./make.sh —add .
  2. 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.

Источник

Оцените статью