Created
June 3, 2020 21:01
-
-
Save TomSchober/987f2ffbe92f4b0d4279091d98bf667a to your computer and use it in GitHub Desktop.
OpenSpace Test Virtual Machine Ubuntu
This file contains 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
# Prerequisite: Ubuntu 18.04.4 Desktop (minimal installation with VirtualBox Guest Additions) | |
# Dependencies | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y \ | |
build-essential software-properties-common \ | |
gcc-8 g++-8 cmake \ | |
glew-utils freeglut3-dev libsoil1 \ | |
libxrandr-dev libxinerama-dev xorg-dev libcurl4-openssl-dev libgdal-dev libxcursor-dev \ | |
libglm-dev \ | |
vim git | |
# Build | |
openSpaceHome="$HOME/OpenSpace" | |
git clone --recursive --branch linux https://github.com/OpenSpace/OpenSpace "$openSpaceHome" | |
mkdir "$openSpaceHome/build" | |
cd "$openSpaceHome/build" || exit | |
cmake \ | |
-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-8 \ | |
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-8 \ | |
-DCMAKE_CXX_FLAGS:STRING="-std=gnu++17 -DGLM_ENABLE_EXPERIMENTAL" \ | |
-DOpenGL_GL_PREFERENCE:STRING=GLVND "$openSpaceHome" | |
make |
This file contains 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
# Prerequisite: VirtualBox >= 6.1.6 with extension pack | |
# Example: ./vboxSetup.sh "OpenSpace DEV1" "/home/user/Downloads" | |
vmName="$1" | |
downloadDir="$2" | |
downloadUrl="https://releases.ubuntu.com/18.04.4/ubuntu-18.04.4-desktop-amd64.iso" | |
downloadTarget="${downloadDir}/ubuntu-18.04.4-desktop-amd64.iso" | |
checksum=c0d025e560d54434a925b3707f8686a7f588c42a5fbc609b8ea2447f88847041 | |
if [[ ! -f "${downloadTarget}" ]]; then | |
wget "${downloadUrl}" -O "${downloadTarget}" | |
fi | |
echo "Checking ISO..." | |
if [ ! -f "${downloadTarget}" ]; | |
then | |
error "File $downloadTarget doesn't exist" | |
elif [ ! "$(sha256sum "$downloadTarget" | head -c 64)" = "$checksum" ]; then | |
echo "Checksum failed" >&2 | |
exit 1 | |
fi | |
vboxmanage createvm --name "${vmName}" --register | |
vboxmanage modifyvm "${vmName}" \ | |
--ostype Ubuntu --memory 8192 \ | |
--cpus 4 --memory 16384 --vram 128 \ | |
--accelerate3d on --graphicscontroller vmsvga --audio alsa --audiocontroller ac97 \ | |
--nic1 bridged --bridgeadapter1 enp8s0 --nictype1 82545EM --cableconnected1 on \ | |
--clipboard-mode bidirectional --draganddrop bidirectional | |
vboxmanage createhd --filename "$HOME/VirtualBox VMs/$vmName/$vmName.vdi" --size 51200 --format VDI | |
vboxmanage storagectl "${vmName}" --name SATA --add sata --controller IntelAhci --bootable on | |
vboxmanage storageattach "${vmName}" --storagectl SATA --port 0 --device 0 --type hdd --medium "$HOME/VirtualBox VMs/$vmName/$vmName.vdi" | |
vboxmanage storagectl "${vmName}" --name IDE --add ide --controller PIIX4 --bootable on | |
vboxmanage storageattach "${vmName}" --storagectl IDE --port 1 --device 0 --type dvddrive --medium ${downloadTarget} | |
vboxmanage sharedfolder add "${vmName}" --name source --hostpath "${HOME}/source" --automount | |
vboxmanage startvm "${vmName}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment