The basic runqemu
command syntax is as
follows:
$ runqemu [option
] [...]
Based on what you provide on the command line,
runqemu
does a good job of figuring out what
you are trying to do.
For example, by default, QEMU looks for the most recently built
image according to the timestamp when it needs to look for an
image.
Minimally, through the use of options, you must provide either
a machine name, a virtual machine image
(*.vmdk
), or a kernel image
(*.bin
).
Following is a description of runqemu
options you can provide on the command line:
runqemu
provides appropriate error
messaging to help you correct the problem.
QEMUARCH
:
The QEMU machine architecture, which must be "qemux86",
"qemux86_64", "qemuarm", "qemumips", "qemumipsel",
“qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
or "qemuzynq".
:
The virtual machine image, which must be a
VM
.vmdk
file.
Use this option when you want to boot a
.vmdk
image.
The image filename you provide must contain one of the
following strings: "qemux86-64", "qemux86", "qemuarm",
"qemumips64", "qemumips", "qemuppc", or "qemush4".
ROOTFS
:
A root filesystem that has one of the following
filetype extensions: "ext2", "ext3", "ext4", "jffs2",
"nfs", or "btrfs".
If the filename you provide for this option uses “nfs”, it
must provide an explicit root filesystem path.
KERNEL
:
A kernel image, which is a .bin
file.
When you provide a .bin
file,
runqemu
detects it and assumes the
file is a kernel image.
MACHINE
:
The architecture of the QEMU machine, which must be one
of the following: "qemux86",
"qemux86-64", "qemuarm", "qemumips", "qemumipsel",
“qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
or "qemuzynq".
The MACHINE
and
QEMUARCH
options are basically
identical.
If you do not provide a MACHINE
option, runqemu
tries to determine
it based on other options.
ramfs
:
Indicates you are booting an initial RAM disk (initramfs)
image, which means the FSTYPE
is
cpio.gz
.
iso
:
Indicates you are booting an ISO image, which means the
FSTYPE
is
.iso
.
nographic
:
Disables the video console, which sets the console to
"ttys0".
serial
:
Enables a serial console on
/dev/ttyS0
.
biosdir
:
Establishes a custom directory for BIOS, VGA BIOS and
keymaps.
biosfilename
:
Establishes a custom BIOS name.
qemuparams=\"
:
Specifies custom QEMU parameters.
Use this option to pass options other than the simple
"kvm" and "serial" options.
xyz
\"
bootparams=\"
:
Specifies custom boot parameters for the kernel.
xyz
\"
audio
:
Enables audio in QEMU.
The MACHINE
option must be
either "qemux86" or "qemux86-64" in order for audio to be
enabled.
Additionally, the snd_intel8x0
or snd_ens1370
driver must be
installed in linux guest.
slirp
:
Enables "slirp" networking, which is a different way
of networking that does not need root access
but also is not as easy to use or comprehensive
as the default.
kvm
:
Enables KVM when running "qemux86" or "qemux86-64"
QEMU architectures.
For KVM to work, all the following conditions must be met:
Your MACHINE
must be either
"qemux86" or "qemux86-64".
Your build host has to have the KVM modules
installed, which are
/dev/kvm
.
Your build host has to have virtio net device, which
are /dev/vhost-net
.
The build host /dev/kvm
directory has to be both writable and readable.
The build host /dev/vhost-net
directory has to be either readable or writable
and “slirp-enabled”.
publicvnc
:
Enables a VNC server open to all hosts.
For further understanding regarding option use with
runqemu
, consider some examples.
This example starts QEMU with
MACHINE
set to "qemux86".
Assuming a standard
Build Directory,
runqemu
automatically finds the
bzImage-qemux86.bin
image file and
the
core-image-minimal-qemux86-20140707074611.rootfs.ext3
(assuming the current build created a
core-image-minimal
image).
$ runqemu qemux86
This example produces the exact same results as the previous example. This command, however, specifically provides the image and root filesystem type.
$ runqemu qemux86 core-image-minimal ext3
This example specifies to boot an initial RAM disk image
and to enable audio in QEMU.
For this case, runqemu
set the
internal variable FSTYPE
to
"cpio.gz".
Also, for audio to be enabled, an appropriate driver must
be installed (see the previous description for the
audio
option for more information).
$ runqemu qemux86 ramfs audio
This example does not provide enough information for
QEMU to launch.
While the command does provide a root filesystem type, it
must also minimally provide a
MACHINE
,
KERNEL
, or
VM
option.
$ runqemu ext3
This example specifies to boot a virtual machine image
(.vmdk
file).
From the .vmdk
,
runqemu
determines the QEMU
architecture (MACHINE
) to be
"qemux86" and the root filesystem type to be "vmdk".
$ runqemu /home/scott-lenovo/vm/core-image-minimal-qemux86.vmdk