This page is currently a work in progress. If you would like to improve it, please request a wiki account.

Table of contents:

Requirements

Currently KVM on OpenIndiana only supports recent Intel chipsets with VT and EPT instructions. It is also a very fresh port so bugs are to be expected.

Installing KVM

pkg install \
    driver/i86pc/kvm \
    system/qemu \
    system/qemu/kvm

Using KVM

First create a zvol for the guest:

zfs create -p -V 10G rpool/kvm/myguest/disk0

Create a vnic (assumes e1000g0 as your primary NIC, substitute as necessary):

dladm create-vnic -l e1000g0 vnic0
MAC=$(dladm show-vnic -po macaddress vnic0)

Invoke the qemu-kvm command, for example:

pfexec /usr/bin/qemu-kvm \
        -boot cd \
        -enable-kvm \
        -vnc 0.0.0.0:1 \
        -smp 2 \
        -m 2048 \
        -no-hpet \
        -localtime \
        -drive file=/dev/zvol/rdsk/rpool/kvm/myguest/disk0,if=ide,index=0 \
        -drive file=/path/to/some/cdimage.iso,media=cdrom,if=ide,index=2  \
        -net nic,vlan=0,name=net0,model=e1000,macaddr=$MAC \
        -net vnic,vlan=0,name=net0,ifname=vnic0,macaddr=$MAC \
        -vga std

The /usr/bin/qemu command is vanilla QEMU with no KVM support. You must use /usr/bin/qemu-kvm to use KVM.

Fresh example