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
A Python program for calculating the 95%CI for GNSS-derived site velocities

GNSS_Vel_95%CI A Python program for calculating the 95%CI for GNSS-derived site velocities Function_GNSS_95CI.py is a Python function for calculating

<a href=[email protected]"> 4 Dec 16, 2022
Мой первый калькулятор!!!!!!

my_first_calculator Первый калькулятор созданный мною на питоне Версия калькулятора: 0.0.4 Как скачать? TERMUX Для скрипта нужен питон, скачиваем pkg

Lesha Russkiyov 2 Dec 29, 2021
Ronin - Create Fud Meterpreter Payload To Hack Windows 11

Ronin - Create Fud Meterpreter Payload To Hack Windows 11

Dj4w3d H4mm4di 6 May 09, 2022
KUIZ is a web application quiz where you can create/take a quiz for learning and sharing knowledge from various subjects, questions and answers.

KUIZ KUIZ is a web application quiz where you can create/take a quiz for learning and sharing knowledge from various subjects, questions and answers.

Thanatibordee Sihaboonthong 3 Sep 12, 2022
Manage Procfile-based applications

Foreman Manage Procfile-based applications Installation $ gem install foreman Ruby users should take care not to install foreman in their project's G

David Dollar 5.8k Jan 03, 2023
51AC8 is a stack based golfing / esolang that I am trying to make.

51AC8 is a stack based golfing / esolang that I am trying to make.

7 May 22, 2022
Write complicated anonymous functions other than lambdas in Python.

lambdex allows you to write multi-line anonymous function expression (called a lambdex) in an idiomatic manner.

Xie Jingyi 71 May 19, 2022
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
An Airflow operator to call the main function from the dbt-core Python package

airflow-dbt-python An Airflow operator to call the main function from the dbt-core Python package Motivation Airflow running in a managed environment

Tomás Farías Santana 93 Jan 08, 2023
Tool to automate the enumeration of a website (CTF)

had4ctf Tool to automate the enumeration of a website (CTF) DISCLAIMER: THE TOOL HAS BEEN DEVELOPED SOLELY FOR EDUCATIONAL PURPOSE ,I WILL NOT BE LIAB

Had 2 Oct 24, 2021
My programming language named JoLang. (Mainly created for fun)

JoLang status: not ready So this is my programming language which I decided to name 'JoLang' (inspired by Jonathan and GoLang). Features I implemented

Jonathan 14 Dec 22, 2022
An extended, game oriented, turtle

Burtle A Better TURTLE. Makes making games easier. write less do more!! Documentation & guide: https://alannxq.github.io/burtle/ Installation pip inst

5 May 19, 2022
Webcash is an experimental e-cash (electronic cash)

Webcash Webcash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone, anywhere in the world. Us

Mark Friedenbach 0 Feb 26, 2022
Group P-11's submission for the University of Waterloo's 2021 Engineering Competition (Programming section).

P-11-WEC2021 Group P-11's submission for the University of Waterloo's 2021 Engineering Competition (Programming section). Part I Compute typing time f

TRISTAN PARRY 1 May 14, 2022
A collection of some leetcode challenges in python and JavaScript

Python and Javascript Coding Challenges Some leetcode questions I'm currently working on to open up my mind to better ways of problem solving. Impleme

Ted Ngeene 1 Dec 20, 2021
Script Repository for the ICGM-CNRS FRANCE

Here you will find my Python Work repesitory for the ICGM institute - Montpellier - France.

CABOS Matthieu 1 Apr 13, 2022
Groupe du projet Python en 2TL2-4

Présentation Projet EpheCom Ce logiciel a été développé dans le cadre scolaire. EpheCom est un logiciel de communications - vocale et écrite - en temp

1 Dec 26, 2021
A Web app to Cross-Seed torrents in Deluge/qBittorrent/Transmission

SeedCross A Web app to Cross-Seed torrents in Deluge/qBittorrent/Transmission based on CrossSeedAutoDL Require Jackett Deluge/qBittorrent/Transmission

ccf2012 76 Dec 19, 2022
Inacap - Programa para pasar las notas de inacap a una hoja de cálculo rápidamente.

Inacap Programa en python para obtener varios datos académicos desde inacap y subirlos directamente a una hoja de cálculo. Cómo funciona Primero que n

Gabriel Barrientos 0 Jul 28, 2022
Problem statements on System Design and Software Architecture as part of Arpit's System Design Masterclass

Problem statements on System Design and Software Architecture as part of Arpit's System Design Masterclass

Relog 1.1k Jan 04, 2023