Add user to vboxusers group and append /etc/fstab for usb permission.
authorRichard Nelson <unixabg@gmail.com>
Mon, 30 Apr 2012 18:19:42 +0000 (13:19 -0500)
committerRichard Nelson <unixabg@gmail.com>
Mon, 30 Apr 2012 18:19:42 +0000 (13:19 -0500)
scripts/config/900-virtualbox

index aab08ed..10e32a1 100755 (executable)
@@ -91,6 +91,12 @@ Configure_virtualbox ()
                mkdir -p "/var/cache/gdm/${LIVE_USERNAME}"
        fi
 
+       # Add user to vboxusers group and compose the /etc/fstab accordingly
+       echo "Setup ${LIVE_USERNAME} vboxusers and correct settings on /etc/fstab."
+       usermod -a -G vboxusers ${LIVE_USERNAME}
+       _VBOXGID=$(grep vboxusers /etc/group | awk -F: '{print $3}')
+       echo "none     /proc/bus/usb     usbfs      devgid=${_VBOXGID},devmode=664    0    0" >> /etc/fstab
+
 cat > /var/cache/gdm/${LIVE_USERNAME}/dmrc << EOF
 [Desktop]
 Session=virtualbox