--- /dev/null
+d-i debian-installer/locale string en_NZ
+
+d-i keyboard-configuration/xkb-keymap select us
+d-i keyboard-configuration/layoutcode string us
+
+d-i netcfg/choose_interface select auto
+d-i netcfg/dhcp_options select Configure network manually
+d-i netcfg/confirm_static boolean true
+d-i netcfg/wireless_wep string
+
+d-i hw-detect/load_firmware boolean true
+
+d-i mirror/country string manual
+d-i mirror/protocol string http
+d-i mirror/http/hostname string debian.morphium.info
+d-i mirror/http/directory string /debian
+d-i mirror/http/proxy string
+d-i mirror/suite string wheezy
+
+d-i anna/choose_modules string network-console
+d-i network-console/password password r00tme
+d-i network-console/password-again password r00tme
+d-i network-console/start boolean true
+d-i di-utils-shell/do-shell boolean true
+
+d-i passwd/make-user boolean false
+d-i passwd/root-password-crypted password $6$lifGZQZ9$OVYc/Z26ilx1DLCOyPSy1/xOz5o.f6weCgMHYXQZ9EE38DYt0xJBd1Z83/KMWhDyeNmKxp0TUqpJN6w.MT72//
+
+d-i time/zone string Europe/Berlin
+
+d-i clock-setup/utc boolean true
+d-i clock-setup/ntp boolean true
+
+d-i partman-basicfilesystems/choose_label string gpt
+d-i partman-basicfilesystems/default_label string gpt
+d-i partman-partitioning/choose_label string gpt
+d-i partman-partitioning/default_label string gpt
+d-i partman/choose_label string gpt
+d-i partman/default_label string gpt
+
+#d-i partman-partitioning/confirm_write_new_label boolean true
+#d-i partman-partitioning/unknown_label boolean true
+
+d-i partman-auto/disk string /dev/vda
+d-i partman-auto/method string lvm
+
+d-i partman-md/device_remove_md boolean true
+d-i partman-auto/purge_lvm_from_device boolean true
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+
+d-i partman-auto/expert_recipe string madduck :: \
+ 1 1 1 free \
+ $gptonly{ } \
+ $primary{ } \
+ method{ biosgrub } \
+ . \
+ 8192 32768 -1 ext3 \
+ $defaultignore{ } \
+ $primary{ } \
+ method{ lvm } \
+ . \
+ 128 1024 200% linux-swap \
+ $lvmok{ } lv_name{ swap } \
+ method{ swap } format{ } \
+ . \
+ 1024 1536 3072 ext3 \
+ $lvmok{ } lv_name{ root } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ / } label{ root } \
+ options/relatime{ relatime } \
+ options/user_xattr{ user_xattr } \
+ . \
+ 2048 3072 6144 ext3 \
+ $lvmok{ } lv_name{ usr } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /usr } label{ usr } \
+ options/noatime{ noatime } \
+ options/nodev{ nodev } \
+ . \
+ 2048 4096 8192 ext3 \
+ $lvmok{ } lv_name{ var } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /var } label{ var } \
+ options/relatime{ relatime } \
+ . \
+ 512 10240 -1 ext3 \
+ $lvmok{ } lv_name{ srv } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /srv } label{ srv } \
+ options/nodev{ nodev } \
+ options/relatime{ relatime } \
+ options/user_xattr{ user_xattr } \
+ . \
+ 512 768 1024 ext3 \
+ $lvmok{ } lv_name{ tmp } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ /tmp } label{ tmp } \
+ options/nodev{ nodev } \
+ options/relatime{ relatime } \
+ options/user_xattr{ user_xattr } \
+ .
+d-i partman-auto/choose_recipe select madduck
+d-i partman-auto-lvm/no_boot boolean true
+
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
+d-i apt-setup/non-free boolean false
+d-i apt-setup/contrib boolean false
+
+popularity-contest popularity-contest/participate boolean false
+
+tasksel tasksel/first multiselect
+
+#d-i pkgsel/include string openssh-server libterm-readline-gnu-perl
+
+d-i grub-installer/only_debian boolean true
+
+d-i finish-install/reboot_in_progress note
+
+d-i debian-installer/exit/poweroff boolean false
+d-i debian-installer/exit/halt boolean false
+
+d-i preseed/early_command string tar -xf /commands.tar && rm /commands.tar && [ ! -x /commands/early_command ] || log-output -t early_command /commands/early_command
+d-i preseed/late_command string [ ! -x /commands/late_command ] || log-output -t late_command /commands/late_command
--- /dev/null
+#!/bin/sh
+
+set -e
+
+# defaults
+RAM=512
+DISK=20
+QEMU_URI=qemu:///system
+SUITE=wheezy
+CONSOLE='console=tty0 console=ttyS0,115200n8'
+
+while [ -n "$1" ]; do
+ case "$1" in
+ (-n|--name)
+ shift
+ if [ -z "$1" ]; then
+ echo >&2 'E: --name/-n needs hostname argument'
+ exit 1
+ fi
+ HOSTNAME="$1"
+ ;;
+ (-i|--ipaddress)
+ shift
+ if [ -z "$1" ]; then
+ echo >&2 'E: --ipaddress/-i needs IP address/netmask'
+ exit 1
+ fi
+ case "$1" in
+ (*/*) :;;
+ (*)
+ echo >&2 'E: missing netmask'
+ exit 1
+ ;;
+ esac
+ IPADDRESS="$1"
+ ;;
+ (-r|--ram)
+ shift
+ if [ -z "$1" ]; then
+ echo >&2 'E: --ram/-r needs number (megabytes)'
+ exit 1
+ fi
+ RAM="$1"
+ ;;
+ (-s|--size)
+ shift
+ if [ -z "$1" ]; then
+ echo >&2 'E: --size/-s needs size argument'
+ exit 1
+ fi
+ DISK="$1"
+ ;;
+ esac
+ shift
+done
+
+if [ -z "${HOSTNAME:-}" ]; then
+ echo >&2 'E: hostname is required'
+ exit 2
+fi
+
+BASEDIR=$(cd ${0%/*}; pwd)
+
+tmpdir=$(mktemp -d)
+tar -C $BASEDIR/preseed/$SUITE -cf $tmpdir/commands.tar commands
+
+extra_args="auto $CONSOLE \
+hostname=${HOSTNAME%%.*} \
+domain=${HOSTNAME#*.}"
+
+if [ -n "$IPADDRESS" ]; then
+ if [ -z "$GATEWAY" ]; then
+ # default to the first IP in the network
+ GATEWAY=$(ipcalc $IPADDRESS | grep HostMin | awk '{print $2}')
+ fi
+ NETMASK="${IPADDRESS#*/}"
+ IPADDRESS="${IPADDRESS%/*}"
+ : ${NAMESERVER:=$GATEWAY}
+
+ extra_args="$extra_args netcfg/disable_dhcp=true \
+ netcfg/get_ipaddress=$IPADDRESS \
+ netcfg/get_netmask=$NETMASK \
+ netcfg/get_gateway=$GATEWAY \
+ netcfg/get_nameservers=$NAMESERVER"
+
+else
+ extra_args="$extra_args netcfg/disable_dhcp=false"
+fi
+
+cat >&2 <<_eof
+ hostname: $HOSTNAME
+ ram: $RAM MiB
+ disk: $DISK GiB
+ console: $CONSOLE
+_eof
+if [ -n "$IPADDRESS" ]; then
+ cat >&2 <<_eof
+ ipaddress: $IPADDRESS
+ netmask: $NETMASK
+ gateway: $GATEWAY
+nameserver: $NAMESERVER
+_eof
+else
+ cat >&2 <<_eof
+ dhcp: true
+_eof
+fi
+
+exit 0
+
+exec virt-install --connect=$QEMU_URI \
+ -n $HOSTNAME \
+ -r $RAM \
+ --disk pool=default,size=$SIZE \
+ -w bridge=virt-br \
+ --graphics=vnc \
+ --serial=pty \
+ --watchdog i6300esb,action=reset \
+ --os-variant=debian$SUITE \
+ -l $BASEDIR/installer-amd64 \
+ --initrd-inject=$BASEDIR/preseed/$SUITE/preseed.cfg \
+ --initrd-inject=$tmpdir/commands.tar \
+ --extra-args="$extra_args" \
+ --autostart \
+ "$@"