Quick Qemu

From GSLUG

Jump to: navigation, search

This script runs Qemu with a lot of useful bells and whistles. Needs a lot of describing that I need to do upon request.

lan="-net nic,vlan=0 -net tap,vlan=0,ifname=tap2,script=./qemu-ifup"

#HDIMG=/home/jvoss/recent/emu/g-emu3a.img
CDIMG=~/os/KNOPPIX_V5.1.1CD-2007-01-04-EN/KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
#  -nographic
add="$lan -m 64"

qemu -serial pty $add -cdrom $CDIMG $HDIMG

The necessary ifup command.

#!/bin/sh

# qemu-ifup
# From mitra et al.

echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /sbin/brctl addif br0 $1
sleep 2

FreeBSD AMD64 headless on a server using KVM.

lan="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup"
add="$lan -serial pty"

/usr/local/bin/qemu-system-x86_64 $add -hda freebsd-6.2-dedication.cow
Personal tools
Linux