Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
debian/virtualbox-add-machine.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
40 lines (24 sloc)
1.15 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add new debian machine to VirtualBox | |
set -e | |
TMP=$HOME/tmp | |
DEBIANVERSION=8.2.0 | |
DEBIANARCH=i386 | |
ISO=$TMP/debian-$DEBIANVERSION-$DEBIANARCH-netinst.iso | |
VMDIR=$TMP/virtual-box | |
RAM=2048 | |
HDD=20000 | |
[ -d $VMDIR ] || mkdir -p $VMDIR | |
[ -f $ISO ] || wget -O $ISO http://cdimage.debian.org/debian-cd/$DEBIANVERSION/$DEBIANARCH/iso-cd/debian-$DEBIANVERSION-$DEBIANARCH-netinst.iso | |
[ -z "$1" ] && ID="debian-$RANDOM" || ID=$1 | |
vboxmanage createvm --name $ID --ostype Debian --register | |
vboxmanage modifyvm $ID --memory $RAM | |
vboxmanage modifyvm $ID --bridgeadapter1 eth0 | |
vboxmanage modifyvm $ID --nic1 bridged | |
vboxmanage createhd --filename $VMDIR/$ID.vdi --size $HDD --format VDI | |
vboxmanage storagectl $ID --name "SATA Controller" --add sata --controller IntelAhci | |
vboxmanage storageattach $ID --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium $VMDIR/$ID.vdi | |
vboxmanage storagectl $ID --name "IDE Controller" --add ide --controller PIIX4 | |
vboxmanage storageattach $ID --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium $ISO | |
vboxmanage modifyvm $ID --vrdemulticon on --vrdeport 3390 | |
vboxmanage modifyvm $ID --vram 16 |