#!/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


Revert "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."
Revert "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."

This reverts commit a0e04f5d1bf7f0cb965caea015d180d5da1123fc.
