In /etc/network/interfaces

auto tap0
iface tap0 inet static
        address 192.0.2.1
        netmask 255.255.255.0
        vde2-switch -
        post-up sysctl -w net.ipv4.ip_forward=1
        post-up iptables -t nat -A POSTROUTING -s 192.0.2.0/255.255.255.0 -j MASQUERADE
        post-up /etc/init.d/dhcp3-server start
        pre-down /etc/init.d/dhcp3-server stop
        pre-down iptables -t nat -D POSTROUTING -s 192.0.2.0/255.255.255.0 -j MASQUERADE
        pre-down sysctl -w net.ipv4.ip_forward=0

Run qemu as e.g.
vdeq qemu -m 512 -net nic,vlan=1,macaddr=02:00:00:00:00:00 -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl -hda master.img

for pxe booting in lenny, install kvm and cd /usr/share/qemu; ln -s ../kvm/pxe* .

add yourself to the vde2-net group
--
apt-get install -y dhcp3-server tftpd bind9

http://debian.lcs.mit.edu/debian/dists/lenny/main/installer-i386/current/images/netboot/netboot.tar.gz

/etc/bind/named.conf.options:
        allow-query { 127.0.0.1; 192.0.2.0/24; };

/etc/default/dhcp3-server:
INTERFACES="tap0"

ln -s $(realpath tftpboot) /tftpboot
ln -s $(realpath preseed.cfg) /var/www
-- install
sudo -u kcr vdeq kvm -m 128 -net nic,vlan=1,macaddr=02:00:00:00:00:00 -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl -hda test.img -boot n -nographic
