Forked from nictuku/scaleway-virtualbox-module-build.sh
Last active
February 1, 2019 04:13
-
-
Save intika/5f2436135f8dd28e8490540ff2a63e38 to your computer and use it in GitHub Desktop.
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 | |
# Expects Ubuntu 16.06 (xenial) and kernel 4.x. | |
# Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191 | |
set -eux | |
# Have the user call sudo early so the credentials is valid later on | |
sudo whoami | |
for x in xenial xenial-security xenial-updates; do | |
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src http://archive.ubuntu.com/ubuntu ${x} main universe" | sudo tee -a /etc/apt/sources.list | |
done | |
wget https://www.virtualbox.org/download/oracle_vbox_2016.asc | |
wget https://www.virtualbox.org/download/oracle_vbox.asc | |
sudo apt-key add oracle_vbox_2016.asc | |
sudo apt-key add oracle_vbox.asc | |
sudo apt-get clean | |
sudo apt update | |
sudo apt-get install software-properties-common python-software-properties -y | |
sudo apt-get install python3-software-properties -y | |
sudo apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | |
sudo apt-get clean | |
sudo apt update | |
sudo apt-get install gnome-core -y | |
#sudo apt-get install xserver-xorg-core | |
#sudo apt-get install xserver-xorg | |
#sudo apt-get install xorg | |
#sudo apt-get install xorg openbox | |
#sudo apt-get install ubuntu-desktop | |
sudo apt-get install vnc4server -y | |
sudo apt-get install openssl -y | |
sudo apt-get install unzip -y | |
sudo apt-get install libssl-dev -y | |
sudo apt-get update --fix-missing | |
sudo apt-get install dkms virtualbox-5.1 -y | |
KERN_VERSION=$(uname -r |cut -d'-' -f1) | |
EXTENDED_VERSION=$(uname -r |cut -d'-' -f2-) | |
cd /var/tmp | |
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERN_VERSION}.tar.xz | |
tar xf linux-${KERN_VERSION}.tar.xz -C /var/tmp/ | |
export KERN_DIR="/var/tmp/linux-${KERN_VERSION}" | |
cd "${KERN_DIR}" | |
zcat /proc/config.gz > .config | |
# Fetch the tools necessary to build the kernel. Using generic because there may not be a package for our $KERN_VERSION. | |
sudo apt-get build-dep linux-image-generic -y | |
NUM_CORES=$(cat /proc/cpuinfo|grep vendor_id|wc -l) | |
# Two options here: full kernel build, which gives no warnings later. Or this partial build: | |
# make -j${NUM_CORES} oldconfig include modules | |
# If you do the partial build, the vboxdrv setup step below will fail and can be fixed with a "sudo modprobe -f vboxdrv" | |
# Since that's annoying, I'm leaving the full build by default. | |
make -j${NUM_CORES} | |
sudo -E /sbin/rcvboxdrv setup | |
VBoxManage --version | |
VBOXVERSION=`VBoxManage --version | sed -r 's/([0-9])\.([0-9])\.([0-9]{1,2}).*/\1.\2.\3/'` | |
wget -q -N "http://download.virtualbox.org/virtualbox/$VBOXVERSION/Oracle_VM_VirtualBox_Extension_Pack-$VBOXVERSION.vbox-extpack" | |
VBoxManage extpack install --replace Oracle*.vbox-extpack | |
vncserver | |
vncserver -kill :1 | |
#wget https://az412801.vo.msecnd.net/vhd/VMBuild_20141027/VirtualBox/IE11/Windows/IE11.Win7.For.Windows.VirtualBox.zip | |
#wget https://az792536.vo.msecnd.net/vms/VMBuild_20160802/VirtualBox/MSEdge/MSEdge.Win10_RS1.VirtualBox.zip |
add vnc + x + virtualbox ext pack
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated dependency and update to virtualbox 5.1