VirtualBox

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

Last change on this file since 8170 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

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