QEMU on Fedora 11
From Crashcourse Wiki
Here are the QEMU-related packages on Fedora 11, and what they're for:
qemu-system-arch: The system emulation package for a specific, QEMU-supported architecture, where arch would be one of arm, m68k, mips and a number of others. If you want the full list, just
$ yum search qemu-system
which will list them all.
- qemu-user: For user-mode emulation.
- qemu-img: The command-line tool for manipulating disk images.
- qemu: The QEMU "meta-package", which includes all of the above, including all system emulation packages.
- qemu-kvm-tools: For KVM diagnostics and debugging tools.
- qemu-launcher: A graphical front-end to QEMU virtual machines.
Testing user emulation mode
If you're new to QEMU and want to test simple user emulation mode, grab the QEMU user test tarball from [here] and unload it anywhere in or under your home directory. Change into that directory and test QEMU user emulation mode for a given architecture with, for example:
$ qemu-ppc -L gnemul/qemu-ppc ppc/ls
The above will invoke QEMU in PPC emulation mode, link dynamically against the shared libraries under gnemul/qemu-ppc and run the PPC-compiled executable ppc/ls. Try it for all of the available architectures to see which ones actually work. Don't be surprised if some don't.
Test results: Based on the original test script, it appears that the valid architectures you can test this way are i386, arm, armeb, mips, mipsel, ppc, sh4, sh4eb, sparc and x86_64. All architectures work properly for user emulation, with the following exceptions.
First, x86_64 generates some diagnostics, even though it continues on to produce the correct output:
$ qemu-x86_64 -L gnemul/qemu-x86_64 x86_64/ls ERROR: ioctl(SNDCTL_DSP_MAPINBUF): target=0x80085013 host=0x80105013 ERROR: ioctl(SNDCTL_DSP_MAPOUTBUF): target=0x80085014 host=0x80105014 Changelog dummyfile mipsel sparc Makefile gnemul ppc sparc64 README hppa ppc64 test.sh alpha i386 qemu-linux-user.sh x86_64 arm m68k sh4 armeb mips sh4eb
In addition, both big- and little-endian ARM architectures fail:
$ qemu-arm -L gnemul/qemu-arm arm/ls mmap: Permission denied $ qemu-armeb -L gnemul/qemu-armeb armeb/ls mmap: Permission denied
The reason for this is that, apparently, the ARM emulator wants to mmap to a very low address and the host Linux system may have a minimum acceptable mmap address:
$ cat /proc/sys/vm/mmap_min_addr 65536
There are allegedly two ways around this.
The first is, with root privilege, simply set that /proc file value to zero:
# echo 0 > /proc/sys/vm/mmap_min_addr
The second solution is to set the environment variable GUEST_BASE to a valid value relative to that file; say, 65536. This is the solution suggested on the net, but it no longer appears to work so, at least for now, changing the value of the /proc file is the only workaround, so you'll need root privilege. I'll update this section if things change.
Tracing QEMU execution
If you want to follow the execution of a QEMU emulation, just set the environment variable QEMU_STRACE to any value before running the command.
Return to the Virtualization on Fedora wiki page.