Skip to content

Instantly share code, notes, and snippets.

@djbender
Created June 26, 2013 13:36
Show Gist options
  • Save djbender/5867416 to your computer and use it in GitHub Desktop.
Save djbender/5867416 to your computer and use it in GitHub Desktop.
#!/bin/sh
VBM=VBoxManage
VMNAME="smartos2"
VBDIR="/Users/me/Documents/VirtualBox"
DISK=1024 # 1GB
RAM=1024 # 1GB
VRAM=128 # arbitrary
mkdir -p "${VBDIR}/${VMNAME}" && cd "${VBDIR}/${VMNAME}"
[[ -f ${VMNAME}.iso ]] || curl -C - -o "${VMNAME}.iso" https://download.joyent.com/pub/iso/latest.iso
$VBM createvm --name $VMNAME --ostype OpenSolaris_64 --register
$VBM modifyvm $VMNAME --pae off --boot1 dvd --boot2 disk --boot3 none --memory $RAM --vram $VRAM --clipboard disabled --nic1 hostonly --nictype1 82540EM
$VBM createhd --filename "$VMNAME-zones.vdi" --size $DISK
$VBM storagectl $VMNAME --name "SATA Controller" --add sata --controller IntelAHCI
$VBM storagectl $VMNAME --name "IDE Controller" --add ide
$VBM storageattach $VMNAME --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium ${VMNAME}-zones.vdi
$VBM storageattach $VMNAME --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ${VMNAME}.iso --mtype readonly
VirtualBox --startvm $VMNAME &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment