Skip to content

Instantly share code, notes, and snippets.

@rjloura
Last active April 4, 2018 21:55
Show Gist options
  • Save rjloura/b6de8d01c70d57cdcbed6a3b3708d63e to your computer and use it in GitHub Desktop.
Save rjloura/b6de8d01c70d57cdcbed6a3b3708d63e to your computer and use it in GitHub Desktop.
Create COAL on VirtualBox
#!/usr/bin/bash -x
#
# Creating a COAL on VirtualBox. (Still WIP)
#
# This guide assumes you've run "make coal" in your sdc-headnode workspace,
# and copied over the files below from the VMWARE directory to your VBDIR:
# zpool.vmdk
# 4gb.img
# USB-Headnode.vmdk
#
#
# Create VBDIR and copy over your files before running this script.
#
VBDIR=~/VirtualBoxVMs/COAL
VBVM=$VBDIR/COAL.vbox
VBoxManage createvm --name "COAL" --ostype OpenSolaris_64 --register
VBoxManage modifyvm "COAL" \
--memory 8192 \
--boot1 disk --boot2 none --boot3 none --boot4 none \
--chipset ich9 --ioapic on \
--nestedpaging on --pae on --hwvirtex on --cpus 2 \
--audio none --mouse ps2 --usbcardreader off
VBoxManage storagectl "COAL" --add sata
# for MAC:
# VBoxManage storagectl "COAL" --name sata1 --add sata
VBoxManage natnetwork add \
--netname COAL_External \
--dhcp on \
--network 10.88.88.0/24 \
VBoxManage modifyvm "COAL" --nic1 natnetwork --nat-network1 COAL_External
# This probably needs to be hostonly instead with a host address of 10.99.99.254/24
VBoxManage modifyvm "COAL" --nic2 intnet --intnet1 COAL_Admin
VBoxManage modifyvm "COAL" --nicpromisc1 allow-all
VBoxManage modifyvm "COAL" --nicpromisc2 allow-all
VBoxManage modifyvm "COAL" --nictype1 82545EM
VBoxManage modifyvm "COAL" --nictype2 82545EM
VBoxManage convertdd $VBDIR/4gb.img $VBDIR/4g.vdi
VBoxManage storageattach "COAL" --storagectl "sata1" \
--device 0 --port 0 --type hdd --medium ~/VirtualBoxVMs/COAL/4g.vdi
VBoxManage storageattach "COAL" --storagectl "sata1" \
--device 0 --port 1 --type hdd --medium ~/VirtualBoxVMs/COAL/zpool.vmdk
echo "Success. Be sure to enter 'c' at the grub boot line and enter 'variable os_console vga' at the 'grub>' prompt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment