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
Cvdl-hw2 - Find Contour, Camera Calibration, Augmented Reality and Stereo Disparity Map

opevcvdl-hw2 This project uses openCV and Qt to achieve the requirements. Version Python 3.7 opencv-contrib-python 3.4.2.17 Matplotlib 3.1.1 pyqt5 5.1

Kenny Cheng 3 Aug 17, 2022
Jarvis Python BOT acts like Google-assistance

Jarvis-Python-BOT Jarvis Python BOT acts like Google-assistance Setup Add Mail ID (Gmail) in the file at line no 82.

Ishan Jogalekar 1 Jan 08, 2022
Understanding the field usage of any object in Salesforce

Understanding the field usage of any object in Salesforce One of the biggest problems that I have addressed while working with Salesforce is to unders

Sebastian Undurraga 1 Dec 14, 2021
A Company Management System For Python

campany-management Getting started To make it easy for you to get started with GitLab, here's a list of recommended next steps. Already a pro? Just ed

hatice akpınar 3 Aug 29, 2022
Url-check-migration-python - A python script using Apica API's to migrate URL checks between environments

url-check-migration-python A python script using Apica API's to migrate URL chec

Angelo Aquino 1 Feb 16, 2022
Project Guide for ASAM OpenX standards

ASAM Project Guide Important This guide is a work in progress and subject to change! Hosted version available at: ASAM Project Guide (Link) Includes:

ASAM e.V. 2 Mar 17, 2022
Types for the Rasterio package

types-rasterio Types for the rasterio package A work in progress Install Not yet published to PyPI pip install types-rasterio These type definitions

Kyle Barron 7 Sep 10, 2021
Learn the basics of Python. These tutorials are for Python beginners. so even if you have no prior knowledge of Python, you won’t face any difficulty understanding these tutorials.

01_Python_Introduction Introduction 👋 Python is a modern, robust, high level programming language. It is very easy to pick up even if you are complet

Milaan Parmar / Милан пармар / _米兰 帕尔马 245 Dec 30, 2022
A10 cipher - A Hill 2x2 cipher that totally gone wrong

A10_cipher This is a Hill 2x2 cipher that totally gone wrong, it encrypts with H

Caner Çetin 15 Oct 19, 2022
Multtable is a collection of multiplication table generators in various languages.

Multtable Multtable is a collection of multiplication table generators in various languages. This project was created as a joke based on one of my bro

pollen__ 7 Mar 05, 2022
Set up a sidechain for the XRPL quickly and easily

Sidechain Launch Kit Introduction This directory contains python scripts to tests and explore side chains. This document walks through the steps to se

Xpring Engineering 15 Dec 08, 2022
Handwrite - Type in your Handwriting!

Handwrite - Type in your Handwriting! Ever had those long-winded assignments, that the teacher always wants handwritten?

coded 7 Dec 06, 2022
Set of scripts that schedules employees for shifts throughout the week based on availability, shift times, and shift necessities

Automatic-Scheduler Set of scripts that schedules employees for shifts throughout the week based on availability, shift times, and shift necessities *

Matthew 1 May 01, 2022
The repository for my video "Playing MINECRAFT with a WEBCAM"

This is the official repo for my video "Playing MINECRAFT with a WEBCAM" on YouTube Original video can be found here: https://youtu.be/701TPxL0Skg Red

Rishabh 27 Jun 07, 2022
Contains a Jupyter Notebook for calculating remaining plants required based on field/lathhouse data.

Davis-Sunflowers-Su21 Project goals: Plants influence their reproduction and mating system in many ways. Various factors such as time of flowering, ab

1 Feb 10, 2022
Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns

Diffraction Simulations - Angular Spectrum Method Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns with arbitr

Rafael de la Fuente 276 Dec 30, 2022
A random cat fact python module

A random cat fact python module

Fayas Noushad 4 Nov 28, 2021
A example project's description is a high-level overview of why you’re doing a project.

A example project's description is a high-level overview of why you’re doing a project.

Nikita Matyukhin 12 Mar 23, 2022
Traffic flow test platform, especially for reinforcement learning

Traffic Flow Test Platform Traffic flow test platform, especially for reinforcement learning, named TFTP. A traffic signal control framework that can

4 Nov 07, 2022
A Blender addon to align the origin to the top, center or bottom of a mesh object

Align Origin Blender Addon. Align Origin Blender Addon. What? This simple addon lets you align the origin to the top, center or bottom of a mesh objec

VA79 7 Nov 30, 2022