photo
Jordan Sissel
geek

Mon, 06 Jun 2005

qemu, an open source emulator

I'm always skeptical of open source software doing it's job correctly, and but sometimes I'm surprised by them. I recently installed a platform emulator called qemu. It can emulate x86, SPARC, PPC, and a few others supposedly. I recently installed windows using it, and it runs surprisingly well. It's fast enough to let me play starcraft, for instance ;)

I've previously used vmware 3 in freebsd with much success but not after lots of irritating kludges to get it to work properly. Qemu was a joy to get working, just two commands and you can be off and running.

nightfall$ qemu-img create windaz 5G
nightfall$ qemu -cdrom /dev/acd0t0 -boot d windaz
'-boot d' tells it to boot off the D: drive, which is the cdrom. I was now ready to install windows to my 5 gig "drive"

For the x86 platform, it has a kernel module for linux and freebsd you can use to accelerate emulation by getting rid of a few layers of translation (Why translate for x86 when you're ON x86?). FreeBSD's port of it allowed me to build the kqemu kernel module, and off I went installing Windows XP. The install went flawlessly - and it blew my mind that everything worked out of the box. By default, it uses it's own "user net" internal nat/firewall nonsense that I didn't bother futzing with. It can use Linux's tun or FreeBSD's tap interfaces to get a real ip assuming you setup bridging and whatnot properly.

To get TAP running for qemu under freebsd, you're going to have to have tap in your kernel, or kldload if_tap. Once done, you'll probably want to setup bridging or setup local nat and dhcp. At any rate, I used bridging. You'll need BRIDGE in your kernel or kldload bridge. To turn bridging on use

# sysctl net.link.ether.bridge.enable=1
# sysctl net.link.ether.bridge.config=em0,tap0
If you get an error with either of those commands, you don't have bridge loaded or in the kernel. Anyway, em0 and tap0 are the two interfaces you are bridging. em0 is my wired interface to the world.

You definately don't want to put your new install of windows on the net before getting SP2 and some antivirus software, so don't use the tap stuff until after that. If you don't specify the -n option to qemu, it will use user-net (assuming you haven't created a /etc/qemu-ifup script).

Comments: 0 (view comments)
Tags:
Permalink: /geekery/174
posted at: 02:31


0 responses to 'qemu, an open source emulator'


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment:


Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)

Tag Cloud

Calendar

< June 2005 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
2627282930  

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati