Network Emulator for Mobile Universes

Tutorial - Setup a Linux VFs

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


First of all, you have to get an ISO image of your favorite Linux distribution. In this tutorial, we choose to use a Debian Wheezy but you can choose another distribution of course. Then, the NEmu script for your setup is this one:


 hds=[EmptyFs('debian7.img', size='2G', type='raw', format='ext3')], 
 nics=[VNic()], cdrom='/tmp/debian7_netinst.iso', display="sdl", vga="std",
 enable_kvm=None, localtime=None, k='fr', m=1024, cpu='core2duo')

VSlirp('slirp', net='')

Link('debian', 'slirp')






The first line is the initialization of the NEmu session.

The VHost line is the configuration of our virtual machine, called debian, in which we are going to perform our Debian installation. This virtual machine contains an empty virtual raw hard drive, called debian7.img, of 2GB formatted in EXT 3. Our virtual node contains a single virtual network interface card, with a French keyboard, 1GB 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

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 Debian Wheezy will be located in the current directory.

And action !

First of all, we download the last version of Debian Wheezy:

$ wget -O /tmp/debian7_netinst.iso

Then, we start NEmu:

$ nemu --file

Now you can install your Debian as a normal real machine setup; do not forget to install a boot-loader. 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.