Fork of QEMU that supports PCI Passthrough on macOS http://www.qemu.org
  • C 82.5%
  • C++ 6.3%
  • Python 3.4%
  • Dylan 2.8%
  • Shell 1.7%
  • Other 3.1%
Find a file
Scott J. Goldman 6691422e19
Update README with Thunderbolt device requirements
Add note about Thunderbolt device compatibility with Apple Silicon.
2026-07-06 17:38:24 -07:00
.github/workflows github: fix config mistake preventing repo lockdown commenting 2022-04-26 16:12:26 +01:00
.gitlab/issue_templates .gitlab/issue_templates: Move suggestions into comments 2022-12-15 15:19:24 +01:00
.gitlab-ci.d scripts: Move lsan_suppressions.txt out of oss-fuzz subdir 2026-03-06 09:43:18 +00:00
accel target/arm/hvf: Add -accel hvf,tso=on for Apple TSO memory model 2026-05-04 17:13:55 -04:00
audio audio: Use unsigned PCM bias 2026-04-28 18:53:58 +04:00
authz qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
backends vfio: Allow building on Darwin hosts 2026-05-04 16:53:37 -04:00
block block: Use glib2 instead of strcasecmp/strncasecmp 2026-04-23 12:27:27 +02:00
bsd-user bsd-user, linux-user: signal: recursive signal delivery fix 2026-03-31 19:13:20 +01:00
chardev serial COM: windows serial COM PollingFunc don't sleep 2026-04-22 12:45:13 +04:00
common-user common-user: Drop __linux__ around .note.GNU-stack 2026-03-01 20:49:39 -07:00
configs configs/targets: Restrict the legacy ldst_phys() API on s390x target 2026-04-30 16:59:09 +02:00
contrib contrib/apple-vfio: Fix headless mode 2026-05-10 23:10:02 -04:00
crypto MAINTAINERS: Remove my disfunctional emails 2026-04-24 21:27:22 +02:00
disas disas: diassemble RISC-V xlrbr (crc32) instructions 2026-04-29 11:41:00 +10:00
docs docs: Add vfio-apple documentation and MAINTAINERS entry 2026-05-04 16:53:37 -04:00
dump dump: enhance dump_state_prepare fd initialization 2026-03-17 21:15:10 +04:00
ebpf ebpf: Make ebpf_rss_load() return value consistent with @errp 2025-11-18 19:59:36 +01:00
fpu fpu: Change parts_float_to_float_widen to parts64_to_parts128 2026-04-30 08:10:05 +10:00
fsdev fsdev: Build stubs once 2026-03-17 19:50:05 +01:00
gdbstub gdbstub: Generate a single gdbstub-xml.c / gdb_static_features[] 2026-03-10 17:12:18 -07:00
host/include meson: Drop host_arch rename for riscv64 2026-01-17 10:46:07 +11:00
hw vfio/apple: Add host-root= to pick a dext when BDFs collide 2026-05-04 17:13:55 -04:00
include target/arm/hvf: Add -accel hvf,tso=on for Apple TSO memory model 2026-05-04 17:13:55 -04:00
io Migration pull request 2026-04-25 10:20:29 -04:00
libdecnumber libdecnumber: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
linux-headers linux-headers: Update to Linux v6.19-rc1 2026-01-26 08:30:04 +01:00
linux-user linux-user: Translate errno in IP_RECVERR and IPV6_RECVERR 2026-04-30 09:00:04 +02:00
migration migration/qemu-file: drop incorrect const from qemu_get_buffer_at buf 2026-04-23 12:14:52 -03:00
monitor qapi/iothread: introduce poll-weight parameter for aio-poll 2026-04-29 11:31:44 -04:00
nbd block/export: Add multi-threading interface 2026-03-10 12:11:57 +01:00
net net/passt: Don't try to read the pidfile if passt got a signal 2026-03-09 16:45:24 +01:00
pc-bios HPPA patches for qemu-v11 2026-03-31 20:46:13 +01:00
plugins plugins/api-system: Handle migrate_add_blocker() failure 2026-03-17 12:13:16 -07:00
po po: update Italian translation 2024-08-13 19:01:42 +02:00
python minikconf: add mypy annotations 2026-04-30 17:55:03 +02:00
pyvenv meson, mkvenv: add functests custom target 2026-02-23 13:24:42 -05:00
qapi Pull request 2026-04-30 10:30:22 -04:00
qga qga: Fix VSS provider GetSnapshotProperties return value 2026-02-18 11:27:57 +02:00
qobject tests/qtest: Add qtest for for ASPEED GPIO gpio-set property 2025-10-22 08:14:09 +02:00
qom qom: Restrict compat properties API to system emulation 2026-04-24 21:27:21 +02:00
replay replay: remove dependency on audio/ 2026-02-23 14:28:57 +01:00
roms target/hppa: Update SeaBIOS-hppa to version 24 2026-03-31 20:24:24 +02:00
rust Misc HW patches 2026-04-25 10:21:42 -04:00
scripts * hw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name() 2026-05-01 14:41:49 -04:00
scsi scsi: Don't consider LOGICAL UNIT NOT SUPPORTED guest recoverable 2026-03-31 14:27:28 +02:00
semihosting semihosting: Build stubs once 2026-03-08 23:08:41 +01:00
stats qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
storage-daemon storage-daemon: use same link arguments as other tools 2026-04-23 12:27:27 +02:00
stubs MAINTAINERS: Remove my disfunctional emails 2026-04-24 21:27:22 +02:00
subprojects subprojects: add probe crate 2025-12-27 10:11:10 +01:00
system darwin: prevent App Nap and I/O throttling from demoting guest performance 2026-05-04 17:13:55 -04:00
target target/arm/hvf: Add -accel hvf,tso=on for Apple TSO memory model 2026-05-04 17:13:55 -04:00
tcg tcg/aarch64/tcg-target.c.inc: Manual replace of I3310, I3313 2026-04-30 07:09:21 +10:00
tests * hw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name() 2026-05-01 14:41:49 -04:00
tools misc: Clean up includes 2026-01-22 11:23:31 +00:00
trace rust: add trace crate 2025-10-01 11:22:07 -04:00
ui ui/gtk: Turn clipboard flag into runtime option 2026-04-28 18:53:59 +04:00
util darwin: prevent App Nap and I/O throttling from demoting guest performance 2026-05-04 17:13:55 -04:00
.b4-config b4: Drop linktrailermask 2025-07-03 13:42:28 +02:00
.dir-locals.el Add .dir-locals.el file to configure emacs coding style 2015-10-08 19:46:01 +03:00
.editorconfig scripts/kernel-doc: Delete the old Perl kernel-doc script 2025-08-30 16:37:23 +01:00
.exrc qemu: add .exrc 2012-09-07 09:02:44 +03:00
.gdbinit .gdbinit: load QEMU sub-commands when gdb starts 2017-06-07 14:38:45 +01:00
.git-blame-ignore-revs metadata: add .git-blame-ignore-revs 2023-04-04 15:56:44 +01:00
.gitattributes rust: patch bilge-impl to allow compilation with 1.63.0 2024-11-05 14:18:16 +01:00
.gitignore configure: rename --enable-pypi to --enable-download, control subprojects too 2023-06-06 16:30:01 +02:00
.gitlab-ci.yml docs: Document GitLab custom CI/CD variables 2021-07-29 07:56:01 +02:00
.gitmodules .gitmodules: restore qemu-project mirror of u-boot-sam460ex 2025-10-07 07:33:39 +01:00
.gitpublish .gitpublish: use origin/master as default base 2025-10-07 07:33:39 +01:00
.mailmap MAINTAINERS: update address 2026-04-16 16:17:19 -07:00
.patchew.yml scripts/checkpatch: roll diff tweaking into checkpatch itself 2021-06-25 10:08:33 +01:00
.readthedocs.yml readthedocs: don't build extra formats 2025-08-12 14:59:50 -04:00
.travis.yml travis.yml: Remove the aarch64 job 2025-06-11 12:17:17 +02:00
block.c block: Fix references in bdrv_bsc_*() function comments 2026-03-31 14:52:06 +02:00
blockdev-nbd.c nbd: Avoid deadlock in client connecting to same-process server 2025-11-13 12:50:57 -06:00
blockdev.c block: Fix BDS use after free during shutdown 2025-12-15 17:31:08 +01:00
blockjob.c block: rename block/aio-wait.h to qemu/aio-wait.h 2025-12-27 10:11:12 +01:00
clippy.toml meson, cargo: require Rust 1.83.0 2025-09-17 19:00:56 +02:00
configure tests/lcitool: Update openSUSE to version 16 2026-03-23 13:13:07 +00:00
COPYING COPYING: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
COPYING.LIB COPYING: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
cpu-common.c cpus: Trace cpu_exec_start() and cpu_exec_end() calls 2025-10-31 16:26:45 +00:00
cpu-target.c cpu-target: build compilation unit once for user/system 2025-09-02 17:57:05 +02:00
event-loop-base.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
gitdm.config contrib/gitdm: add group-map for Microsoft 2025-11-24 09:45:30 +00:00
hmp-commands-info.hx hmp-commands-info.hx: Move definition of "info accel" 2026-01-16 11:17:28 +01:00
hmp-commands.hx audio: deprecate HMP audio commands 2025-10-30 22:59:30 +04:00
iothread.c darwin: prevent App Nap and I/O throttling from demoting guest performance 2026-05-04 17:13:55 -04:00
job-qmp.c qapi job: Elide redundant has_FOO in generated C 2022-12-14 20:04:47 +01:00
job.c block: rename block/aio-wait.h to qemu/aio-wait.h 2025-12-27 10:11:12 +01:00
Kconfig dump: Build stubs once for non-x86 targets 2026-01-22 10:48:46 +01:00
Kconfig.host vfio: Allow building on Darwin hosts 2026-05-04 16:53:37 -04:00
LICENSE tcg/LICENSE: Remove out of date claim about TCG subdirectory licensing 2019-11-11 15:11:21 +01:00
MAINTAINERS docs: Add vfio-apple documentation and MAINTAINERS entry 2026-05-04 16:53:37 -04:00
Makefile Makefile: add python script dependency for meson-buildoptions.sh 2026-02-06 12:02:56 +00:00
meson.build darwin: prevent App Nap and I/O throttling from demoting guest performance 2026-05-04 17:13:55 -04:00
meson_options.txt ui/gtk: Turn clipboard flag into runtime option 2026-04-28 18:53:59 +04:00
module-common.c all: Clean up includes 2016-02-04 17:41:30 +00:00
os-posix.c os: add an ability to lock memory on_fault 2025-02-12 11:36:01 -05:00
os-wasm.c include/qemu/osdep.h: Add Emscripten-specific OS dependencies 2025-05-06 16:02:04 +02:00
os-win32.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
page-vary-common.c page-vary: Build finalize_target_page_bits as common code 2026-02-26 00:12:07 +01:00
page-vary-system.c page-vary: Build migration_legacy_page_bits as common code 2026-02-26 00:12:12 +01:00
pythondeps.toml pythondeps: bump to meson 1.11.1 2026-04-30 15:50:18 +02:00
qemu-bridge-helper.c qemu-bridge-helper: relocate path to default ACL 2020-09-30 19:11:36 +02:00
qemu-edid.c qemu-edid: Restrict input parameter -d to avoid division by zero 2022-10-12 13:38:15 +02:00
qemu-img-cmds.hx qemu-img info: Add cache mode option 2025-10-29 12:10:10 +01:00
qemu-img.c qemu-img rebase: don't exceed IO_BUF_SIZE in one operation 2025-11-11 22:06:09 +01:00
qemu-io-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qemu-io.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qemu-keymap.c qemu-keymap: fix altgr modifier lookup for newer xkeyboard-config 2026-04-09 15:44:58 +02:00
qemu-nbd.c nbd: Defer trace init until after daemonization 2025-03-05 13:00:22 -06:00
qemu-options.hx Pull request 2026-04-30 10:30:22 -04:00
qemu.nsi pc-bios: Move device tree files in their own subdir 2025-04-25 17:09:58 +02:00
qemu.sasl sasl: remove comment about obsolete kerberos versions 2021-06-14 13:28:50 +01:00
README.md Update README with Thunderbolt device requirements 2026-07-06 17:38:24 -07:00
README.upstream.rst add some basic docs for this fork 2026-05-04 21:42:33 -04:00
replication.c replication: move include out of root directory 2021-05-26 14:49:46 +02:00
run.in run: introduce a script for running devel commands 2025-12-27 10:11:12 +01:00
target-info-qom.c hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces 2025-10-29 19:15:37 +01:00
target-info-stub.c target-info: Move TARGET_PAGE_BITS sanity check 2026-02-26 00:11:26 +01:00
target-info.c qemu/target_info: Add target_s390x() helper 2026-02-26 00:02:14 +01:00
trace-events cpus: Trace cpu_exec_start() and cpu_exec_end() calls 2025-10-31 16:26:45 +00:00
VERSION Open 11.1 development tree 2026-04-22 14:19:37 -04:00
version.rc configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION 2021-01-02 21:03:37 +01:00

