Download your favorite Linux distribution at LQ ISO.
Go Back > Linux Answers > Applications / GUI / Multimedia
User Name


By scuzzman at 2006-02-21 15:32
Allow me to start by saying this is a very simple process if you have an iptables script configured, so fear not. Also, although this may be Slackware-specific in parts, it's because of that reason that this information can be (relatively) easily ported to other distributions.

My host (real) setup:
Slackware Linux with kernel 2.6.9

Windows 2000 Pro

Version 0.8.0

If you've not gotten it installed, you'll need qemu installed on your distribution of choice.

You'll need to create an image on your hard-drive for the virtual machine to use as a hard-drive. To do this, I used qemu-img. It was actually quite simple:
qemu-img create win2k.img 10G
Breaking this down:
qemu-img creates the images you'll be using
win2k.img is the name of the file that the virtual machine will be using as a hard-drive
10G is the size of the file - I gave it 10 gigs. The abbreviation M is also accepted. If an abbreviation is not used, it defaults to K
You'll want to do this in its own folder, and also if you're installing from a CD image on your hard-drive (I did) it's useful to put it in there, too.

Now install the operating system/format the disk. To do this, I launched qemu like this:
qemu -cdrom Win2kPro.iso -boot d -hda win2k.img
Broken down:
Win2kPro.iso is the image of my Windows 2000 Pro installation CD
-boot d tells it to boot from CD-ROM
-hda winb2k.img tells it that that file is the primary hard-drive

Now that Windows is installed, you need to get internet working. It autoconfigures its NIC with a virtual dhcp server with the IP of You need to allow packet flow of that DHCP server, so I put these rules in my iptables config:
$IP_FROM_CLIENT_OS was set to the virtual dhcp server's ip:

You'll need to make sure you have the tun/tap kernel module installed. It was, in my kernel, installed as a module by default. So all I had to do was:
modprobe tun
You now have a /dev/net/tun device, and should have internet.

After that, I reloaded the image like this:
/usr/local/bin/qemu -m 128 -smp 1 -boot c -hda '/home/scuzzy/Win2kPro/win2k.img'
And the OS and internet connection were working.

Hope this helps someone :D


All times are GMT -5. The time now is 09:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration