Index: trunk/src/VBox/Installer/solaris/Makefile.kmk
===================================================================
--- trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 17060)
+++ trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 17068)
@@ -126,6 +126,7 @@
 	$(if $(VBOX_WITH_QTGUI),VirtualBox,) \
 	VBoxManage \
-	$(if $(VBOX_WITH_VBOXBFE),VBoxBFE) \
+	$(if $(VBOX_WITH_VBOXBFE),VBoxBFE,) \
 	$(if $(VBOX_WITH_VBOXSDL),VBoxSDL,) \
+	$(if $(VBOX_WITH_USB),VBoxUSBHelper,) \
 	VBoxSVC \
 	VBoxXPCOMIPCD \
@@ -135,5 +136,6 @@
 SOLARIS_STRIP_BINS = \
 	vboxdrv \
-	$(if $(VBOX_WITH_NETFLT),vboxflt) \
+	$(if $(VBOX_WITH_NETFLT),vboxflt,) \
+	$(if $(VBOX_WITH_USB),vboxusb,) \
 	VBoxDD.so \
 	VBoxDD2.so \
@@ -163,5 +165,5 @@
 ifdef VBOX_WITH_HARDENING
 SOLARIS_STRIP_BINS += \
-	$(if $(VBOX_WITH_VBOXBFE),VBoxBFE.so) \
+	$(if $(VBOX_WITH_VBOXBFE),VBoxBFE.so,) \
 	$(if $(VBOX_WITH_VBOXSDL),VBoxSDL.so,) \
 	$(if $(VBOX_WITH_QTGUI),VirtualBox.so,)
@@ -200,5 +202,6 @@
 	autoresponse \
 	vboxdrv.conf \
-	$(if $(VBOX_WITH_NETFLT),vboxflt.conf) \
+	$(if $(VBOX_WITH_NETFLT),vboxflt.conf,) \
+	$(if $(VBOX_WITH_USB),vboxusb.conf,) \
 	vboxdrv.sh \
 	VBox.sh \
@@ -377,5 +380,6 @@
 		$(if $(and $(VBOX_LICENSE_BINS),$(VBOX_WITH_QTGUI)),$(VBOX_LICENSE_BINS),) \
 		$(PATH_ROOT)/src/VBox/HostDrivers/Support/solaris/vboxdrv.conf \
