qemu-kvm for illumos-kvm
C C++ Haxe Assembly Perl Makefile Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
QMP
audio
bin
block
bsd-user
compat/sys
darwin-user
default-configs Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
docs
etc/qemu
fpu
fsdev
gdb-xml
hw
kvm
linux-user Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
net
pc-bios OS-4975 ship iPXE ROM for PXE boot of VirtIO NICs in KVM guests Nov 19, 2015
scripts
share/qemu
slirp Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
sysconfigs/target
target-alpha Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
target-arm
target-cris
target-i386 HVM-588 Make sure copyright is updated in kvm-cmd Aug 9, 2011
target-ia64 Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
target-m68k Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
target-microblaze Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
target-mips
target-ppc
target-s390x
target-sh4
target-sparc Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
tcg
tests
ui HVM-841 QEMU VNC display driver mishandles SetPixelFormat (CVE-2015-8… Feb 5, 2016
.gitignore
.gitmodules Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
CODING_STYLE Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
COPYING
COPYING.LIB
Changelog
HACKING Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
LICENSE
MAINTAINERS
Makefile
Makefile.dis
Makefile.hw
Makefile.joyent
Makefile.objs
Makefile.target
Makefile.user
README.md [HVM-636] Add support for more than one DHCP server Sep 1, 2011
README.qemu
TODO
VERSION
a.out.h
acl.c
acl.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
aes.c
aes.h
aio.c
alpha-dis.c
alpha.ld
arch_init.c
arch_init.h
arm-dis.c
arm-semi.c
arm.ld
async.c
balloon.c
balloon.h
block-migration.c
block-migration.h
block.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
block.h
block_int.h
blockdev.c
blockdev.h
bswap.h
bt-host.c
bt-host.h
bt-vhci.c
buffered_file.c
buffered_file.h
build.sh
cache-utils.c
cache-utils.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
check-qdict.c
check-qfloat.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
check-qint.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
check-qjson.c
check-qlist.c
check-qstring.c
cmd.c
cmd.h
compatfd.c
compatfd.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
config.h
configure HVM-846 enable preadv/pwritev again Apr 12, 2016
console.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
console.h
cpu-all.h
cpu-common.h
cpu-defs.h
cpu-exec.c
cpus.c
cpus.h
cris-dis.c
ctf.sh HVM-785 kvm-cmd build should use CTFMERGE and CTFCONVERT Oct 25, 2013
cursor.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
cursor_hidden.xpm
cursor_left_ptr.xpm
cutils.c
def-helper.h
device_tree.c
device_tree.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
dis-asm.h
disas.c
disas.h
dma-helpers.c
dma.h
dyngen-exec.h
elf.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
envlist.c
envlist.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
exec-all.h
exec.c
gdbstub.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
gdbstub.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
gen-icount.h
hmp-commands.hx
host-utils.c
host-utils.h
hpet.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
hppa-dis.c
hppa.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
i386-dis.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
i386.ld
ia64-dis.c
ia64.ld
ia64intrin.h
input.c
ioport-user.c
ioport.c
ioport.h
iorange.h
iov.c
iov.h
json-lexer.c
json-lexer.h
json-parser.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c HVM-588 Make sure copyright is updated in kvm-cmd Aug 9, 2011
kvm-stub.c
kvm-tpr-opt.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
kvm.h HVM-588 Make sure copyright is updated in kvm-cmd Aug 9, 2011
libfdt_env.h
linux-aio.c
m68k-dis.c
m68k-semi.c
m68k.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
manifest
microblaze-dis.c
migration-exec.c
migration-fd.c
migration-tcp.c
migration-unix.c
migration.c
migration.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
mips-dis.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
mips.ld
module.c
module.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
monitor.c
monitor.h
nbd.c
nbd.h
net-checksum.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
net.c [HVM-636] Add support for more than one DHCP server Sep 1, 2011
net.h HVM-588 Make sure copyright is updated in kvm-cmd Aug 9, 2011
notify.c
notify.h
os-posix.c
os-win32.c
osdep.c
osdep.h
oslib-posix.c
oslib-win32.c
path.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
pci-ids.txt
pflib.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
pflib.h
poison.h
posix-aio-compat.c HVM-846 enable preadv/pwritev again Apr 12, 2016
ppc-dis.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
ppc.ld
ppc64.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu-aio.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-barrier.h
qemu-char.c
qemu-char.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-common.h
qemu-config.c
qemu-config.h
qemu-doc.texi
qemu-error.c
qemu-error.h
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-kvm-ia64.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-kvm-x86.c
qemu-kvm.c
qemu-kvm.h
qemu-lock.h
qemu-log.h
qemu-malloc.c HVM-588 Make sure copyright is updated in kvm-cmd Aug 9, 2011
qemu-nbd.c
qemu-nbd.texi
qemu-objects.h
qemu-option.c
qemu-option.h
qemu-options.h
qemu-options.hx Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-os-posix.h
qemu-os-win32.h
qemu-queue.h
qemu-sockets.c
qemu-tech.texi Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-thread.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-thread.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qemu-timer-common.c
qemu-timer.c
qemu-timer.h
qemu-tool.c
qemu-x509.h
qemu.sasl
qemu_mdb.c
qemu_socket.h
qerror.c
qerror.h
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qlist.c
qlist.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
qmp-commands.hx
qobject.h
qstring.c
qstring.h
range.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
readline.c
readline.h
rules.mak HVM-785 kvm-cmd build should use CTFMERGE and CTFCONVERT Oct 25, 2013
rwhandler.c
rwhandler.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
s390-dis.c
s390.ld
savevm.c
sh4-dis.c
simpletrace.c
simpletrace.h
softmmu-semi.h
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h
sparc-dis.c
sparc.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
sparc64.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
spice-qemu-char.c
sysemu.h
targphys.h Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
tcg-runtime.c
thunk.c
thunk.h
trace-events
translate-all.c
uboot_image.h
usb-bsd.c
usb-linux.c Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011
usb-stub.c
version.rc
vgafont.h
vl.c HVM-758 Add a qmp entry for hw setup complete Nov 19, 2012
x86_64.ld Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm Jun 24, 2011

README.md

  ___  _____ __  __ _   _
 / _ \| ____|  \/  | | | |
| | | |  _| | |\/| | | | |
| |_| | |___| |  | | |_| |
 \__\_\_____|_|  |_|\___/

For full documentation on all the various options for QEMU please see the html docs.

BUILDING

Preparing:

Edit build.sh and change the --kerneldir option to point to the directory of the kvm repository and change the --prefix option to whatever you want.

$ ./build.sh
$ make install

USING

Follow the qemu documentation for all of the various options available. The rest of this will be examples and specific pieces about how to use things with a VNIC and a ZVOL. The following is a sample configuration for qemu running a Linux VM.

$ /smartdc/bin/qemu-system-x86_64 \
    -enable-kvm \
    -nographic \
    -drive file=smartdc.iso,media=cdrom,if=ide \
    -boot order=cd \
    -smp 4 \
    -m 1024 \
    -vnc 0.0.0.0:0 \
    -net nic,vlan=0,name=net0,model=virtio,macaddr=90:b8:d0:c0:ff:ee\
    -net vnic,vlan=0,name=net0,ifname=eth0,macaddr=90:b8:d0:c0:ff:ee,\
         ip=10.88.88.50,netmask=255.255.255.0,gateway_ip=10.88.88.2,\
         server_ip=10.88.88.200,dns_ip0=8.8.4.4,dns_ip1=8.8.4.4,\
     hostname=host1,lease_time=3600 \
    -no-hpet \
    -chardev socket,id=serial0,path=/tmp/vm.console,server,nowait \
    -serial chardev:serial0 \
    -drive file=/dev/zvol/rdsk/zones/rec-8,if=virtio,index=0

ZVOLs

It is highly desirable to be able to give a virtual machine a zvol to use as a disk. This is accomplished via the -drive option. Simply pass the block device that corresponds to the zvol.

To create a zvol use a command similar to:

$ zfs create -V 10g tank/vm-hdd

VNICs

We have added an option to have a virtual machine's network interface card directly correspond to a Crossbow vnic on the system. The -net vnic has several mandatory arguments:

  • vlan must be specified and correspond to a single -net nic line
  • name must be specified and correspond to a single -net nic line
  • macaddr must be specified if the MAC Address of the VNIC does not match the MAC address on the -net nic line.
  • ifname must be specified and correspond to the name of the crossbow vnic.

To set up the crossbow vnic, simply create it. There is no need to plumb it. The device will be opened up in promiscuous mode.

To create a vnic you'll want something akin to:

$ dladm create-vnic -l e1000g0 vnic0

The -net vnic option also supports configuring networking on the virtual machine via dhcp. In this mode, qemu acts as a DHCP server for the virtual machine. To enable vnic dhcp, specify the following arguments:

  • ip (eg: 192.168.0.2) must be specified in order to enable dhcp
  • netmask (eg: 255.255.255.0) must be specified
  • gateway_ip (eg: 192.168.0.1) must be specified
  • server_ip (eg: 192.168.0.3) is optional. This allows specifying the IP address of qemu's DHCP server.
  • dns_ip (eg: 8.8.4.4) is optional, and allows specifying the DNS server the virtual machine will use. The default value is 8.8.8.8.
  • dns_ip0, dns_ip1, dns_ip2, and dns_ip3 are optional, and allow specifying a list of DNS servers, rather than just one. These options override the dns_ip option.
  • hostname (eg: myhostname) is optional. This defaults to no hostname.
  • lease_time (eg: 3600) is optional, and allows specifying the DHCP lease time in seconds. The default value is 86400 (or 1 day).

The following is a sample -net vnic line for running with DHCP:

-net vnic,vlan=0,name=net0,ifname=eth0,macaddr=90:b8:d0:c0:ff:ee, \
    ip=10.88.88.50,netmask=255.255.255.0,gateway_ip=10.88.88.2, \
    server_ip=10.88.88.200,dns_ip=8.8.4.4,hostname=host1,lease_time=3600