project A DOS® Server In a Virtual Machine

Running The Debian Web Server On QEMU (Windows)

I had been grappling with a problem of running The Debian Web Server on QEMU (Windows) for a long time. Its essense was in the fork's extreme unstability. We are even warned about this on the official web site:

QEMU for Windows is experimental software and might contain even serious bugs, so use the binaries at your own risk.
http://qemu.weilnetz.de

At last... I seem to have waited for that moment when the more or less okay version of QEMU was out! My project works well on it.
First of all, let's download the QEMU's release. For IA-32, the file is called "qemu-w32-setup-20140801.exe". You may get it from the official web site, or from this server. The official web site has the version for IA-64 as well.
After you have successfully installed QEMU, you should run its special utility which converts The Debian Web Server's image of a hard drive from a VHD format into a raw format:

qemu-img convert -f vpc -O raw "D:\VM\Debian\Debian_6_0_root_pass_123.vhd" "D:\VM\Debian\debian.raw"

Then, we merely run the virtual machine:

start qemu-system-i386w.exe -cpu qemu32 -m 256 -M pc -no-reboot -serial stdio -hda "D:\VM\Debian\debian.raw" -boot order=c -vga std -net nic -net user,hostfwd=tcp::5555-:31,hostfwd=tcp::5556-:80

I'm going to tell you in a few words about the parameters for running:
  • -cpu qemu32 - defines the virtual CPU;
  • -m 256 - allocates 256 MB of RAM for the virtual machine;
  • -hda "D:\VM\Debian\debian.raw" - a hard drive's image as an IDE1 Master;
  • -boot order=c - the bootable devices queue: disk "C:";
  • -vga std - the standard virtual VGA device;
  • hostfwd=tcp::5555-:31 - translating the guest's TCP port 31 of a packet to the host's TCP port 5555;
  • hostfwd=tcp::5556-:80 - translating the guest's TCP port 80 of a packet to the host's TCP port 5556.
As you can see, the "hostfwd" parameter is for port forwarding in between the virtual machine and the real one.