mirror of
https://github.com/rancher/os.git
synced 2025-06-22 04:57:04 +00:00
36 lines
1017 B
Bash
Executable File
36 lines
1017 B
Bash
Executable File
#!/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
|