Qemu introduction from Wikipedia
QEMU emulates a full computer system, including a processor and various peripherals. It can be used to provide virtual hosting of several virtual computers on a single computer.
Accelerator
Qemu author, Fabrice Bellard, also wrote a Linux kernel module (with preliminary ports to FreeBSD and Windows) named KQEMU or QEMU Accelerator, which notably speeds up i386 emulation on i386 platforms. This is accomplished by running user mode code directly on the host computer's CPU, and using processor and peripheral emulation only for kernel mode and real mode code. KQEMU also supports a kernel emulation mode in which portions of kernel mode code run on the host's CPU
Qemu official page:
http://fabrice.bellard.free.fr/qemu/
Qemu ported to Windows:
http://www.h7.dion.ne.jp/~qemu-win/
First we download a zip package:
qemu-0.9.0-windows.zip
Next unzip archives to a folder.
There are some clues at file README-en.txt, and a html manual at qemu-doc.html.
Qemu is now ready to be run:
so exec qemu-win.bat and a small linux test image "linux.img" is emulated.
NOTE: When a mouse cursor is missing, type Ctrl and Alt key together. Please use Alt
and Tab on WindowsMe.
NOTE: To exit from Linux, press Ctrl-Alt-2 keys together then you will see (qemu) prompt.
Then type quit: (qemu) quit
Running Qemu:
I have downloaded a Ubuntu iso cdrom image: ubuntu-7.04-desktop-i386.iso
First I exec C:\Windows\System32\cmd.exe to open a comand line window, and then:
>cd <qemu-directory-path>
>qemu -L . -m 512 -cdrom ubuntu-7.04-desktop-i386.iso
Argument options have the following meanings:Option | Value | Explanation |
---|
-L | bios path | in our example actual directory "." |
-m | available memory | Default is 128 meg, I set it to 512 | -cdrom | iso cdrom image path | Iso image to emulate a cdrom |
Qemu gives this warning:
Could not open '\\.\kqemu' - QEMU acceleration layer not activatedTo avoid this message, install
qemu accelerator, which will improve qemu speed:
(NOTE: uninstall any previous version accelerator you have before installing this one)
Qemu accelerator Kqemu-1.3.0pre11NETWORK SET UP FOR QEMU ON WINDOWS VISTARight now we don't have network available. We check at this doc for some clues:
HowToNetwork-en.htmlI have decided to use a TAP (virtual ethernet network interface) to have full internet access:
TapWin32-en.htmlFirst we need a VPN driver for windows:
OpenVPN driver download page.
Download and install this program:
openvpn-2.0.9-install.exeOnce installed go to Programs menu and then
-> OpenVPN -> Add a new TAP-Win32 virtual ethernet adapter If all has gone fine, a tap device will appear at:
Control panel -> Network and Sharing Center -> Manage networksRemember the
TAP interface name because it will be passed as an argument to qemu, i.e. in my computer is
"Local area connection 2"Now we have to establish a
NETWORK SOFTWARE BRIDGE in windows vista.
Network bridge (Wikipedia)
A network bridge connects multiple network segments at the
data link layer (layer 2) of the
OSI model.
In our case the bridge will interconnect a real network interface with our TAP interface at data link layer, so
both interfaces will share same IP address.
Howto set up a network bridge at windows xp and vista:
Win XP network bridge set up.Select both interfaces pressing ctrl key, and right click the mouse.
Select
"Bridge connections" at the pop up menu and wait till network bridge will be completed.
After bridge completion gonna set up its network configuration:
right click at bridge icon -> properties -> Internet protocol version 4If you have a dhcp server you can set bridge interface to automatically get its IP address.
I use a static network configuration at my LAN.
(
change values to suit your network.)
IP 192.168.0.5
netmask 255.255.255.0
gateway 192.168.0.129
DNS1 194.179.1.100
DNS2 194.179.1.101
To check the network at console window we can make some pings:
ping 192.168.0.5
ping 192.168.0.129 (checking gateway)
Time of truth arrives, we launch qemu:
qemu -L . -m 512 -cdrom ubuntu-7.04-desktop-i386.iso -net nic -net tap,ifname="Local area connection 2"
at ubuntu guest system I configure the network with a free IP address on my LAN:
IP 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.129
DNS 194.179...
pings work:
ping 192.168.0.10
ping 192.168.0.5
ping 192.168.0.129 (checking the gateway)
If you have Internet access through your LAN, you can now open a browser and surf on the Internet from inside your qemu guest system. :-)
More info about bridging:hnw_bridge_installhnw_understanding_bridgeOTHER INTERESTING LINKSQemu HowTo Floppy Cdrom