#!/bin/bash # Script creates a ttylinux Virtual Machine if [ -z "$1" ]; then echo Virtual Machine name required exit 1 fi VM=$1 # Exit if the VM already exists if VBoxManage list vms|grep -q "^Name:.*$VM\$" then echo $VM already exists, choose another name exit 1 fi # This is the template GUESTOS=Linux HDSIZE=16 RAMSIZE=64 # in megabytes VRAMSIZE=16 # in megabytes NICMODE=nat DISTRO_ISO=$HOME/Desktop/Distros/ttylinux/bootcd-i486-8.0.iso # create the VM VBoxManage createvm -name $VM -register || exit 1 # create the harddisk VBoxManage createhd -filename $VM.vdi \ -size $HDSIZE \ -format VDI \ -register || exit 1 echo $VM virtual hard disk created # configure the VM VBoxManage modifyvm $VM \ -ostype $GUESTOS \ -memory $RAMSIZE \ -vram $VRAMSIZE \ -audio alsa \ -audiocontroller ac97 \ -dvd $DISTRO_ISO \ -nic1 $NICMODE \ -boot1 dvd \ -boot2 disk \ -hda $VM.vdi \ -uart1 0x358 4 \ -uartmode1 server /tmp/$VM-pipe || exit 1 echo $VM virtual machine configured, ready to install echo Press enter to start VM... read VBoxManage startvm $VM