QEMU + apple-vfio

This is a fork of QEMU that adds PCI passthrough on Apple Silicon Macs via a DriverKit system extension, packaged as a single macOS app that bundles QEMU and the dext together.

The upstream QEMU README is preserved at README.upstream.rst.

This document covers building the macOS host app from source. Since, we have not yet received the necessary entitlements from Apple, we cannot release binaries of this project yet.


Prerequisites

  • Apple Silicon Mac running macOS 26 (Tahoe) or newer
  • Xcode 26.3+ with the macOS installed
  • An Apple Developer account
  • A non-TB5 Thunderbolt device like an eGPU enclosure. Keep in mind that newer Thunderbolt 5 enclosures DO NOT WORK correctly with Apple Silicon. Best to stick to an older Thunderbolt 4 or 3 enclosure.

Configure the Xcode project for your Apple Developer team

Open the project:

open contrib/apple-vfio/VFIOUserHostApp.xcodeproj

Before building anything, make sure you've logged into Xcode with your Apple Developer account (Xcode -> Settings -> Apple Accounts), and that your computer is authorized

Then for each of the three targets — VFIOUserHostApp, VFIOUserPCIDriver, and qemu-vfio-apple:

  1. Select the target in the project navigator.
  2. Go to Signing & Capabilities.
  3. Change Team to your own team in the dropdown. Leave Automatically manage signing checked.
  4. Update Bundle Identifier, replacing the scottjg. prefix with one registered to your team (e.g. com.example.). Keep the suffixes intact so the parent/child relationship between the app and dext is preserved:
    • com.example.VFIOUserHostApp
    • com.example.VFIOUserHostApp.VFIOUserPCIDriver
    • com.example.VFIOUserHostApp.qemu-vfio-apple

