Differences

This shows you the differences between two versions of the page.

doc:howto:qemu [2013/01/20 06:23]
hhm arm: examples
doc:howto:qemu [2014/07/10 22:04] (current)
theoradicus use initramfs
Line 5: Line 5:
It is mixed descriptions from windows and linux, so please read through all of it before starting. It is mixed descriptions from windows and linux, so please read through all of it before starting.
-===== Ubuntu Linux version ===== +:!: Choosing different emulation settings can affect performance greatly.
-Confirmed to work on Ubuntu 10.10 both x86_64 and x86+
-* Install qemu-kvm and kvm-pxe+Example: 30s iperf-s@openwrt(qemu running on host) to host
-| sudo apt-get install qemu-kvm kvm-pxe |+<code> 
 +ne2k_pci:0.0-31.3 sec  14.6 MBytes  3.92 Mbits/sec 
 +pcnet: 0.0-30.0 sec  2.38 GBytes  682 Mbits/sec 
 +e1000: 0.0-30.0 sec  6.23 GBytes  1.79 Gbits/sec 
 +vmxnet3: 0.0-30.0 sec  8.67 GBytes  2.48 Gbits/sec 
 +virtio-net-pci:  0.0-30.0 sec  44.6 GBytes  12.8 Gbits/sec 
 +</code>
-* Download an openwrt image of your choise.+===== Getting QEMU =====
-| sudo su - +===== Ubuntu Linux version =====
-  mkdir -p /var/lib/libvirt/images +
-  cd /var/lib/libvirt/images +
-  http://downloads.openwrt.org/backfire/10.03/x86/openwrt-x86-ext2.image.gz +
-  gunzip openwrt-x86-ext2.image.gz +
-|+
-Before starting it under qemu/kvm. I had to set a network driver model to make a network interface appear in OpenWrt.+Many Linux Distributions like Debian, Ubuntu, Suse, Fedora provide a qemu package in their package repositories.
-| model=ne2k_pci |+Example for Debian 7 (Wheezy): 
 +<code> 
 +sudo apt-get install qemu 
 +</code>
-Start the image: +:!: Qemu is rapidly developing so features, syntax might change between versions.
-| sudo su - +
-  cd /var/lib/libvirt/images +
-  qemu -net nic,model=ne2k_pci -hda openwrt-x86-ext2.image +
-|+
-You should now get a "terminal like" (vnc) window popup which shows the boot of OpenWrt.+===== Windows version ===== 
 +QEMU is an an open source processor emulator (and virtualizer). The [[http://wiki.qemu.org/Links|QEMU Wiki Links]] page provides you with several unoffical download links of Windows builds.
-Good luck! 
-===== Windows version ===== +== Kamikaze X86 example == 
-QEMU is an an open source processor emulator (and virtualizer). Start  +In this example download the
-at [[http://www.qemu.org/download.html|QEMU download page]] which should  +
-have a link where [[http://www.h7.dion.ne.jp/~qemu-win/|QEMU prebuild binaries  +
-for Windows]]. You can also find other (newer) builds of QEMU for Windows  +
-by googlling. In this example download the +
[[http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip|qemu-0.9.0-windows.zip]] [[http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip|qemu-0.9.0-windows.zip]]
and unzip to a directory. and unzip to a directory.
Line 70: Line 65:
-====== OpenWrt in QEMU ARM ======+===== OpenWrt in QEMU ARM ======
The "[[https://dev.openwrt.org/wiki/realview|realview]]" platform is meant for use with QEMU for emulating an ARM system. This platform might not be available in the standard downloads (it isn't at time of writing), but it currently appears when building from scratch. The "[[https://dev.openwrt.org/wiki/realview|realview]]" platform is meant for use with QEMU for emulating an ARM system. This platform might not be available in the standard downloads (it isn't at time of writing), but it currently appears when building from scratch.
Line 79: Line 74:
Basically, use the generated image as the `-kernel` parameter. Basically, use the generated image as the `-kernel` parameter.
-====== OpenWrt in QEMU MIPS ======+FIXME Trunk: kernel image does not boot; initramfs image works 
 +FIXME Trunk: untested: use SD card with rootfs, NFS rootfs, NBD rootfs 
 +FIXME Trunk: no sound, pcibus, usb emulation in qemu possible? 
 + 
 +===== OpenWrt in QEMU MIPS ======
The "[[https://dev.openwrt.org/wiki/malta|malta]]" platform is meant for use with QEMU for emulating a MIPS system. The "[[https://dev.openwrt.org/wiki/malta|malta]]" platform is meant for use with QEMU for emulating a MIPS system.
 +
 +:!: The malta platform is broken in trunk since gcc was switched to 4.8. Compile with gcc 4.6 to get it working or disable MIPS16. [[https://dev.openwrt.org/ticket/16881|ticket #16881]]
 +
 +depending on the malta variant
 +<code>
 +qemu-system-mipsel -kernel openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256
 +</code>
 +
 +===== OpenWrt in QEMU X86-64 =====
 +
 +The x86-64 target has support for ESXI images by default.
 +Booting the VMDK / VDI images might not work with newer qemu versions.
 +
 +qemu-system-x86_64 2.0.0 with defaullt machine does not seem to work with simple "-hda openwrt.vdi".
 +
 +pc-q35-2.0 emulates a different machine.
 +With new syntax (no -hda , -net) the VDI / VMDK works.
 +
 +Features:
 +
 +  * 2 HDDs (1 openwrt image, 1 data)
 +  * 1 drive per bus, 6 bus available (until ide.5)
 +  * 2 Network cards : 1 bridged to host (need higher permission) and 1 "user" (default, NAT 10.x.x.x)
 +
 +Some emulated network cards might have performance issues.
 +
 +<code>
 +qemu-system-x86_64 \
 +-enable-kvm \
 +-M pc-q35-2.0 \
 +-drive file=openwrt-x86_64-combined-ext4.vdi,id=d0,if=none \
 +-device ide-hd,drive=d0,bus=ide.0 \
 +-drive file=data.qcow2,id=d1,if=none \
 +-device ide-hd,drive=d1,bus=ide.1 \
 +-soundhw ac97 \
 +-netdev bridge,br=virbr0,id=hn0 \
 +-device e1000,netdev=hn0,id=nic1 \
 +-netdev user,id=hn1 \
 +-device e1000,netdev=hn1,id=nic2
 +</code>

Back to top

doc/howto/qemu.1358659382.txt.bz2 · Last modified: 2013/01/20 06:23 by hhm