Created
December 18, 2013 23:06
-
-
Save ghoulmann/8031448 to your computer and use it in GitHub Desktop.
Downloads SteamOS.zip, creates ISO, installs virtualbox 4.2 & dkms, and creates virtual machine for user with boot ISO attached and EFI enabled. Requires: Ubuntu, internet, sudo access...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
#Set up customizeable variables | |
VM='SteamOS' #the name of the vm | |
TRASH="/tmp" #where to dump the zip and decompressed folder | |
ISO="steamos-1.0-uefi-amd64.iso" #what to call the iso | |
PUT="/tmp" #where to put the iso | |
VDI=$(pwd) #where to put the virtual drive | |
#Install FunctionL allows noninteractive install with apt | |
install () | |
{ | |
sudo apt-get update | |
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \ | |
-o DPkg::Options::=--force-confdef \ | |
-o DPkg::Options::=--force-confold \ | |
install $@ | |
} | |
#DEALING WITH STEAM | |
if [ ! -f "$TRASH/steamos.zip" ] | |
then | |
wget http://repo.steampowered.com/download/SteamOSInstaller.zip -O $TRASH/steamos.zip #Download SteamOS from the Web | |
fi | |
#decompress downloaded file to a folder called steamos/ | |
if [ ! -d "$TRASH/steamos" ] | |
then | |
unzip -d "$TRASH/steamos/" "$TRASH/steamos.zip" | |
fi | |
#create a virtual DVD based on the download - intended for USB drive by Steam | |
if [ ! -f "$TRASH/$ISO" ] | |
then | |
genisoimage -o "$PUT/$ISO" -r -J "$TRASH/steamos/" | |
fi | |
#VIRTUALBOX ENVIRONMENT | |
#Add source for VBox Software | |
sudo -s <<EOF | |
apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian saucy contrib" | |
#for security - digital signature for the software | |
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add - | |
EOF | |
#Install from Apt | |
install virtualbox-guest-additions-iso dkms | |
#VIRTUALBOX VM CREATION AND CONFIGURATION | |
VBoxManage createhd --filename $VM.vdi --size 40000 | |
VBoxManage createvm --name $VM --ostype "Debian_64" --register | |
VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI | |
VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$VDI/$VM.vdi" | |
VBoxManage storagectl $VM --name "IDE Controller" --add ide | |
VBoxManage storageattach $VM --storagectl "IDE Controller" --device 0 --port 0 --type dvddrive --medium "$TRASH/$ISO" | |
VBoxManage modifyvm $VM --boot1 dvd --boot2 disk | |
VBoxManage modifyvm $VM --memory 2048 --vram 128 | |
VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 eth0 | |
VBoxManage modifyvm $VM --ioapic on | |
VBoxManage modifyvm $VM --cpus 2 | |
VBoxManage modifyvm $VM --firmware efi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SteamOS VirtualBox Creator