#!/bin/bash

if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root"
    exit 1
fi

echo "Installing vbox guest additions"
apt-get install build-essential module-assistant &&
m-a prepare &&
mount /media/cdrom &&
sh /media/cdrom/VBoxLinuxAdditions.run


#!/bin/bash

if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root"
    exit 1
fi

echo "Installing vbox guest additions"
apt-get install build-essential module-assistant &&
m-a prepare &&
mount /media/cdrom
sh /media/cdrom/VBoxLinuxAdditions.run


Remove restriction to succesfully mount guest additions. Some desktops (ex. gnome) will mount disk when it's inserted so additional mount will fail with error 'already mounted' and whole process won't succed despite it still can.
Remove restriction to succesfully mount guest additions. Some desktops (ex. gnome) will mount disk when it's inserted so additional mount will fail with error 'already mounted' and whole process won't succed despite it still can.
