intel / haxm

Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
BSD 3-Clause "New" or "Revised" License
3.21k stars 871 forks source link

Add NetBSD tutorial #170

Open krytarowski opened 5 years ago

krytarowski commented 5 years ago

There is missing NetBSD tutorial.

I wrote a README notes on a NetBSD mailing list.

http://mail-index.netbsd.org/netbsd-users/2019/02/13/msg022207.html HAXM in pkgsrc

HAXM has been imported into pkgsrc/emulators/haxm.

HAXM is a cross-platform hardware-assisted virtualization engine
(hypervisor), widely used as an accelerator for Android Emulator and
QEMU. It has always supported running on Windows and macOS, and has been
ported to other host operating systems as well, such as Linux and NetBSD.

HAXM runs as a kernel-mode driver on the host operating system, and
provides a KVM-like interface to user space, thereby enabling
applications like QEMU to utilize the hardware virtualization
capabilities built into modern Intel CPUs, namely Intel Virtualization
Technology.

http://netbsd.org/~kamil/screenfetch/windows7_x86/crop_screen_00361.png

More information on the porting process is available on The NetBSD blog:
http://blog.netbsd.org/tnf/entry/the_hardware_assisted_virtualization_challenge

NetBSD/amd64 is the only supported host of the package, but it shouldn't
be difficult to port to NetBSD/i386 and package support for other
supported OSes. The only tested version of the host kernel are 8.0 and
HEAD, earlier releases might work (in theory 6.x is the minimal one).
HAXM works with unpatched NetBSD kernel.

Users of HAXM shall obtain from the sources at least a copy of syssrc
and place it into regular directory /usr/src(/sys).

Guests that are already known to work:

 - NetBSD/amd64
 - Windows 7 32-bit
 - Linux 64-bit (noapic boot)
 - FreeBSD 12 32-bit
 - Minix3 i386
 - Plan9 i386
 - FREEDOS

Other OSes are either broken or untested.

Usage:

1. Install emulators/haxm from pkgsrc
2. Install emulators/qemu 3.1.0nb5 or newer from pkgsrc
3. Use auxiliary scripts for HAXM (superuser privileges needed)
4. Append HAXM option to qemu (qemu --accel hax)

Auxiliary scripts in the HAXM package:

 - haxm-mknod # creates /dev entries
 - haxm-modload # inserts the HAXM kernel module
 - haxm-modunload # removes the HAXM module from the NetBSD kernel

Optionally grant access to the HAXM device nodes to user(s):

 - /dev/HAX
 - /dev/hax_vm/vm{00-07}
 - /dev/hax_vm{00-07}/vcpu{00-15}

Future updates to the HAXM support will be tracked directly on The
NetBSD Wiki qemu page:

http://wiki.netbsd.org/users/kamil/qemu/

Once I will get done:

I will prepare a tutorial for this repository.

krytarowski commented 5 years ago

Once I will get done:

  • HAXM/NetBSD patch accepted in Qemu and shipped with a stable release

Merged (https://github.com/qemu/qemu/commit/604a5b9978c8824dbd2164d1fc990016a67ced40) and in the end backported into pkgsrc/emulators/qemu

  • FPU DNA fix merged

Merged https://github.com/intel/haxm/commit/3bdfd1a39021df9b4dfe69e05a277e4e6456494a

I will prepare a tutorial for this repository.

It's probably the proper time to do so.

@polprog are you interested in preparing a tutorial and submit it as a pull-request? If so, please do it!