What's this about?

Some virtualisation environments, namely Linux KVM/Qemu and VirtualBox supporthigh-performance paravirtualised devices that follow the 'Virtio' specification.This is a driver for using the virtio ethernet device from OS X guests.In VirtualBox, this device is known as the 'Paravirtualised Network (virtio-net)'.

Quick Start

Download the latest virtio-net driver installerto your VirtualBox or Qemu virtual machine running OS X 10.7 or newer. Run theinstaller. If your VM has any virtio-net devices enabled, they should nowspring into life!

News

The DisplayLink adapters don’t use the on board graphics processor on the Mac. Because of this, the Headless Mac Video Accelerator won’t help with USB video adapter performance issues. The best way to get the most video performance when using a monitor connected to the Mac itself is to connect to one of the native video ports. Aug 15, 2018  Yeah, one has been able to do this for some time now. A few years ago I had a setup where (and I admit much of this was for the aesthetic purity of it, not practical reasons), I used a legally purchased copy of macos, copied it unmodified to my VM server, and, with a decent amount of effort, and a patched qemu (for the SMC thingie - i donno if by now the patch is in mainline), was enjoying a. The OS runs KVM as the primary hypervisor and provides a wide range of tools to build and run VM's and containers. Some limited native support exists for DEB and RPM based Linux platforms, NixOS, osX and Windows applications. SharkLinux has several distinct qualities from other Linux systems such as; automatic system.

22 December 2013: I have updated the driver to version 0.9.4 (Beta 3) with some bug fixes and stabilityimprovements. In particular, it is now possible to safely unload the driver atruntime, using kextunload /System/Library/Extensions/virtio-net.kext. This isuseful for upgrading to newer versions without rebooting.

Version 0.9.2 was released in 2011, and the updates since have been bug fixesrather than feature enhancements.However, as I am now also using KVM, I'm strongly considering implementing driversfor more devices in the Virtio family and beyond. Of particular interest are:

  • Memory Balloon - For dynamically varying the amount of memory assigned to the virtual machine.
  • Console - Of interest to kernel developers: I'm hoping to get kprintf() output working via the virsh console.
  • Disk Storage - Currently, you have to use an emulated AHCI device for OS X VMdisks. The virtio storage device should reduce the overhead and potentially offersome advanced features such as Discard ('TRIM') which is useful for VM image filesas well as SSDs. The virtio SCSI device even supports hotplugging.
  • SPICE/qxl virtualised graphics adapter and desktop integration - Implementing a driver for this willoffer better desktop integration (native mouse cursor and resizeable VM window)and eventually, it might offer better graphics performance, clipboard integration,etc. This isn't technically based on virtio, though.
  • 9P - This is for sharing parts of the host's file system with the guest OS.
  • Network - The virtio-net implementation in KVM is much higher performanceand supports more features than VirtualBox's. This driver currently doesn't even

Some of this will eventually get done if I fund development myself. But if youhave an interest in a particular feature, I'm available for funded development,and source code contributions are always welcome.

With that in mind, the next step is modularising the existing code by splittingthe virtqueues and PCI device initialisation from the network-specific code sothat the other drivers can be built upon the virtqueues.

Latest release

The current release is version 0.9.4 (the third beta for the 1.0), which includes supportfor message signaled interrupts (they are not available on VirtualBox unfortunately),and offloaded checksumming and TCP segmentation for IPv4. Transmit speeds with TSO arenow on par with receive speeds and easily outperform the emulated Intel gigabitadapter.

Binaries (and the installer) are in the bin/ directory.

Kvm Native Library Failed To Load Mac Os

Version 0.9.4 works with both the VirtualBox and Qemu/KVM implementations of thevirtio network device, and is known to work with OS X 10.7 (Snow öLeopard) through10.9.x (Mavericks/Sea Lion), with both 32-bit and 64-bit kernels.

It might also run on 10.6 (it certainly will if you build it against the 10.6SDK with no modification). I have had success reports with 10.5 with somemodifications. I am planning to incorporate those changes once I have modularisedthe PCI code out from the network code.

Summary

Some virtualisation software (I know of VirtualBox and Linux KVM/Qemu) implementsparavirtual hardware per the 'virtio' specification. One type of virtio deviceis the 'virtio-net' ethernet adapter. Linux and Windows guest drivers exist forit, but as far as I know, this is the only such driver for Mac OS X (10.6+).

Compared to the default emulated Intel gigabit device, the paravirtualised adapterin VirtualBox is approximately twice as fast at transmitting TCP data (with TSO), and about 4times as fast at receiving.