-		$(if $(VBOX_WITH_NETFLT),$(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/solaris/vboxflt.conf) \
+		$(if $(VBOX_WITH_NETFLT),$(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/solaris/vboxflt.conf,) \
+		$(if $(VBOX_WITH_USB),$(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/solaris/vboxusb.conf,) \
 		$(if $(not $(VBOX_WITH_NETFLT))$(PATH_ROOT)/src/VBox/Devices/Network/solaris/vnicinit_solaris.sh,) \
 		$(if $(not $(VBOX_WITH_NETFLT))$(PATH_ROOT)/src/VBox/Devices/Network/solaris/vnicterm_solaris.sh,) \
@@ -398,5 +402,6 @@
 		$(VBOX_PATH_SOL_INST_SRC)/vbox.pkginfo
 	$(QUIET)$(INSTALL) -m 0644 $(PATH_ROOT)/src/VBox/HostDrivers/Support/solaris/vboxdrv.conf               $(SOLARIS_INST_DIR)/vboxdrv.conf
-	$(QUIET)$(INSTALL) -m 0644 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/solaris/vboxflt.conf            $(SOLARIS_INST_DIR)/vboxflt.conf
+	$(QUIET)$(if $(VBOX_WITH_NETFLT),$(INSTALL) -m 0644 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/solaris/vboxflt.conf         $(SOLARIS_INST_DIR)/vboxflt.conf,)
+	$(QUIET)$(if $(VBOX_WITH_USB),$(INSTALL) -m 0644 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/solaris/vboxusb.conf               $(SOLARIS_INST_DIR)/vboxusb.conf,)
 	$(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(PATH_BIN)/LICENSE                                        $(SOLARIS_INST_DIR)/LICENSE)
 	$(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(PATH_BIN)/LICENSE                                        $(SOLARIS_INST_DIR)/vbox.copyright)
Index: trunk/src/VBox/Installer/solaris/makepackage.sh
===================================================================
--- trunk/src/VBox/Installer/solaris/makepackage.sh	(revision 17060)
+++ trunk/src/VBox/Installer/solaris/makepackage.sh	(revision 17068)
@@ -134,9 +134,16 @@
 filelist_fixup prototype '$3 == "opt/VirtualBox/amd64/vboxdrv=amd64/vboxdrv"'                           '$3 = "platform/i86pc/kernel/drv/amd64/vboxdrv=amd64/vboxdrv"; $6 = "sys"'
 
+# NetFilter vboxflt
 filelist_fixup prototype '$3 == "opt/VirtualBox/i386/vboxflt=i386/vboxflt"'                             '$3 = "platform/i86pc/kernel/drv/vboxflt=i386/vboxflt"; $6 = "sys"'
 filelist_fixup prototype '$3 == "opt/VirtualBox/amd64/vboxflt=amd64/vboxflt"'                           '$3 = "platform/i86pc/kernel/drv/amd64/vboxflt=amd64/vboxflt"; $6 = "sys"'
 
+# USB vboxusb
+filelist_fixup prototype '$3 == "opt/VirtualBox/i386/vboxusb=i386/vboxusb"'                             '$3 = "platform/i86pc/kernel/drv/vboxusb=i386/vboxusb"; $6 = "sys"'
+filelist_fixup prototype '$3 == "opt/VirtualBox/amd64/vboxusb=amd64/vboxusb"'                           '$3 = "platform/i86pc/kernel/drv/amd64/vboxusb=amd64/vboxusb"; $6 = "sys"'
+
+# All the driver conf files
 filelist_fixup prototype '$3 == "opt/VirtualBox/vboxdrv.conf=vboxdrv.conf"'                             '$3 = "platform/i86pc/kernel/drv/vboxdrv.conf=vboxdrv.conf"'
 filelist_fixup prototype '$3 == "opt/VirtualBox/vboxflt.conf=vboxflt.conf"'                             '$3 = "platform/i86pc/kernel/drv/vboxflt.conf=vboxflt.conf"'
+filelist_fixup prototype '$3 == "opt/VirtualBox/vboxusb.conf=vboxusb.conf"'                             '$3 = "platform/i86pc/kernel/drv/vboxusb.conf=vboxusb.conf"'
 
 # hardening requires some executables to be marked setuid.
@@ -158,4 +165,14 @@
 fi
 
+# VBoxUSBHelper needs to be marked setuid.
+if test -f $VBOX_INSTALLED_DIR/amd64/VBoxUSBHelper || test -f $VBOX_INSTALLED_DIR/i386/VBoxUSBHelper; then
+    $VBOX_AWK 'NF == 6 \
+        && (    $3 == "opt/VirtualBox/amd64/VBoxUSBHelper=amd64/VBoxUSBHelper" \
+            ||  $3 == "opt/VirtualBox/i386/VBoxUSBHelper=i386/VBoxUSBHelper" \
+            ) \
+       { $4 = "4755" } { print }' prototype > prototype2
+    mv -f prototype2 prototype        
+fi
+
 # desktop links and icons
 filelist_fixup prototype '$3 == "opt/VirtualBox/virtualbox.desktop=virtualbox.desktop"'                 '$3 = "usr/share/applications/virtualbox.desktop=virtualbox.desktop"'
Index: trunk/src/VBox/Installer/solaris/postinstall.sh
===================================================================
--- trunk/src/VBox/Installer/solaris/postinstall.sh	(revision 17060)
+++ trunk/src/VBox/Installer/solaris/postinstall.sh	(revision 17068)
@@ -39,5 +39,16 @@
             if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
                 /opt/VirtualBox/vboxdrv.sh fltstart
-                rc=$?            
+                rc=$?
+            fi
+            if test -f /platform/i86pc/kernel/drv/vboxusb.conf; then
+                /opt/VirtualBox/vboxdrv.sh usbstart
+                rc=$?
+                if test "$rc" -eq 0; then
+                    # add vboxusb to the devlink.tab
+                    sed -e '
+                    /name=vboxusb/d' /etc/devlink.tab > /etc/devlink.vbox
+                    echo "type=ddi_pseudo;name=vboxusb	\D" >> /etc/devlink.vbox
+                    mv -f /etc/devlink.vbox /etc/devlink.tab
+                fi
             fi
         fi
Index: trunk/src/VBox/Installer/solaris/preremove.sh
===================================================================
--- trunk/src/VBox/Installer/solaris/preremove.sh	(revision 17060)
+++ trunk/src/VBox/Installer/solaris/preremove.sh	(revision 17068)
@@ -38,4 +38,5 @@
 
     # vboxdrv.sh would've been installed, we just need to call it.
+    /opt/VirtualBox/vboxdrv.sh usbstop alwaysremdrv
     /opt/VirtualBox/vboxdrv.sh fltstop alwaysremdrv
     /opt/VirtualBox/vboxdrv.sh stop alwaysremdrv
@@ -46,7 +47,15 @@
     mv -f /etc/devlink.vbox /etc/devlink.tab
 
-    # remove the link
+    # remove devlink.tab entry for vboxusb
+    sed -e '
+/name=vboxusb/d' /etc/devlink.tab > /etc/devlink.vbox
+    mv -f /etc/devlink.vbox /etc/devlink.tab
+
+    # remove the devlinks
     if test -h "/dev/vboxdrv" || test -f "/dev/vboxdrv"; then
         rm -f /dev/vboxdrv
+    fi
+    if test -h "/dev/vboxusb" || test -f "/dev/vboxusb"; then
+        rm -f /dev/vboxusb
     fi
 fi
Index: trunk/src/VBox/Installer/solaris/vboxdrv.sh
===================================================================
--- trunk/src/VBox/Installer/solaris/vboxdrv.sh	(revision 17060)
+++ trunk/src/VBox/Installer/solaris/vboxdrv.sh	(revision 17068)
@@ -25,4 +25,5 @@
 VBIMODNAME="vbi"
 FLTMODNAME="vboxflt"
+USBMODNAME="vboxusb"
 MODDIR32="/platform/i86pc/kernel/drv"
 MODDIR64=$MODDIR32/amd64
@@ -119,4 +120,16 @@
 {
     module_added $FLTMODNAME
+    return $?
+}
+
+vboxusb_added()
+{
+    module_added $USBMODNAME
+    return $?
+}
+
+vboxusb_loaded()
+{
+    module_loaded $USBMODNAME
     return $?
 }
@@ -239,4 +252,48 @@
 }
 
+
+start_vboxusb()
+{
+    if vboxusb_loaded; then
+        info "VirtualBox USB kernel module already loaded."
+    else
+        /usr/sbin/add_drv -m'* 0600 root sys' $USBMODNAME || abort "Failed to add VirtualBox USB Kernel module."
+        /usr/sbin/modload -p drv/$USBMODNAME
+        if test ! vboxusb_loaded; then
+            abort "Failed to load VirtualBox USB kernel module."
+        else
+            info "VirtualBox USB kernel module loaded."
+        fi
+    fi
+}
+
+stop_vboxusb()
+{
+    if vboxusb_loaded; then
+        vboxusb_mod_id=`/usr/sbin/modinfo | grep $USBMODNAME | cut -f 1 -d ' '`
+        if test -n "$vboxusb_mod_id"; then
+            /usr/sbin/modunload -i $vboxusb_mod_id
+
+            # see stop_vboxdrv() for why we have "alwaysremdrv".
+            if test -n "$ALWAYSREMDRV"; then
+                /usr/sbin/rem_drv $USBMODNAME
+            else
+                if test "$?" -eq 0; then
+                    /usr/sbin/rem_drv $USBMODNAME || abort "Unloaded VirtualBox USB kernel module, but failed to remove it!"
+                else
+                    abort "Failed to unload VirtualBox USB kernel module. Old one still active!!"
+                fi
+            fi
+
+            info "VirtualBox USB kernel module unloaded."
+        fi
+    elif vboxusb_added; then
+        /usr/sbin/rem_drv $USBMODNAME || abort "Unloaded VirtualBox USB kernel module, but failed to remove it!"
+        info "VirtualBox USB kernel module unloaded."
+    elif test -z "$SILENTUNLOAD"; then
+        info "VirtualBox USB kernel module not loaded."
+    fi
+}
+
 status_vboxdrv()
 {
@@ -252,4 +309,5 @@
 stop_all_modules()
 {
+    stop_vboxusb
     stop_vboxflt
     stop_module
@@ -260,4 +318,5 @@
     start_module
     start_vboxflt
+    start_vboxusb
 }
 
@@ -299,6 +358,12 @@
     stop_vboxflt
     ;;
+usbstart)
+    start_vboxusb
+    ;;
+usbstop)
+    stop_vboxusb
+    ;;
 *)
-    echo "Usage: $0 {start|stop|status|fltstart|fltstop|stopall|startall}"
+    echo "Usage: $0 {start|stop|status|fltstart|fltstop|usbstart|usbstop|stopall|startall}"
     exit 1
 esac
