Runs macOS on linux with qemu.

Overview

mac-on-linux-with-qemu

License: MIT

Runs macOS on linux with qemu.

screenshot

Pre-requisites

  • qemu-system-x86_64
  • dmg2img
  • pulseaudio
  • python[click]

Usage

After cloning the repository, simply run ./run.sh

How it works

  • ./fetch-macos.py fetches macOS image dmg from their software update centre
  • The downloaded .dmg image is converted to .img using the dmg2img utility
  • We create a virtual disk image using ./create-virtual-disk.sh
  • We install macOS to qemu using the given image. ./install-macos.sh
  • We provide a custom launcher script to launch qemu with the correct settings. ./launch-macos.sh

Note

If you face any problem while installation, remove firmware/ and rename fallback-firmware/ to firmware/ Once installed, don't change the firmware files. Although they are automatically recovered by a installed system.

References

Comments
  • why big sur update cannot be completed ?

    why big sur update cannot be completed ?

    Big sur upgrade is proposed , downloaded and the first step install completed. But after reboot, it is as if nothing had happend and the system reboot as catalina os. Same thing for the last 2021-04 security update. I tried to change the external update process back to normal but no result.

    Is it possible to change the fetch-macos.py script instead and change the https://swscan.apple.com/content/catalogs/others/index-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog , to big sur dmg url instead , and remake a new fresh install ?

    Does anybody got the good Big Sur url ?

    bug 
    opened by tombombadilom 11
  • qemu-system-x86_64: Display 'sdl' is not available.

    qemu-system-x86_64: Display 'sdl' is not available.

    I ran the run.sh script but it shows an error. The output is :

    *** Checking for firmware files
    *** Checking for Base System files
    *** Check if dmg2img is available
    /usr/bin/dmg2img
    *** Check if BaseSystem dmg is downloaded. If downloaded convert to img
    *** BaseSystem dmg available.
    *** Check if BaseSystem dmg has been converted to img before.
    *** BaseSystem img available.
    *** Checking for disk image
    *** Check if installer has been run
    *** Looks like the install hasn't been done yet, lets install
    *** Install!
    qemu-system-x86_64: Display 'sdl' is not available.
    

    I am a beginner with linux so don't be too rude.

    opened by Alg0v 10
  • Archlinux After qemu and kernel upgrade I lost virtio-vga support

    Archlinux After qemu and kernel upgrade I lost virtio-vga support

    After qemu and kernel upgrade I lost the virtio-vga support

    too bad everything was going perfectly fine with mac os x

    [[email protected] mac-on-linux-with-qemu]$ ./launch-macos.sh
    qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=packaged-firmware/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
    Please use readonly=on instead
    qemu-system-x86_64: -device virtio-vga,virgl=on: Property 'virtio-vga.virgl' not found
    

    dmesg | grep drm did not return pci:virtio-vga and in kernel virtio drivers it cannot be found either.

    [[email protected] /lib/modules/5.13.13-arch1-1/kernel/drivers/virtio$ ls
    virtio_balloon.ko.zst  virtio_input.ko.zst  virtio_mmio.ko.zst  virtio_pci_modern_dev.ko.zst
    virtio_dma_buf.ko.zst  virtio_mem.ko.zst    virtio_pci.ko.zst   virtio_vdpa.ko.zst
    

    normaly there should be no problem has I have this enabled

    [[email protected] tom]# zgrep VIRTIO /proc/config.gz
    CONFIG_BLK_MQ_VIRTIO=y
    CONFIG_VIRTIO_VSOCKETS=m
    CONFIG_VIRTIO_VSOCKETS_COMMON=m
    CONFIG_BT_VIRTIO=m
    CONFIG_NET_9P_VIRTIO=m
    CONFIG_VIRTIO_BLK=m
    CONFIG_SCSI_VIRTIO=m
    CONFIG_VIRTIO_NET=m
    CONFIG_VIRTIO_CONSOLE=m
    CONFIG_HW_RANDOM_VIRTIO=m
    CONFIG_DRM_VIRTIO_GPU=m
    CONFIG_SND_VIRTIO=m
    CONFIG_VIRTIO=y
    CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS=y
    CONFIG_VIRTIO_PCI_LIB=m
    CONFIG_VIRTIO_MENU=y
    CONFIG_VIRTIO_PCI=m
    CONFIG_VIRTIO_PCI_LEGACY=y
    CONFIG_VIRTIO_VDPA=m
    CONFIG_VIRTIO_PMEM=m
    CONFIG_VIRTIO_BALLOON=m
    CONFIG_VIRTIO_MEM=m
    CONFIG_VIRTIO_INPUT=m
    CONFIG_VIRTIO_MMIO=m
    CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
    CONFIG_VIRTIO_DMA_SHARED_BUFFER=m
    CONFIG_RPMSG_VIRTIO=m
    CONFIG_VIRTIO_FS=m
    CONFIG_CRYPTO_DEV_VIRTIO=m
    

    here are my libs versions

    [[email protected] mac-on-linux-with-qemu]$ pacman -Qs '^(linux|mesa|qemu|virglrenderer|libepoxy)$'
    local/libepoxy 1.5.9-1
        Library handling OpenGL function pointer management
    local/linux 5.13.13.arch1-1
        The Linux kernel and modules
    local/mesa 21.2.1-1
        An open-source implementation of the OpenGL specification
    local/qemu 6.1.0-1
        A generic and open source machine emulator and virtualizer
    local/virglrenderer 0.9.1-1
        A virtual 3D GPU library, that allows the guest operating system to use the host GPU to accelerate 3D rendering
    

    I wonder if there is something that i am missing ? if I have to downgrade version for qemu and/or kernel. Or compile a modified kernel .

    opened by tombombadilom 6
  • Freeze on Big Sur using the new ESP.qcow2 resolved

    Freeze on Big Sur using the new ESP.qcow2 resolved

    Freeze happend after a long time of unused. I first thought it was a suspend problem and deactivated all suspend:

    • from monitor
    • from max os
    • from linux

    But the problem remains... I've got no error log in Mac os X and for qemu juste a tiny :

    qemu : Slirp: Failed to send packet, ret: -1
    

    To let you know there this issue https://github.com/foxlet/macOS-Simple-KVM/issues/499 I found this very helpfull https://support.apple.com/en-en/guide/mac-help/mchlp1168/mac I just had to stop hard drive suspend to solve the problem

    opened by tombombadilom 5
  • Install macos failed

    Install macos failed

    Hi,

    i try to install macos with your script. I change in script install and launch macos the sdl for gtk with gl=off because i have the error with sdl not available. I chown tall he folder to not launch in root the run.sh

    All is OK but when the qemu launch his screen, i have the mac recovery screen. and i don't know what's wrong. In terminal the last line is "GTrace synchronization point f"

    Thank you, best regards

    opened by AS1244 3
  • xcode and usb iphone passthrough

    xcode and usb iphone passthrough

    How to add an iphone to use with xcode

    Références: https://stackoverflow.com/questions/67279997/connect-iphone-via-usb-to-sosumi-qemu https://github.com/sickcodes/Docker-OSX/issues/133

    Define usb port to be usb passthrough

    it is easier to select a usb bus where your iphone is single but in case you can't follow the udev rules

    plug your iphone to usb

    $ lsusb
    Bus 001 Device 004: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE
    

    Since qemu runs as a regular user, it cannot connect to hot-plug USB devices unless you change permssions on the host. Being in group plugdev might be sufficient for standard USD block devices. For others, such as an iphone, you need to manually change the /dev/bus/usb/xxx/yyy to group users or create /etc/udev/rules.d/97-iphone.rules.

    https://www.linuxquestions.org/questions/blog/kingbeowulf-74138/qemu-usb-passthrough-with-specifics-for-iphone-37830/

    sudo vim /etc/udev/rules.d/97-iphone.rules
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="*",GROUP="users", MODE="0660"
    

    0x05ac vendor ID in this case is for an Apple iPhone 5C. For iphones specifically, it can help to disable usbmuxd with an empty /etc/udev/rules.d/39-usbmuxd.rules Now, either reboot (ha! this ain't windows!) or run as root

    sudo udevadm control -R
    

    then edit yout lanch-mac-os.sh and add

    -usb \
    -device usb-ehci,id=ehci \
    -device usb-host,bus=ehci.0,vendorid=0x05ac,productid=0x12a8,guest-reset=false,id=iphone \
    

    Warning if you intend to code with xcode or upgrade your iphone with your mac , remove the productid . see comment below.

    Pairing an iOS device with Xcode

    • Open Xcode and go to Window > Devices and Simulators.
    • Plug your iOS device into your Mac using a lightning cable. You may need to select to Trust This Computer on your device.
    • Select your device and then select the Connect via network checkbox to pair your device:

    https://stackoverflow.com/questions/10087985/xcode-doesnt-see-my-ios-device-but-itunes-does

    Do I need to be a Apple Developer Member to deploy apps on my iphone ?

    https://developer.apple.com/forums/thread/81424

    when you launch your mac os x you should get this :

    [email protected] ~ % lsusb
    Bus 004 Device 002: ID 0627:0001 0627 QEMU USB Mouse  Serial: 89126-0000:00:04.0-3
    Bus 004 Device 003: ID 0627:0001 0627 QEMU USB Keyboard  Serial: 68284-0000:00:04.0-2
    Bus 004 Device 001: ID 05ac:12a8 Apple Inc. iPhone  Serial: 650d4ab950e8ece4cd07b637044440618c9080b4
    Bus 000 Device 001: ID 1d6b:IPCI Linux Foundation USB 2.0 Bus 
    Bus 000 Device 001: ID 1d6b:IPCI
    IPCI
    IPCI
    IPCI Linux Foundation USB 2.0 Bus
    
    documentation 
    opened by tombombadilom 3
  • qemu-system-x86_64: Display 'sdl' is not available.

    qemu-system-x86_64: Display 'sdl' is not available.

    Hi,

    I have tried to launch the script but I have the following error *** Checking for firmware files *** Checking for Base System files *** Checking for disk image *** Check if installer has been run *** Looks like the install hasn't been done yet, lets install *** Install! qemu-system-x86_64: Display 'sdl' is not available.

    Distributor ID: Linuxmint Description: Linux Mint 20.2 Release: 20.2 Codename: uma

    opened by vernichon 3
  • Cannot install, no disk found

    Cannot install, no disk found

    Hi,

    When the message "Select the disk where you want to install macOS" is displayed, there is no available disk.

    There is only one disk "macOS Base System" which is greyed. Cannont continue.

    OS : Ubuntu 20.04.3 LTS

    Capture du 2021-09-01 11-18-30

    opened by Olivier34 2
  • Question on resolution

    Question on resolution

    Hello, I wonder if i could get the same resolution as you have on the screenshot. In the settings of the virtual machine, i only get 1280x720, do you have any clue if i can get higher resolution ? Thanks Capture du 22-08-2021 21:21:18

    opened by flaviencrochard 2
  • Disk not found during install

    Disk not found during install

    I'm trying a fresh install. I can launch the installer, accept the license, but then there is only the disk "macOS base system" (2Go) marked "this disk is locked", and no other disk. I tried to delete all the files and restart, same result. Am I missing something?

    No error message in the logs.

    Nice work that I can get to this point!

    opened by Yamakaky 2
  • Bash strict mode

    Bash strict mode

    You should enable http://redsymbol.net/articles/unofficial-bash-strict-mode/ on every script. dmg2img was not installed so I got

    ./run.sh: line 12: dmg2img: command not found
    *** Checking for disk image
    *** Check if installer has been run
    *** Looks like the install hasn't been done yet, lets install
    *** Install!
    qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=packaged-firmware/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
    Please use readonly=on instead
    qemu-system-x86_64: -drive id=InstallMedia,format=raw,if=virtio,file=BaseSystem/BaseSystem.img: Could not open 'BaseSystem/BaseSystem.img': No such file or directory
    
    opened by Yamakaky 2
  • OpenGL not supported

    OpenGL not supported

    Hello, I have a problem during the installation, do you have any solutions?

    Thanks in advance !

    [email protected]:/home/gaetan/Téléchargements/mac-on-linux-with-qemu-main# sudo ./run.sh
    *** Checking for firmware files
    *** Checking for Base System files
    *** Check if dmg2img is available
    /usr/bin/dmg2img
    *** Check if BaseSystem dmg is downloaded. If downloaded convert to img
    *** BaseSystem dmg available.
    *** Check if BaseSystem dmg has been converted to img before.
    *** BaseSystem img available.
    *** Checking for disk image
    *** Check if installer has been run
    *** Looks like the install hasn't been done yet, lets install
    *** Install!
    qemu-system-x86_64: OpenGL is not supported by the display
    

    PS: I've been looking for a solution for several hours but can't find a fix.

    opened by Gaetann18 5
Releases(1.1.0)
  • 1.1.0(Jul 6, 2022)

    What's Changed

    • Applied bash strictmode patch from github.com/flaviencrochard by @arindas in https://github.com/arindas/mac-on-linux-with-qemu/pull/10
    • Added the -vga std flag for virtual vga driver to support higher reso… by @arindas in https://github.com/arindas/mac-on-linux-with-qemu/pull/11
    • Updated ESP image. by @arindas in https://github.com/arindas/mac-on-linux-with-qemu/pull/18
    • Updated run.sh. by @arindas in https://github.com/arindas/mac-on-linux-with-qemu/pull/17
    • fixed to virtio-vga-gl by @tombombadilom in https://github.com/arindas/mac-on-linux-with-qemu/pull/28
    • Replaced sdl display with gtk display. by @arindas in https://github.com/arindas/mac-on-linux-with-qemu/pull/34
    • Sourcery Starbot ⭐ refactored arindas/mac-on-linux-with-qemu by @sourcery-ai-bot in https://github.com/arindas/mac-on-linux-with-qemu/pull/29

    New Contributors

    • @arindas made their first contribution in https://github.com/arindas/mac-on-linux-with-qemu/pull/10
    • @tombombadilom made their first contribution in https://github.com/arindas/mac-on-linux-with-qemu/pull/28
    • @sourcery-ai-bot made their first contribution in https://github.com/arindas/mac-on-linux-with-qemu/pull/29

    Full Changelog: https://github.com/arindas/mac-on-linux-with-qemu/compare/v1.0.0...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jul 23, 2021)

    Release notes

    • Corrected exec invocation in bash scripts
    • Removed all traces of SNAP
    • Correctly handled firmware files. Firmware files prone to change on every boot are copied for user-specific use
    • Updated firmware file paths in bash scripts.
    Source code(tar.gz)
    Source code(zip)
Owner
Arindam Das
Specializes in Deep Learning model serving and AI SaaS at scale. Experienced in distributed system design, architecture, and deployment.
Arindam Das
Trackthis - This library can be used to track USPS and UPS shipments.

Trackthis - This library can be used to track USPS and UPS shipments. It has the option of returning the raw API response, or optionally, it can be used to standardize the USPS and UPS responses so t

Aaron Guzman 0 Mar 29, 2022
Time tracking program that will format output to be easily put into Gitlab

time_tracker Time tracking program that will format output to be easily put into Gitlab. Feel free to branch and use it yourself! Getting Started Clon

Jake Strasler 2 Oct 13, 2022
Programa principal de la Silla C.D.P.

Silla CDP Página Web Contáctenos Lista de contenidos: Información del proyecto. Licencias. Contacto. Información del proyecto Silla CDP, o Silla Corre

Silla Control de Postura 1 Dec 02, 2021
Library for Memory Trace Statistics in Python

Memory Search Library for Memory Trace Statistics in Python The library uses tracemalloc as a core module, which is why it is only available for Pytho

Memory Search 1 Dec 20, 2021
Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !

Waydroid Extras Script Script to add gapps and other stuff to waydroid ! Installation/Usage "lzip" is required for this script to work, install it usi

Casu Al Snek 331 Jan 02, 2023
Write-ups for CTF Internacional MetaRed 2021 5th stage

MetaRed2021-5th-Writeups Write-ups for CTF Internacional MetaRed 2021 5th stage Easy (15) No Status Category Name Creator(s) 01 Done osint Cybersecuri

UA Cybersecurity 2 Dec 22, 2021
Solcast Integration for Home Assistant

Solcast Solar Home Assistant(https://www.home-assistant.io/) Component This custom component integrates the Solcast API into Home Assistant. Modified

Greg 45 Dec 20, 2022
An example using debezium and mysql with docker-compose

debezium-mysql An example using debezium and mysql with docker-compose The docker compose starts the Zookeeper, Kafka, Mysql and Debezium Connect. Aft

Horácio Dias Baptista Neto 4 May 21, 2022
PREFS is a Python library to store and manage preferences and settings.

PREFS PREFS is a Python library to store and manage preferences and settings. PREFS stores a Python dictionary in a total human-readable file, the PRE

Pat 13 May 26, 2022
PKU team for 2021 project 'Guangchangwu detection'.

PKU team for 2021 project 'Guangchangwu detection'.

Helin Wang 3 Feb 21, 2022
A simple string parser based on CLR to check whether a string is acceptable or not for a given grammar.

A simple string parser based on CLR to check whether a string is acceptable or not for a given grammar.

Bharath M Kulkarni 1 Dec 15, 2021
More granular intermediaries for legacy Minecraft versions

Orinthe/Intermediary mappings This repository contains the match information between different versions of Minecraft created by the Orinthe project, a

4 Jan 11, 2022
This is a small compiler to demonstrate how compilers work.

This is a small compiler to demonstrate how compilers work. It compiles our own dialect to C, while being written in Python.

Md. Tonoy Akando 2 Jul 19, 2022
A pairs trade is a market neutral trading strategy enabling traders to profit from virtually any market conditions.

A pairs trade is a market neutral trading strategy enabling traders to profit from virtually any market conditions. This strategy is categorized as a statistical arbitrage and convergence trading str

Kanupriya Anand 13 Nov 27, 2022
A multi-platform fuzzer for poking at userland binaries and servers

litefuzz A multi-platform fuzzer for poking at userland binaries and servers litefuzz intro why how it works what it does what it doesn't do support p

52 Nov 18, 2022
The Python Achievements Framework!

Pychievements: The Python Achievements Framework! Pychievements is a framework for creating and tracking achievements within a Python application. It

Brian 114 Jul 21, 2022
Python library and cli util for https://www.zerochan.net/

Zerochan Library for Zerochan.net with pics parsing and downloader included! Features CLI utility for pics downloading from zerochan.net Library for c

kiriharu 10 Oct 11, 2022
This is a spamming selfbot that has custom spammed message and @everyone spam.

This is a spamming selfbot that has custom spammed message and @everyone spam.

astro1212 1 Jul 31, 2022
Repositório para estudo do airflow

airflow-101 Repositório para estudo do airflow Docker criado baseado no tutorial Exemplo de API da pokeapi Para executar clone o repo execute as confi

Gabriel (Gabu) Bellon 1 Nov 23, 2021
「📖」Tool created to extract metadata from a domain

Metafind is an OSINT tool created with the aim of automating the search for metadata of a particular domain from the search engine known as Google.

9 Dec 28, 2022