--- VirtualBox-5.1.2/src/VBox/Installer/linux/VBox.sh.orig 2016-07-29 18:45:38.074668094 +0200 +++ VirtualBox-5.1.2/src/VBox/Installer/linux/VBox.sh 2016-07-29 19:23:07.702016897 +0200 @@ -40,6 +40,23 @@ # test -n "${path}" || pwd # done # ) + +show_message() { + local BINFILE=${0##*/} message + + if [ "$DESKTOP" = "kde" ]; then + message=$(cat) + PATH=$(kde4-config --path exe) kdialog --sorry "$message" + elif [ -n "$DISPLAY" ] && [ -x /usr/bin/gxmessage ]; then + gxmessage --center --buttons GTK_STOCK_OK -wrap -geometry 400x150 -name $BINFILE -file - + elif [ -n "$DISPLAY" ] && [ -x /usr/bin/zenity ]; then + message=$(cat) + zenity --error --icon-name=virtualbox --text "$message" + else + cat >&2 + fi +} + if test -f /usr/lib/virtualbox/VirtualBox && test -x /usr/lib/virtualbox/VirtualBox; then @@ -47,7 +64,7 @@ elif test -f "${MY_DIR}/VirtualBox" && test -x "${MY_DIR}/VirtualBox"; then INSTALL_DIR="${MY_DIR}" else - echo "Could not find VirtualBox installation. Please reinstall." + echo "Could not find VirtualBox installation. Please reinstall." | show_message exit 1 fi @@ -57,7 +74,7 @@ if [ "$1" = "shutdown" ]; then SHUTDOWN="true" elif ! lsmod|grep -q vboxdrv; then - cat << EOF + show_message << EOF WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (`uname -r`) or it failed to load. Please recompile the kernel module and install it by @@ -67,7 +84,7 @@ You will not be able to start VMs until this problem is fixed. EOF elif [ ! -c /dev/vboxdrv ]; then - cat << EOF + show_message << EOF WARNING: The character device /dev/vboxdrv does not exist. Try sudo /sbin/vboxconfig @@ -79,7 +96,7 @@ fi if [ -f /etc/vbox/module_not_compiled ]; then - cat << EOF + show_message << EOF WARNING: The compilation of the vboxdrv.ko kernel module failed during the installation for some reason. Starting a VM will not be possible. Please consult the User Manual for build instructions.