[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6435":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},6435,"xhyve","machyve\u002Fxhyve","machyve","xhyve, a lightweight OS X virtualization solution","",null,"C",6442,352,183,72,0,4,64.04,"Other",false,"master",true,[],"2026-06-12 04:00:28","# [xhyve.xyz](http:\u002F\u002Fwww.xhyve.xyz)\n\n![](.\u002Fxhyve_logo.png)\n\u003C!-- https:\u002F\u002Fthenounproject.com\u002Fterm\u002Fsquirrel\u002F57718\u002F -->\n\nAbout\n-----\n\nThe *xhyve hypervisor* is a port of [bhyve](http:\u002F\u002Fwww.bhyve.org) to macOS. It is built on top of [Hypervisor.framework](https:\u002F\u002Fdeveloper.apple.com\u002Flibrary\u002Fmac\u002Fdocumentation\u002FDriversKernelHardware\u002FReference\u002FHypervisor\u002Findex.html) in OS X 10.10 Yosemite and higher, runs entirely in userspace, and has no other dependencies. It can run FreeBSD, some Linux distributions, and Windows 10 and may gain support for other guest operating systems in the future.\n\nLicense: [BSD-2-Clause](LICENSE)\n\nIntroduction: [http:\u002F\u002Fwww.pagetable.com\u002F?p=831](http:\u002F\u002Fwww.pagetable.com\u002F?p=831)\n\nRequirements\n------------\n\n* OS X 10.10.3 Yosemite or later\n* a 2010 or later Mac (i.e. a CPU that supports EPT: `sysctl kern.hv_support` = 1)\n\nInstallation\n------------\n\nIf you have homebrew, then simply:\n\n    $ brew update\n    $ brew install --HEAD xhyve\n\nThe `--HEAD` in the brew command ensures that you always get the latest changes, even if the homebrew database is not yet updated. If for any reason you don't want that simply do `brew install xhyve` .\n\nIf you have MacPorts, then simply:\n\n    $ sudo port selfupdate\n    $ sudo port install xhyve\n\nMacPorts is up to date with the GitHub ref listed in the port info\n\n    $ port info xhyve\n    xhyve @20170117 (emulators)\n    ...\n\nOtherwise:\n\nBuilding\n--------\n    $ git clone https:\u002F\u002Fgithub.com\u002Fmachyve\u002Fxhyve.git\n    $ cd xhyve\n    $ xcodebuild\n\nThe resulting binary will be in build\u002FRelease\u002Fxhyve\n\nUsage\n-----\n\n    $ xhyve -h\n\nSee below for steps to boot various OSs\n\nWhat is *bhyve*?\n--------------\n\n*bhyve* is the FreeBSD hypervisor, roughly analogous to KVM + QEMU on Linux. It has a focus on simplicity.\n\nIt exposes the following peripherals to virtual machines:\n\n  - Local x(2)APIC\n  - IO-APIC\n  - 8259A PIC\n  - 8253\u002F8254 PIT\n  - HPET\n  - PM Timer\n  - RTC\n  - PS\u002F2 Keyboard and Mouse (via VNC)\n  - PCI\n    - host bridge\n    - passthrough\n    - UART\n    - AHCI (i.e. HDD and CD)\n    - VirtIO block device\n    - VirtIO networking\n    - VirtIO RNG\n    - Intel e1000 (aka e82545)\n    - VGA\u002FFramebuffer (exposed with a minimal VNC server)\n    - XHCI USB support with one device defined - a tablet for Windows guest support\n\n*bhyve* architecture\n------------------\n                                                           Linux\n               I\u002FO        VM control       FreeBSD        NetBSD\n                                                          OpenBSD\n             |     A        |     A           |              |\n             V     |        V     |           V              V\n         +-------------++-------------++-------------++-------------+\n         |             ||             ||             ||             |\n         |    bhyve    ||  bhyvectl   ||  bhyveload  || grub2-bhyve |\n         |             ||             ||             ||             |\n         |             ||             ||             ||             |\n         +-------------++-------------++-------------++-------------+\n         +----------------------------------------------------------+\n         |                        libvmmapi                         |\n         +----------------------------------------------------------+\n                                       A\n                                       |                         user\n         ------------------------------┼------------------------------\n                                       | ioctl         FreeBSD kernel\n                                       V\n                         +----------------------------+\n                         |        VMX\u002FSVM host        |\n                         |       VMX\u002FSVM guest        |\n                         |   VMX\u002FSVM nested paging    |\n                         |           Timers           |\n                         |         Interrupts         |\n                         +----------------------------+\n                          vmm.ko\n\n\n**vmm.ko**\n\nThe *bhyve* FreeBSD kernel module. Manages VM and vCPU objects, the guest physical address space and handles guest interaction with PIC, PIT, HPET, PM Timer, x(2)APIC and I\u002FO-APIC. Contains a minimal x86 emulator to decode guest MMIO. Executes the two innermost vCPU runloops (VMX\u002FSVM and interrupts\u002Ftimers\u002Fpaging). Has backends for Intel VMX and AMD SVM. Provides an ioctl and mmap API to userspace.\n\n**libvmmapi**\n\nThin abstraction layer between the vmm.ko ioctl interface and the userspace C API.\n\n**bhyve**\n\nThe userspace *bhyve* component (kind of a very light-weight QEMU) that executes virtual machines. Runs the guest I\u002FO vCPU runloops. Manages ACPI, PCI and all non in-kernel devices. Interacts with vmm.ko through libvmmapi.\n\n**bhyvectl**\n\nSomewhat superfluous utility to introspect and manage the life cycle of virtual machines. Virtual machines and vCPUs can exist as kernel objects independently of a *bhyve* host process. Typically used to delete VM objects after use. Odd architectural choice.\n\n**bhyveload**\n\nUserspace port of the FreeBSD bootloader. This is a cumbersome workaround to bootstrap a FreeBSD guest operating system without using firmware. It creates a VM object, loads the FreeBSD kernel into guest memory, sets up the initial vCPU state and then exits. Only then a VM can be executed by *bhyve*.\n\n**grub2-bhyve**\n\nPerforms the same function as bhyveload but is a userspace port of [GRUB2](http:\u002F\u002Fgithub.com\u002Fgrehan-freebsd\u002Fgrub2-bhyve). It is used to bootstrap guest operating systems other than FreeBSD, i.e. Linux, OpenBSD and NetBSD.\n\n\n*xhyve* architecture\n------------------\n        +----------------------------------------------------------+\n        | xhyve                                                    |\n        |                                                          |\n        |                            I\u002FO                           |\n        |                                                          |\n        |                                                          |\n        |                                                          |\n        |+--------------------------------------------------------+|\n        ||  vmm                   VMX guest                       ||\n        ||                          Timers                        ||\n        ||                        Interrupts                      ||\n        |+--------------------------------------------------------+|\n        +----------------------------------------------------------+\n        +----------------------------------------------------------+\n        |                   Hypervisor.framework                   |\n        +----------------------------------------------------------+\n                                      A\n                                      |                         user\n        ------------------------------┼------------------------------\n                                      |syscall            xnu kernel\n                                      V\n        \n                                   VMX host\n                               VMX nested paging\n\n\n*xhyve* shares most of the code with *bhyve* but is architecturally very different. Hypervisor.framework provides an interface to the VMX VMCS guest state and a safe subset of the VMCS control fields, thus making userspace hypervisors without any additional kernel extensions possible. The VMX host state and all aspects of nested paging are handled by the macOS kernel, you can manage the guest physical address space simply through mapping of regions of your own address space.\n\n*xhyve* is equivalent to the *bhyve* process but gains a subset of a userspace port of the vmm kernel module. SVM, PCI passthrough and the VMX host and EPT aspects are dropped. The vmm component provides a libvmmapi compatible interface to *xhyve*. Hypervisor.framework seems to enforce a strict 1:1 relationship between a host process\u002FVM and host thread\u002FvCPU, that means VMs and vCPUs can only be interacted with by the processes and threads that created them. Therefore, unlike *bhyve*, *xhyve* needs to adhere to a single process model. Multiple virtual machines can be created by launching multiple instances of *xhyve*. *xhyve* retains most of the *bhyve* command line interface.\n\n*bhyvectl*, *bhyveload* and *grub2-bhyve* are incompatible with a single process model and are dropped. *xhyve* supports the Linux [kexec protocol](http:\u002F\u002Fwww.kernel.org\u002Fdoc\u002FDocumentation\u002Fx86\u002Fboot.txt), a very simple and straightforward way to bootstrap a Linux kernel. It takes a bzImage and optionally initrd image and kernel parameter string as input.\n\n*xhyve* can now boot an OS via EFI. The BSD-licensed TianoCore EFI built for *bhyve* can be used to boot Windows and other OSs.\n\nNetworking\n----------\nIf you want the same IP address across VM reboots, assign a UUID to a particular VM:\n\n    $ xhyve [-U uuid]\n\n**Optional:**\n\nIf you need more advanced networking and already have a configured [TAP](http:\u002F\u002Ftuntaposx.sourceforge.net) device you can use it with:\n\n\tvirtio-tap,tapX\n\ninstead of:\n\n    virtio-net\n\nWhere *X* is your tap device, i.e. *\u002Fdev\u002FtapX*.\n\nBooting TinyCoreLinux\n---------------------\n\nEverything needed to boot TinyCoreLinux is included with *xhyve*.\n\n**Steps:**\n\n- From Terminal, launch the `xhyverun-tinycorelinux.sh` script in your xhyve directory.\n\nBooting FreeBSD (via userboot)\n------------------------------\n**Requirements:**\n\n- A FreeBSD iso image. This can be downloaded from FreeBSD.org\n\n**Steps:**\n\n- Build *xhyve* with `make` (type `make` in Terminal from your *xhyve* directory) - this will build an unsigned copy of *xhyve*\n- `mkfile 5g FreeBSD.dmg` - Create a blank image to install to\n- Use your favorite text editor to edit the xhyverun-freebsd.sh script and properly set the paths to the iso and disk image\n- Run the script from Terminal with sudo: `sudo .\u002Fxhyverun-freebsd.sh` and enter your admin password\n\n**Known Issues:**\n- This will only work with an unsigned build of *xhyve* - See *Codesigning\u002FEntitlements* in **Issues**\n\n\nBooting Windows (via EFI)\n-------------------------\n\nNow that *xhyve* has support for a framebuffer, EFI and the e1000 NIC, *xhyve* can now run Windows in a VM. \n\n**Requirements:**\n\n- A Windows 10 iso image. This can be downloaded from Microsoft: [Windows 10 iso](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fsoftware-download\u002Fwindows10ISO)\n- A license key for Windows.\n- The *bhyve* EFI - this can be downloaded **in FreeBSD** via `pkg install bhyve-firmware` - the EFI will be named \"BHYVE_UEFI.fd\" and installed into `\u002Fusr\u002Flocal\u002Fshare\u002Fuefi-firmware`. Copy that file to macOS.\n- A VNC client - these vary greatly in speed and willingness to connect to the fairly minimal VNC server built into the framebuffer code.\n\n**Steps:**\n\n- `mkfile 20g Windows.dmg` - Create a blank image to install to\n- Use your favorite text editor to edit the `xhyverun-windows.sh` script and properly set the paths to the iso, disk image and BHYVE_UEFI.fd\n- From Terminal, launch the modified `xhyverun-windows.sh` script in your xhyve directory.\n- Connect the VNC client to 127.0.0.1:29000\n\n**Known Issues:**\n\n- Windows does not recognize more than one CPU and the CPU device is missing from Device Manager\n- The e1000 emulation works, but is incomplete - network statistics don't appear in Task Manager or Resource Monitor\n- Mouse positioning in VNC is wacky - this is due to the nature of how mouse deltas are passed to the VM and what Windows does to them afterwards. Once Windows is installed, one can enable remote connection and connect with Microsoft Remote Desktop instead of the VNC client.\n\nIssues\n------\n\n### Virtual Box\nIf you are, or were, running any version of VirtualBox, prior to 4.3.30 or 5.0, and attempt to run *xhyve*, your system will immediately crash as a kernel panic is triggered. This is due to a VirtualBox bug (that got fixed in newest VirtualBox versions) as VirtualBox wasn't playing nice with OSX's Hypervisor.framework used by *xhyve*.\n\nTo get around this you either have to update to newest VirtualBox 4.3 or 5.0 or, if you for some reason are unable to update, to reboot your Mac after using VirtualBox and before attempting to use *xhyve*. (see issues [#5](https:\u002F\u002Fgithub.com\u002Fmist64\u002Fxhyve\u002Fissues\u002F5) and [#9](https:\u002F\u002Fgithub.com\u002Fmist64\u002Fxhyve\u002Fissues\u002F9) for the full context)\n\n### Code signing\u002FEntitlements\nmacOS limits access to the networking API (vmnet) to builds that are code signed and have the appropriate entitlement. The code signing\u002Fentitlement requirement can be bypassed by running *xhyve* as root (via `sudo`). A code signed build cannot run FreeBSD via the `userboot.so` bootloader as that requires loading and executing code that is outside the code signature (even as root). Building *xhyve* via `xcodebuild` signs the build. Building *xhyve* via `make` does not.\n\nTODO\n----\n\n- vmm:\n  - enable APIC access page to speed up APIC emulation (**performance**)\n  - enable x2APIC MSRs (even faster) (**performance**)\n  - vmm_callout:\n      - is a quick'n'dirty implementation of the FreeBSD kernel callout mechanism\n      - seems to be racy\n      - fix races or perhaps replace with something better\n      - use per vCPU timer event thread (**performance**)?\n      - use hardware VMX preemption timer instead of `pthread_cond_wait` (**performance**)\n  - some 32-bit guests are broken (support PAE paging in VMCS)\n  - PCID guest support (**performance**)\n- block_if:\n  - macOS does not support `preadv`\u002F`pwritev`, we need to serialize reads and writes for the time being until we find a better solution. (**performance**)\n  - support block devices other than plain files\n- virtio_net:\n  - unify TAP and vmnet backends\n  - vmnet: send\u002Freceive more than a single packet at a time (**performance**)\n- virtio_rnd:\n  - is untested\n- e1000\n  - is untested beyond basically working with Windows\n  - fix missing statistics (see Booting Windows)\n  - add support for TAP\n  - tune performance (**performance**)\n- framebuffer\n  - is untested beyond basically working with Windows\n  - VNC: add support for more modern connections (ssh) to improve security and compatibility with more clients\n  - add an option to share the framebuffer with a client UI app (specifics need defining) (**performance**)\n- UEFI\n  - is untested beyond basically working with Windows\n  - Needs testing against various OSs\n  - figure out why Windows doesn't properly see more than one CPU (might also involve ACPI)\n- XHCI\n  - Move XHCI support and the tablet device to *xhyve*\n- remove explicit state transitions:\n  - since only the owning task\u002Fthread can modify the VM\u002FvCPUs a lot of the synchronization might be unnecessary (**performance**)\n- performance, performance and performance\n- remove vestigial code, cleanup\n","xhyve是一个轻量级的macOS虚拟化解决方案。它基于macOS 10.10 Yosemite及更高版本中的Hypervisor框架构建，完全在用户空间运行，无需其他依赖。该项目支持运行FreeBSD、部分Linux发行版以及Windows 10，并可能在未来增加对更多操作系统的支持。xhyve的核心功能包括通过VirtIO提供网络和块设备支持，以及利用Intel e1000网卡模拟等技术特性。适用于需要在macOS上进行操作系统开发测试或运行多种类型虚拟机的场景。",2,"2026-06-11 03:06:52","top_language"]