Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Virtualbox 5.2 on scaleway
# this is a copay/paste combination of &
# so that we can install virtualbox via apt-get
for x in xenial xenial-security xenial-updates; do
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src ${x} main universe" | sudo tee -a /etc/apt/sources.list
echo "deb xenial contrib" | sudo tee -a /etc/apt/sources.list.d/virtualbox.list
wget -q -O- | sudo apt-key add -
# allow us to make a kernel
apt-get install unzip build-essential libssl-dev -y
arch="$(uname -m)"
release="$(uname -r)"
echo $release
echo $local
echo $upstream
mkdir -p /usr/src
wget -O "/usr/src/linux-${upstream}.tar.xz" "${upstream}.tar.xz"
tar xf "/usr/src/linux-${upstream}.tar.xz" -C /usr/src/
ln -fns "/usr/src/linux-${upstream}" /usr/src/linux
ln -fns "/usr/src/linux-${upstream}" "/lib/modules/${release}/build"
zcat /proc/config.gz > /usr/src/linux/.config
printf 'CONFIG_LOCALVERSION="%s"\nCONFIG_CROSS_COMPILE=""\n' "${local:+-$local}" >> /usr/src/linux/.config
wget -O /usr/src/linux/Module.symvers "${arch}/${release}/Module.symvers"
# make kernel (no idea why? but anyway)
NUM_CORES=$(cat /proc/cpuinfo|grep vendor_id|wc -l)
make -j${NUM_CORES} -C /usr/src/linux prepare modules_prepare
KDIR=/lib/modules/$(uname -r)/build/
# install virtualbox (which also does some kernel stuff)
apt-get install dkms virtualbox-5.2 -y
/sbin/rcvboxdrv setup
VBoxManage --version
VBoxManage extpack install ./Oracle_VM_VirtualBox_Extension_Pack-5.2.0-118431.vbox-extpack
# install a windows guest, as of
mkdir -p ~/vm/ie9-windows7 && cd ~/vm/ie9-windows7
wget -ci
cat >
rm ie9-windows7.txt
VBoxManage import IE9\ -\ Win7.ova
# enable remote desktop so that we can connect to windows via a rdc app
VBoxManage modifyvm "IE9 - Win7" --vrde on
VBoxManage modifyvm "IE9 - Win7" --memory 4096 --cpus ${NUM_CORES} --accelerate2dvideo on --accelerate3d off --cpuhotplug on
VBoxManage startvm "IE9 - Win7" --type=headless
VBoxManage controlvm "IE9 - Win7" acpipowerbutton
# mound guest additions to guest
vboxmanage storageattach "IE9 - Win7" --storagectl "IDE" --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment