This is qenv, a bunch of tools for setting up a pool of virtual x86 systems using QEMU, an open source emulator. It includes 'dnsmasq', a stand-alone lightweight DHCP server and DNS forwarder for setting up a virtual network. Prerequisites ------------- * Host system: Any Linux box where QEMU runs on full system emulation mode. Works so far under linux-x86 and linux-ppc, versions 2.6.something. * QEMU: Tested with version 0.6.0 running on x86 and ppc Linux hosts. * sudo: I haven't managed to set up a virtual network with non-root privileges, so you need 'sudo'. * bridge-utils: Needed to set up the virtual network. * iptables: Needed for setting NAT rules on the host system. Your Linux host must support Ethernet bridging (CONFIG_BRIDGE) and the Netfilter stuff for NATting. Installation ------------ The usual magic spell: $ ./configure [options] $ make $ make install './configure --help' lists the available options. You DON'T need to be root for that if you set '--prefix' to a place where you may write to. Configuring qenv ---------------- Start by setting up the host networking environment: $ qenv-mkhost Sample host config done: see ${prefix}/etc/qenv/{global,dnsmasq}.conf.sample 'qenv-mkhost' creates two sample config files: global.conf.sample, which defines the host network parameter, and 'dnsmasq.conf.sample', which sets up the DHCP details for dnsmasq. Edit them to suit your tastes and rename them to 'global.conf' and 'dnsmasq.conf'. Once you've done this, it's time to bring the networking environment up: $ qenv-host start This script creates the bridge interface that your guest will use as a gateway to the real world. If you execute 'ifconfig', you should see something like this: $ /sbin/ifconfig br0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link ... dnsmasq, the DHCP server and DNS forwarder process, should have been started as well. Check you /var/log/messages file for something like this: Aug 10 17:54:04 dnsmasq[20142]: started, version 2.10 cachesize 150 Aug 10 17:54:04 dnsmasq[20142]: DHCP, IP range 192.168.0.1 -- 192.168.0.253, lease time 1h Aug 10 17:54:04 dnsmasq[20142]: cleared cache Aug 10 17:54:04 dnsmasq[20142]: reading /etc/resolv.conf Aug 10 17:54:04 dnsmasq[20142]: using nameserver 10.0.0.138#53 Setting up the guests --------------------- The script 'qenv-mkguest' creates the COW HD image for the QEMU guest system and sets up several other QEMU-related parameters: Usage: qenv-mkguest --name= [options] Options: --hda-size= Size of HDA (ignored if '--hda-master' is used) --cdrom= CDROM image --mac=<01:23:45:67:89:AB> MAC address --ram=<128> RAM size --boot= QEMU boot device The options 'name' and 'hda-size' are mandatory. The other ones are optional, and their default values are shown in brackets. The argument to '--cdrom' can be either a real device (like '/dev/cdrom') or an ISO image somewhere in your disk. This script creates a configuration file in 'etc/qenv/guests/'. Edit it as if it where a shell script (comments start with #'s, etc) because that's what it is :-) Starting up the guests ---------------------- Use the script 'qenv-guest ' to start up the guest systems. That script starts up QEMU with the right parameters. When you're installing/setting up your guest operating systems, you should use the following networking settings: Your guest's IP address: Use DHCP for that Your guest's gateway address: The IP address of your bridge interface (see etc/qenv/global.conf) Your guest's DNS server: The IP address of your bridge interface (se etc/qenv/global.conf) Your guest's host name: Whatever you fancy.