Index: /trunk/src/VBox/Additions/linux/installer/autorun.sh
===================================================================
--- /trunk/src/VBox/Additions/linux/installer/autorun.sh	(revision 36758)
+++ /trunk/src/VBox/Additions/linux/installer/autorun.sh	(revision 36759)
@@ -51,5 +51,5 @@
                 TITLE="VirtualBox Guest Additions installation"
                 BINARY="`quotify "$i"`"
-                exec "$gxtpath" "$gxttitle" "$TITLE" "$gxtexec" "$path/runasroot.sh" --has-terminal "$TITLE" "$BINARY --xwin" "Please try running "\""$i"\"" manually."
+                exec "$gxtpath" "$gxttitle" "$TITLE" "$gxtexec" /bin/sh "$path/runasroot.sh" --has-terminal "$TITLE" "/bin/sh $BINARY --xwin" "Please try running "\""$i"\"" manually."
                 exit
                 ;;
Index: /trunk/src/VBox/Installer/linux/runasroot.sh
===================================================================
--- /trunk/src/VBox/Installer/linux/runasroot.sh	(revision 36758)
+++ /trunk/src/VBox/Installer/linux/runasroot.sh	(revision 36759)
@@ -57,24 +57,34 @@
 esac
 
-case "$DISPLAY" in ?*)
-    KDESUDO="`mywhich kdesudo`"
-    case "$KDESUDO" in ?*)
-        eval "`quotify "$KDESUDO"` --comment `quotify "$DESCRIPTION"` -- $COMMAND"
-        exit
+case "$HAS_TERMINAL" in "")
+    case "$DISPLAY" in ?*)
+        KDESUDO="`mywhich kdesudo`"
+        case "$KDESUDO" in ?*)
+            eval "`quotify "$KDESUDO"` --comment `quotify "$DESCRIPTION"` -- $COMMAND"
+            exit
+            ;;
+        esac
+
+        KDESU="`mywhich kdesu`"
+        case "$KDESU" in ?*)
+            "$KDESU" -c "$COMMAND"
+            exit
+            ;;
+        esac
+
+        GKSU="`mywhich gksu`"
+        case "$GKSU" in ?*)
+            # Older gksu does not grok --description nor '--' and multiple args.
+            # @todo which versions do?
+            # "$GKSU" --description "$DESCRIPTION" -- "$@"
+            # Note that $GKSU_SWITCHES is NOT quoted in the following
+            "$GKSU" $GKSU_SWITCHES "$COMMAND"
+            exit
+            ;;
+        esac
         ;;
-    esac
-
-    GKSU="`mywhich gksu`"
-    case "$GKSU" in ?*)
-        # Older gksu does not grok --description nor '--' and multiple args.
-        # @todo which versions do?
-        # "$GKSU" --description "$DESCRIPTION" -- "$@"
-        # Note that $GKSU_SWITCHES is NOT quoted in the following
-        "$GKSU" $GKSU_SWITCHES "$COMMAND"
-        exit
-        ;;
-    esac
+    esac # $DISPLAY
     ;;
-esac # $DISPLAY
+esac # ! $HAS_TERMINAL
 
 # pkexec may work for ssh console sessions as well if the right agents
@@ -93,4 +103,15 @@
 
 case "$HAS_TERMINAL" in ?*)
+        USE_SUDO=
+        grep Ubuntu /etc/lsb-release && USE_SUDO=true
+        # On Ubuntu we need sudo instead of su.  Assume this works, and is only
+        # needed for Ubuntu until proven wrong.
+        case $USE_SUDO in true)
+            SUDO_COMMAND="`quotify "$SUDO"` -- $COMMAND"
+            eval "$SUDO_COMMAND"
+            exit
+            ;;
+        esac
+
     SU="`mywhich su`"
     case "$SU" in ?*)
