- C 82.5%
- C++ 6.3%
- Python 3.4%
- Dylan 2.8%
- Shell 1.7%
- Other 3.1%
|
|
||
|---|---|---|
| .github/workflows | ||
| .gitlab/issue_templates | ||
| .gitlab-ci.d | ||
| accel | ||
| audio | ||
| authz | ||
| backends | ||
| block | ||
| bsd-user | ||
| chardev | ||
| common-user | ||
| configs | ||
| contrib | ||
| crypto | ||
| disas | ||
| docs | ||
| dump | ||
| ebpf | ||
| fpu | ||
| fsdev | ||
| gdbstub | ||
| host/include | ||
| hw | ||
| include | ||
| io | ||
| libdecnumber | ||
| linux-headers | ||
| linux-user | ||
| migration | ||
| monitor | ||
| nbd | ||
| net | ||
| pc-bios | ||
| plugins | ||
| po | ||
| python | ||
| pyvenv | ||
| qapi | ||
| qga | ||
| qobject | ||
| qom | ||
| replay | ||
| roms | ||
| rust | ||
| scripts | ||
| scsi | ||
| semihosting | ||
| stats | ||
| storage-daemon | ||
| stubs | ||
| subprojects | ||
| system | ||
| target | ||
| tcg | ||
| tests | ||
| tools | ||
| trace | ||
| ui | ||
| util | ||
| .b4-config | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .exrc | ||
| .gdbinit | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .gitmodules | ||
| .gitpublish | ||
| .mailmap | ||
| .patchew.yml | ||
| .readthedocs.yml | ||
| .travis.yml | ||
| block.c | ||
| blockdev-nbd.c | ||
| blockdev.c | ||
| blockjob.c | ||
| clippy.toml | ||
| configure | ||
| COPYING | ||
| COPYING.LIB | ||
| cpu-common.c | ||
| cpu-target.c | ||
| event-loop-base.c | ||
| gitdm.config | ||
| hmp-commands-info.hx | ||
| hmp-commands.hx | ||
| iothread.c | ||
| job-qmp.c | ||
| job.c | ||
| Kconfig | ||
| Kconfig.host | ||
| LICENSE | ||
| MAINTAINERS | ||
| Makefile | ||
| meson.build | ||
| meson_options.txt | ||
| module-common.c | ||
| os-posix.c | ||
| os-wasm.c | ||
| os-win32.c | ||
| page-vary-common.c | ||
| page-vary-system.c | ||
| pythondeps.toml | ||
| qemu-bridge-helper.c | ||
| qemu-edid.c | ||
| qemu-img-cmds.hx | ||
| qemu-img.c | ||
| qemu-io-cmds.c | ||
| qemu-io.c | ||
| qemu-keymap.c | ||
| qemu-nbd.c | ||
| qemu-options.hx | ||
| qemu.nsi | ||
| qemu.sasl | ||
| README.md | ||
| README.upstream.rst | ||
| replication.c | ||
| run.in | ||
| target-info-qom.c | ||
| target-info-stub.c | ||
| target-info.c | ||
| trace-events | ||
| VERSION | ||
| version.rc | ||
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:
- Select the target in the project navigator.
- Go to Signing & Capabilities.
- Change Team to your own team in the dropdown. Leave Automatically manage signing checked.
- 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.VFIOUserHostAppcom.example.VFIOUserHostApp.VFIOUserPCIDrivercom.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:
- In Xcode, right-click
VFIOUserHostApp.appunder Products and choose Show in Finder. - Drag
VFIOUserHostApp.appinto/Applications. - 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:
- Select the option to install the system extension.
- 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. - Select the option to install the CLI tools.
- You can quit the app.
- Open a new terminal and run
qemu-vfio-apple driver-statusto verify the driver is installed - Run
qemu-vfio-apple list-devicesto confirm that your eGPU is recognized and the driver attached. - Run
qemu-vfio-apple runto start the VM with your eGPU. - 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.