diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:54 +0000 |
commit | 0494175483c2d82f445ddca9cadb6ee6338e9f9c (patch) | |
tree | 336364dc245983722e34439ece449564e77ca286 /debian/virtualbox.files/VBox.sh | |
parent | Adding upstream version 6.0.4-dfsg. (diff) | |
download | virtualbox-0494175483c2d82f445ddca9cadb6ee6338e9f9c.tar.xz virtualbox-0494175483c2d82f445ddca9cadb6ee6338e9f9c.zip |
Adding debian version 6.0.4-dfsg-7.debian/6.0.4-dfsg-7debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | debian/virtualbox.files/VBox.sh | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/debian/virtualbox.files/VBox.sh b/debian/virtualbox.files/VBox.sh new file mode 100755 index 00000000..88a4a700 --- /dev/null +++ b/debian/virtualbox.files/VBox.sh @@ -0,0 +1,87 @@ +#!/bin/sh +## @file +# Oracle VM VirtualBox startup script, Linux hosts. +# + +# written by Patrick Winnertz <patrick.winnertz@skolelinux.org> and +# Michael Meskes <meskes@debian.org> +# and placed under GPLv2 +# +# this is based on a script by +# Oracle VirtualBox +# +# Copyright (C) 2006-2015 Oracle Corporation +# +# This file is part of VirtualBox Open Source Edition (OSE), as +# available from http://www.virtualbox.org. This file is free software; +# you can redistribute it and/or modify it under the terms of the GNU +# General Public License (GPL) as published by the Free Software +# Foundation, in version 2 as it comes in the "COPYING" file of the +# VirtualBox OSE distribution. VirtualBox OSE is distributed in the +# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# + +PATH="/usr/bin:/bin:/usr/sbin:/sbin" + +# VirtualBox installation directory +INSTALL_DIR="/usr/lib/virtualbox" + +# Note: This script must not fail if the module was not successfully installed +# because the user might not want to run a VM but only change VM params! + +if [ ! -c /dev/vboxdrv ]; then + cat << EOF +WARNING: The character device /dev/vboxdrv does not exist. + Please install the virtualbox-dkms package and the appropriate + headers, most likely linux-headers-$(uname -r | cut -d- -f3). + + You will not be able to start VMs until this problem is fixed. +EOF +fi + +SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'` +if [ -z "$SERVER_PID" ]; then + # Server not running yet/anymore, cleanup socket path. + # See IPC_GetDefaultSocketPath()! + if [ -n "$LOGNAME" ]; then + rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1 + else + rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1 + fi +fi + +APP=`basename $0` +case "$APP" in + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; + VBoxSDL|vboxsdl) + exec "$INSTALL_DIR/VBoxSDL" "$@" + ;; + VBoxVRDP|VBoxHeadless|vboxheadless) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + VBoxAutostart|vboxautostart) + exec "$INSTALL_DIR/VBoxAutostart" "$@" + ;; + VBoxBalloonCtrl|vboxballoonctrl) + exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" + ;; + VBoxBugReport|vboxbugreport) + exec "$INSTALL_DIR/VBoxBugReport" "$@" + ;; + VBoxDTrace|vboxdtrace) + exec "$INSTALL_DIR/VBoxDTrace" "$@" + ;; + vboxwebsrv) + exec "$INSTALL_DIR/vboxwebsrv" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; +esac +exit 0 |