1
0
mirror of https://github.com/rancher/os.git synced 2025-06-21 20:47:04 +00:00

Builds a VirtualBox VM that boots the new ISO and attaches a drive

This commit is contained in:
Bill Maxwell 2015-02-20 14:54:07 -07:00
parent c508994b59
commit d8ab1e0803

35
scripts/build-vbox-vm Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
: RANCHER_ISO=${RANCHER_ISO:="./dist/artifacts/rancheros.iso"}
if [[ -z $RANCHER_ISO ]]; then
echo "Need an ISO..." 1>&2
exit 1
fi
if [ ! -e ${RANCHER_ISO} ]; then
echo "Could not find ISO ${RANCHER_ISO}..." 1>&2
echo "have you run build.sh yet?" 1>&2
exit 1
fi
GITSHA=$(git rev-parse --short HEAD)
VM="RancherOS-${GITSHA}"
VBoxManage createhd --format vhd --filename ./dist/artifacts/$VM.vhd --size 8000
VBoxManage createvm --name $VM --ostype "Linux_64" --register
VBoxManage storagectl $VM --name "IDE Controller" --add ide
VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 \
--type hdd --medium ./dist/artifacts/$VM.vhd
VBoxManage storageattach $VM --storagectl "IDE Controller" --port 1 \
--device 0 --type dvddrive --medium ${RANCHER_ISO}
VBoxManage modifyvm $VM --memory 1024 --acpi on --boot1 dvd --boot2 disk
VBoxManage modifyvm $VM --usb off
VBoxManage modifyvm $VM --audio none
VBoxManage startvm $VM