VirtualBox

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

Last change on this file since 7108 was 6512, checked in by vboxsync, 17 years ago

added vboxwebsrv to all Linux packages

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