VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/VBox.sh@ 3899

Last change on this file since 3899 was 3845, checked in by vboxsync, 18 years ago

export again

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1#!/bin/sh
2#
3# innotek VirtualBox
4#
5# Copyright (C) 2006-2007 innotek GmbH
6#
7# Use only with permission
8#
9
10PATH="/usr/bin:/bin:/usr/sbin:/sbin"
11CONFIG="/etc/vbox/vbox.cfg"
12
13if [ ! -r "$CONFIG" ]; then
14 echo "Could not find VirtualBox installation. Please reinstall."
15 exit 1
16fi
17
18. "$CONFIG"
19
20# Note: This script must not fail if the module was not successfully installed
21# because the user might not want to run a VM but only change VM params!
22
23if [ "$1" = "shutdown" ]; then
24 SHUTDOWN="true"
25elif ! lsmod|grep -q vboxdrv; then
26 cat << EOF
27WARNING: The vboxdrv kernel module is not loaded. Either there is no module
28 available for the current kernel (`uname -r`) or it failed to
29 load. Please recompile the kernel module and install it by
30
31 sudo /etc/init.d/vboxdrv setup
32
33 You will not be able to start VMs until this problem is fixed.
34EOF
35elif [ ! -c /dev/vboxdrv ]; then
36 cat << EOF
37WARNING: The character device /dev/vboxdrv does not exist. Try
38
39 sudo /etc/init.d/virtualbox restart
40
41 and if that is not successful, try to re-install the package.
42
43 You will not be able to start VMs until this problem is fixed.
44EOF
45elif [ ! -w /dev/vboxdrv ]; then
46 if [ "`id | grep vboxusers`" = "" ]; then
47 cat << EOF
48WARNING: You are not a member of the "vboxusers" group. Please add yourself
49 to this group before starting VirtualBox.
50
51 You will not be able to start VMs until this problem is fixed.
52EOF
53 else
54 cat << EOF
55WARNING: /dev/vboxdrv not writable for some reason. If you recently added the
56 current user to the vboxusers group then you have to logout and
57 re-login to take the change effect.
58
59 You will not be able to start VMs until this problem is fixed.
60EOF
61 fi
62fi
63
64if [ -f /etc/vbox/module_not_compiled ]; then
65 cat << EOF
66WARNING: The compilation of the vboxdrv.ko kernel module failed during the
67 installation for some reason. Starting a VM will not be possible.
68 Please consult the User Manual for build instructions.
69EOF
70fi
71
72export LD_LIBRARY_PATH="$INSTALL_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
73
74SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
75if [ -z "$SERVER_PID" ]; then
76 # Server not running yet/anymore, cleanup socket path.
77 # See IPC_GetDefaultSocketPath()!
78 if [ -n "$LOGNAME" ]; then
79 rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
80 else
81 rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
82 fi
83fi
84
85if [ "$SHUTDOWN" = "true" ]; then
86 if [ -n "$SERVER_PID" ]; then
87 kill -TERM $SERVER_PID
88 sleep 2
89 fi
90 exit 0
91fi
92
93APP=`which $0`
94APP=${APP##/*/}
95case "$APP" in
96 VirtualBox)
97 exec "$INSTALL_DIR/VirtualBox" "$@"
98 ;;
99 VBoxManage)
100 exec "$INSTALL_DIR/VBoxManage" "$@"
101 ;;
102 VBoxSDL)
103 exec "$INSTALL_DIR/VBoxSDL" "$@"
104 ;;
105 VBoxVRDP)
106 exec "$INSTALL_DIR/VBoxVRDP" "$@"
107 ;;
108 *)
109 echo "Unknown application - $APP"
110 ;;
111esac
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette