VirtualBox

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

Last change on this file since 5801 was 5499, checked in by vboxsync, 17 years ago

typo

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