Build with Product → Build (⌘B). The app lands in ~/Library/Developer/Xcode/DerivedData/VFIOUserHostApp-*/Build/Products/Debug/VFIOUserHostApp.app


Copy the app to /Applications

This step is required. macOS will not stage a DriverKit extension unless its host app lives under /Applications (or another system-managed location). The app contains an at-launch helper that offers to move itself, but it deliberately skips that prompt for builds running out of DerivedData so developers don't get nagged on every rebuild.

So, after building in Xcode, manually copy the app:

  1. In Xcode, right-click VFIOUserHostApp.app under Products and choose Show in Finder.
  2. Drag VFIOUserHostApp.app into /Applications.
  3. Launch it from /Applications (not from DerivedData).

If you skip this step, the dext won't load and the app's "Install System Extension" button will fail silently or report an activation error.


First launch

On first launch from /Applications:

  1. Select the option to install the system extension.
  2. macOS shows a notification: "System Extension Blocked". Open System Settings → Privacy & Security, scroll to the bottom, and click Allow next to the entry for VFIOUserPCIDriver.
  3. Select the option to install the CLI tools.
  4. You can quit the app.
  5. Open a new terminal and run qemu-vfio-apple driver-status to verify the driver is installed
  6. Run qemu-vfio-apple list-devices to confirm that your eGPU is recognized and the driver attached.
  7. Run qemu-vfio-apple run to start the VM with your eGPU.
  8. Sign into the Ubuntu user with the password 'ubuntu'

