1 # $1: The new package version
4 /etc/rc.d/vboxdrv setup
6 # Add vboxusers group, GID 108 is reserved (http://wiki.archlinux.org/index.php/UID_and_GID_list),
7 # but in some systems it may be being used - please replace if needed.
8 groupadd -f -g 108 vboxusers
10 # Create the directory below if it doesn't exist
11 mkdir -p "/var/run/VirtualBox"
13 # Load new udev rule for module vboxdrv
14 udevadm control --reload-rules
18 echo '==> You must agree to the following license in order to use this program:' >&2
19 echo '------------------------------------------------------------------------' >&2
21 cat "/opt/VirtualBox/LICENSE" >&2
23 echo '------------------------------------------------------------------------' >&2
27 ==> Add your user to the vboxusers group:
28 ==> # gpasswd -a USERNAME vboxusers
30 ==> You must load vboxdrv module before starting VirtualBox:
31 ==> # modprobe vboxdrv
33 ==> You must load vboxnetflt for Host Interface Networking:
34 ==> # modprobe vboxnetflt
36 ==> You must load vboxnetadp for Host-Only networking:
37 ==> # modprobe vboxnetadp
39 ==> To load it automatically, add vboxdrv module to the "MODULES" array
42 ==> Run \`/etc/rc.d/vboxdrv setup\` as root every time your kernel is
43 ==> upgraded, to compile the module for the new kernel version.
45 ==> If USB does not work for you out-of-the-box, add the following line
47 ==> "none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0"
52 # $1: The new package version
53 # $2: The old package version
55 _NEWVERSION=`echo $1 | cut -f-1 -d '-'`
56 _OLDVERSION=`echo $2 | cut -f-1 -d '-'`
58 # Remove any stuff (e.g. module compilation files) from an old installation - old versions used
59 # to use these directories.
60 if [ "$_NEWVERSION" != "$_OLDVERSION" ]; then
61 rm -Rf "/opt/VirtualBox-${_OLDVERSION}" &> /dev/null
63 if [ "$1" != "$2" ]; then
64 rm -Rf "/opt/virtualbox" &> /dev/null
68 /etc/rc.d/vboxdrv setup
70 # Create the directory below if it doesn't exist
71 mkdir -p "/var/run/VirtualBox"
75 ==> You must load vboxdrv module before starting VirtualBox:
76 ==> # modprobe vboxdrv
78 ==> You must load vboxnetflt for Host Interface Networking:
79 ==> # modprobe vboxnetflt
81 ==> You must load vboxnetadp for Host-Only networking:
82 ==> # modprobe vboxnetadp
84 ==> To load it automatically, add vboxdrv module to the "MODULES" array
87 ==> Run \`/etc/rc.d/vboxdrv setup\` as root every time your kernel is
88 ==> upgraded, to compile the module for the new kernel version.
90 ==> If USB does not work for you out-of-the-box, add the following line
92 ==> "none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0"
96 if [ "`vercmp $_OLDVERSION 3.2.2`" -lt 0 ]; then
98 ==> IMPORTANT: This package now uses \`/etc/rc.d/vboxdrv setup\` instead
99 ==> of the old "vbox_build_module" script.
105 # $1: The old package version
107 # Unload modules (if any)
108 for _mod in vbox{drv,netadp,netflt}; do
109 modprobe -r $_mod &> /dev/null
112 # Remove the module files
113 rm -f "/lib/modules/`uname -r`/misc/"{vboxdrv,vboxnetadp,vboxnetflt}.ko
115 # Remove any stuff remaining from the module compilation
116 rm -Rf "/opt/VirtualBox"