NEmu

Network Emulator for Mobile Universes

Tutorial - Setup a Windows VFs

In order to build a virtual network with several Microsoft Windows virtual nodes, you may be interested in creating a customized root virtual file system what will be cloned after.

Configuration

First of all, you have to get an ISO image of Windows. Then, the NEmu script for your setup is this one:

InitNemu()

VHost('win', 
 hds=[EmptyFs('windows7.img', size='5G', type='vmdk')], 
 nics=[VNic()], cdrom='/tmp/windows7.iso', display="sdl", vga="std",
 enable_kvm=None, localtime=None, k='fr', m=2048, cpu='core2duo')

VSlirp('slirp', net='192.168.0.0/24')

Link('win', 'slirp')

StartNemu()

WaitNemu('win')

StopNemu()

ExportFs('windows7.img')

DelNemu()

The first line is the initialization of the NEmu session.

The VHost line is the configuration of our virtual machine, called win, in which we are going to perform our Windows installation. This virtual machine contains an empty virtual VMDK hard drive (VMware virtual file system format), called windows7.img, of 5GB unformatted. Our virtual node contains a single virtual network interface card, with a French keyboard, 2GB of RAM and an Intel Core 2 Duo processor. We choose to activate the KVM hardware acceleration in order to improve the performances of our virtual machine. The SDL library is used to display the window of the virtual machine. The localtime option enables a synchronization between the real and the virtual clock.

Then, we setup a VSlirp in order to enable an Internet connection on the sub-net 192.168.0.0/24.

Finally, we link the virtual node to the slirp.

That's all for the configuration !

The next lines are for:

At the end of the process, the new fresh installed virtual hard drive with our Windows will be located in the current directory.

And action !

Start NEmu:

$ nemu --file script.py

Now you can install your Windows as a normal real machine setup. When you will turn off the virtual machine, its virtual hard drive will be copied in your current directory. Then, the session will be deleted.