Kernel debugging via gdb is now also supported by this driver. If the virtio-netdevice is the primary network adapter in the system (and the driver is the firstnetwork card driver to be loaded), you can attach gdb to an appropriatelyconfigured crashed kernel. Sending the ACPI Shutdown signal in VirtualBox istreated as a non-maskable interrupt (NMI) so if you specify that kernel debugflag as part of the boot args, you can attach the debugger that way.

Virtio and virtio-net

[virtio][virtio] is an open specification for virtualised 'hardware' invirtual machines. Historically, virtual machine developers have either emulatedpopular real hardware devices in order to utilise existing drivers in operatingsystems, or implemented their own virtualised devices with drivers for eachsupported guest operating system. Neither approach is ideal. Emulatingreal hardware in software is often unnecessarily inefficient: some of theconstraints of real hardware don't apply to virtualised hardware. VM-specificvirtualised devices can be fast, but require specific driver for each supportedguest operating system. Moreover, the VM developer usually maintains the drivers,and the specs are often not published. This prevents development of drivers forless popular guest operating systems.

Kvm Native Library Failed To Load Machine

An open specification presents anopportunity for separating the responsibilities for implementing the virtualhardware and the drivers, and also potentially allows for greater guestportability across different virtualisation solution.

The virtio spec (Version 0.9.5 as of this writing) includes a specification for avirtualised PCI ethernet network card. Implementations for such virtual hardwareare present in Linux' KVM virtualisation solution and also in newer versions ofVirtualBox. Drivers for guests exist for Linux (in the main tree) and forWindows.

Motivation

VirtualBox supports virtual machines running Mac OS X (when runningon Apple hardware), but so far I have not found any virtio drivers. Virtual machinesare great for testing and debugging kernel extensions; I have so far however been unableto connect gdb to a Mac OS X kernel running inside a VirtualBox VM withemulated 'real' ethernet cards. This is an attempt to create a driver whichsupports kernel debugging for the virtio network interface, in addition tobeing a good choice for general VM networking. Performance has not been apriority but seems to be pretty good so far nevertheless.

Status

Receiving and transmitting packets works, the adapter is able to negotiate DHCP,send and receive pings, handle TCP connections, etc. The driver appears to bestable even when saturating the virtual network's bandwidth. Some benchmarksare in the docs/ directory, although these predate TSO support, which hasalmost doubled transmit speed in VirtualBox on my Core2Duo MacBook Air.

Startup and shutdown appear to work fine, as do disabling and re-enabling thedevice in Network Preferences and changing the adapter's configuration on thehost side.

The driver detects link status changes and correctly communicates it to theoperating system. This means that if you untick 'cable connected' in the VirtualBox GUI for thenetwork device, the adapter's dot in the guest's Network Preferences turns red,and back to green/yellow when you tick it. If you change the adapter's 'wiring'(bridging, NAT, host-only, etc.) this is communicated as a brief status changewhich triggers a DHCP renew, as you'd want.

The 'hardware' offers various advanced features, depending on implementation.Of those, this driver supports checksum offloading and automatic segmentation(TSO) for TCP on IPv4.

Reassemblyof large packets, MAC address filtering/promiscuous mode, VLAN filtering, etc.are not implemented. Support may be added at a later date (patches welcome!).

Future refinements

Kvm Native Library Failed To Load Mac 10

Longer term, if we wish to support other virtio devices, the PCI device handlingshould be separated out into a distinct class from the ethernet controller. Thiscould then take care of general feature negotiation, memory mapping, virtqueuehandling, etc. To illustrate, the I/O registry hierarchy currently implementedby this driver is:

Mac user's library folder not showing. Where the object on the left side of the arrow is the provider of the one on theright. Under the proposed scheme, it would look something like this:

Other types of virtio devices would likewise attach to the VirtioPCIDriver.

Compiling

If you simply want to use the driver, just use the installer. For compiling ityourself, this repository containsan Xcode 4 project with which the KEXT can be built in a single step. The KEXTshould work on versions 10.5 (Leopard) through 10.8 (Mountain Lion), but sofar has onlybeen tested on Snow Leopard and Mountain Lion. Since XCode 4 only runs onSnow Leopard and up,you'll need to create your own XCode 3 project if you want to compile it onLeopard.

Mac Pc Kvm

License

Install Kvm On Mac

I'm making the source code for this driver available under the [LGPL Version 3][lgpl].The virtio_ring.hfile is adapted from the virtio spec and 3-clause BSD licensed.