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

    [tom@tomPC 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.

    [tom@tomPC /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

    [root@tomPC 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

    [tom@tomPC 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 :

    tom@toms-iMac ~ % 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 !

    root@gaetan-SATELLITE-PRO-C50-J:/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
LSO, also known as Linux Swap Operator, is a software with both GUI and terminal versions that you can manage the Swap area for Linux operating systems.

LSO - Linux Swap Operator Türkçe - LSO Nedir? LSO, diğer adıyla Linux Swap Operator Linux işletim sistemleri için Swap alanını yönetebileceğiniz hem G

Eren İnce 4 Feb 9, 2022
List of Linux Tools I put on almost every linux / Debian host

Linux-Tools List of Linux Tools I put on almost every Linux / Debian host Installed: geany --> GUI editor/ notepad++ like chkservice --> TUI Linux ser

Stew Alexander 20 Jan 2, 2023
Organize seu linux - organize your linux

OrganizeLinux Organize seu linux - organize your linux Organize seu linux Uma forma rápida de separar arquivos dispersos em pastas. formatos a serem c

Marcus Vinícius Ribeiro Andrade 1 Nov 30, 2021
Tiling manager which runs on top of EWMH window managers.

PyTyle is an extremely versatile and extensible tiling manager that is meant to be used on top of EWMH window managers. Its feature set was modeled af

null 55 Jul 29, 2021
A working roblox account generator it doesnt bypass the capcha stuff cuz these didnt showed up in my test runs

A working roblox account generator (state 11.5.2021) it doesnt bypass the capcha stuff cuz these didnt showed up in my test runs

TerrificTable 22 Jan 3, 2023
Repo Home WPDrawBot - (Repo, Home, WP) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. (graphics, dev, mac)

DrawBot DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics. The built-in

Frederik Berlaen 342 Dec 27, 2022
ColabFold / AlphaFold2_advanced on your local PC (or macOS)

LocalColabFold ColabFold / AlphaFold2_advanced on your local PC (or macOS) Installation For Linux Make sure curl and wget commands are already install

Yoshitaka Moriwaki 207 Dec 22, 2022
String Spy is a project aimed at improving MacOS defenses.

String Spy is a project aimed at improving MacOS defenses. It allows users to constantly monitor all running processes for user-defined strings, and if it detects a process with such a string it will log the PID, process path, and user running the process. It will also (optionally) kill the process. For certain default C2s and other malicious software, this tool can quickly log and stop malicious behavior that normal AV does not recognize, and allows for customization.

null 10 Dec 13, 2022
🍏 Make Thinc faster on macOS by calling into Apple's native Accelerate library

?? Make Thinc faster on macOS by calling into Apple's native Accelerate library

Explosion 81 Nov 26, 2022
Dump Data from FTDI Serial Port to Binary File on MacOS

Dump Data from FTDI Serial Port to Binary File on MacOS

pandy song 1 Nov 24, 2021
Simple macOS StatusBar app to remind you to unplug your laptop when sufficiently charged

ChargeMon Simple macOS StatusBar app to monitor battery charge status and remind you to unplug your Mac when the battery is sufficiently charged Overv

Rhet Turnbull 5 Jan 25, 2022
TinyBar - Tiny MacOS menu bar utility to track price dynamics for assets on TinyMan.org

?? About A simple MacOS menu bar app to display current coins from most popular Liquidity Pools on TinyMan.org

Al 8 Dec 23, 2022
Python based scripts for obtaining system information from Linux.

sysinfo Python based scripts for obtaining system information from Linux. Python2 and Python3 compatible Output in JSON format Simple scripts and exte

Petr Vavrin 70 Dec 20, 2022
A Linux webcam plugin for BGMv2 as used in our demos.

The goal of this repository is to supplement the main Real-Time High Resolution Background Matting repo with a working demo of a videoconferencing plu

Andrey Ryabtsev 144 Dec 27, 2022
HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And Android(Termux)

HPomb v2020.02 Coming Soon Created By Secanonm HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And An

Secanonm 10 Jul 25, 2022
Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

Hein-Pieter van Braam 25 Oct 24, 2022
Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

BoppreH 3.2k Jan 1, 2023
Python screenshot library, replacement for the Pillow ImageGrab module on Linux.

tldr: Use Pillow The pyscreenshot module is obsolete in most cases. It was created because PIL ImageGrab module worked on Windows only, but now Linux

null 455 Dec 24, 2022
The earliest beta version of pytgcalls on Linux x86_64 and ARM64! Use in production at your own risk!

Public beta test. Use in production at your own risk! tgcalls - a python binding for tgcalls (c++ lib by Telegram); pytgcalls - library connecting pyt

Il'ya 21 Jan 13, 2022