VirtualBox

Ticket #17639: install_guest_additions.sh

File install_guest_additions.sh, 829 bytes (added by axd, 6 years ago)
Line 
1#!/usr/bin/env bash
2
3# to run from tools/vagrant/
4
5set -x
6set -e
7set -u
8
9GUEST=${1:-"default"} #$1 # name from `vagrant status`
10
11export VERSION=5.2.8 # must be equal to the VirtualBox version!
12export URL="http://download.virtualbox.org/virtualbox/"$VERSION"/VBoxGuestAdditions_"$VERSION".iso"
13
14time vagrant ssh $GUEST << HERE
15
16set -e
17set -x
18
19sudo bash
20
21apt-get update
22
23apt-get install -y dkms build-essential
24#apt-get install -y linux-headers-generic linux-headers-$(uname -r)
25apt-get install -y linux-headers-amd64 linux-headers-4.9.0-4-amd64
26
27apt-get install -y module-assistant
28
29cd /opt/
30
31wget -c $URL -O vb.iso
32mount vb.iso -o loop /mnt
33
34cd /mnt/
35sh ./VBoxLinuxAdditions.run --nox11
36
37cd /opt
38sudo rm *.iso
39
40lsmod | grep vboxguest || echo "*** something went wrong while attempting to install the guest additions"
41
42HERE
43

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy