Skip to content

Instantly share code, notes, and snippets.

@ibuildthecloud
Created March 26, 2015 14:10
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 ibuildthecloud/29c7b22ec55bf61ac3a4 to your computer and use it in GitHub Desktop.
Save ibuildthecloud/29c7b22ec55bf61ac3a4 to your computer and use it in GitHub Desktop.
Build RancherOS VirtualBox VM w/ Autoformat
#!/bin/bash
set -x -e
RANCHER_ISO=machine-rancheros.iso
curl -L https://github.com/rancherio/os/releases/download/v0.2.1/machine-rancheros.iso > $RANCHER_ISO
VM="RancherOS-${RANDOM}"
VBoxManage createhd --format vmdk --filename ./dist/artifacts/$VM.vmdk --size 40000
VBoxManage createvm --name $VM --ostype "Linux_64" --register
VBoxManage storagectl $VM --name "SATA" --add sata --portcount 2
VBoxManage storageattach $VM --storagectl "SATA" --port 0 --type hdd --medium ./dist/artifacts/$VM.vmdk
VBoxManage storageattach $VM --storagectl "SATA" --port 1 --type dvddrive --medium ${RANCHER_ISO}
VBoxManage modifyvm $VM --memory 1024 --acpi on --boot1 disk --boot2 dvd
VBoxManage modifyvm $VM --rtcuseutc on
VBoxManage modifyvm $VM --usb off
VBoxManage modifyvm $VM --audio none
VBoxManage modifyvm $VM --nic1 nat
VBoxManage modifyvm $VM --nictype1 virtio
VBoxManage startvm $VM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment