Skip to content

Instantly share code, notes, and snippets.

@pettazz
Created February 19, 2013 21:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pettazz/4990397 to your computer and use it in GitHub Desktop.
Save pettazz/4990397 to your computer and use it in GitHub Desktop.
Updated reset_vms version to use qemu qcows instead of VirtualBox
#!/bin/bash
function reset_vm {
echo "resetting $1..."
cd /home/pettazz/VMs/
if [ -a $1.pid ]
then
echo "killing existing VM pid:"
echo `cat $1.pid`
echo -e "\n"
kill -9 `cat $1.pid`
rm $1.pid
fi
rm $1Active.qcow
cp -v $1Base.qcow $1Active.qcow
kvm -m 2048 -usbdevice tablet -hda $1Active.qcow -vga std -redir tcp:$2::$2 > $1.log &
echo $! > $1.pid
echo -e "done.\n\n\n"
}
reset_vm "Win7ie8" 5555
reset_vm "Win7ie9" 5556
reset_vm "Win7ffchrome" 5557
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment