1
0
mirror of https://github.com/rancher/os.git synced 2025-06-21 04:31:55 +00:00
os/scripts/build-vbox-vm

39 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2015-03-09 09:56:22 +00:00
set -x -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}"
2015-04-13 08:44:34 +00:00
sudo chown -R `whoami`:`whoami` ./dist
2015-03-09 09:56:22 +00:00
VBoxManage createhd --format vmdk --filename ./dist/artifacts/$VM.vmdk --size 40000
VBoxManage createvm --name $VM --ostype "Linux_64" --register
2015-03-09 14:34:24 +00:00
VBoxManage storagectl $VM --name "SATA" --add sata --portcount 2
2015-03-09 09:56:22 +00:00
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}
2015-03-09 09:56:22 +00:00
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
2015-03-09 09:56:22 +00:00
VBoxManage modifyvm $VM --nic1 nat
VBoxManage modifyvm $VM --nictype1 virtio
#VBoxManage startvm $VM