4 >>> - Run "sudo /etc/rc.d/vboxdrv setup", every time your kernel is upgraded,
5 >>> to compile virtualbox driver modules for a new kernel version.
6 >>> - Add your users to the vboxusers group:
7 >>> gpasswd -a USERNAME vboxusers
8 >>> - Customize your "/etc/conf.d/vboxdrv"; usually, defaults are OK.
9 >>> - Add "vboxdrv" to DAEMONS array in your "/etc/rc.conf", if needed.
10 >>> - If USB does not work for you out-of-the-box, add the following line
11 >>> to your "/etc/fstab":
12 none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0
17 # Unload stale modules
18 /etc/rc.d/vboxdrv stop
21 /etc/rc.d/vboxdrv setup
23 # Add group 'vboxusers'
25 # This GID is reserved (http://wiki.archlinux.org/index.php/UID_and_GID_list)
26 # But in some systems it may be being used. Please replace if needed
27 groupadd -f -g 108 vboxusers
30 mkdir -p /var/run/VirtualBox
32 # Load new udev rule for module vboxdrv
33 udevadm control --reload-rules
36 echo '---------------------------------------------------------------------------' >&2
37 echo ' You must agree to the following license in order to use this program:' >&2
39 cat /opt/VirtualBox/LICENSE >&2
41 echo '---------------------------------------------------------------------------' >&2
43 # Load newly build modules
44 /etc/rc.d/vboxdrv start
50 # $1: The new package version
51 # $2: The old package version
53 _NEWVERSION=`echo $1 | cut -f-1 -d '-'`
54 _OLDVERSION=`echo $2 | cut -f-1 -d '-'`
56 # Remove stale stuff (eg. module compilation files) from an existing and, or
57 # old installation. Old versions used to use these directories
58 if [ "$_NEWVERSION" != "$_OLDVERSION" ]; then
59 rm -Rf "/opt/VirtualBox-${_OLDVERSION}" &>/dev/null
61 if [ "$1" != "$2" ]; then
62 # Unload stale modules
63 /etc/rc.d/vboxdrv stop
66 if which dkms >/dev/null; then
67 dkms add -m vboxhost -v $VBOX_VERSION >/dev/null 2>&1
69 /etc/rc.d/vboxdrv setup
72 # Load newly build modules
73 /etc/rc.d/vboxdrv start
78 mkdir -p /var/run/VirtualBox
85 # Unload stale modules
86 /etc/rc.d/vboxdrv stop
88 # Remove the module files
89 if which dkms >/dev/null; then
91 dkms remove -m vboxhost -v $VBOX_VERSION --all
93 rm -f /lib/modules/`uname -r`/misc/{vboxdrv,vboxnetadp,vboxnetflt}.ko
98 # Remove stuff remaining from the module compilation
99 rm -Rf /opt/VirtualBox
101 # Remove unwanted directory
102 rm -Rf /var/run/VirtualBox