Code layout

contrib/
├── apple-vfio/                          # macOS host app + dext + CLI launcher
│   ├── VFIOUserHostApp.xcodeproj/       # the Xcode project
│   ├── VFIOUserHostApp/                 # SwiftUI host app
│   ├── VFIOUserPCIDriver/               # DriverKit dext (C++/IIG)
│   ├── qemu-vfio-apple/                 # Swift CLI launcher embedded in the app
│   ├── scripts/                         # build-phase scripts and dist tooling
│   └── image-builder/                   # prebaked Ubuntu guest image pipeline
└── apple-dma/                           # guest-side DMA companion device driver
    ├── linux/                           # apple_dma Linux kernel module (DKMS)

QEMU-side changes for the Apple VFIO backend live under hw/vfio/ (apple-device.c, container-apple.c, apple-dma.c, etc.) and are gated by host_os == 'darwin' in hw/vfio/meson.build.

contrib/apple-dma/linux/ is required in the guest. Only the dext can program the DART (Apple's IOMMU), so we ship a paravirtual PCI device (hw/vfio/apple-dma.c) plus a matching DKMS kmod that hooks dma_map_ops for passthrough devices and forwards each map/unmap to QEMU over a doorbell-driven shared-memory ring; QEMU asks the dext to update the DART. The prebaked image installs the kmod automatically; BYO guests need to build and load it.