› Foros › PC › Software libre
/etc/udev/rules.d/40-basic-permissions.rules
# This file establishes permissions and ownership of devices according
# to Ubuntu policy. See udev(7) for syntax.
#
# The names of the devices must not be set here, but in 20-names.rules;
# user-friendly symlinks (which need no permissions or ownership) should
# be set in 60-symlinks.rules.
# USB devices (usbfs replacement)
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, MODE=”0666″, GROUP=”vboxusers”
SUBSYSTEM==”usb_device”, MODE=”0666″, GROUP=”vboxusers”
# vc (virtual console) devices
SUBSYSTEM!="tty", GOTO="vc_end"
KERNEL=="console", MODE="0600"
KERNEL=="ptmx", MODE="0666"
KERNEL=="tty", MODE="0666"
LABEL="vc_end"
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, MODE=”0666″, GROUP=”vboxusers”
SUBSYSTEM==”usb_device”, MODE=”0666″, GROUP=”vboxusers”
# Miscellaneous devices
KERNEL=="null", MODE="0666"
KERNEL=="zero", MODE="0666"
KERNEL=="full", MODE="0666"
KERNEL=="random", MODE="0666"
KERNEL=="urandom", MODE="0666"
KERNEL=="inotify", MODE="0666"
fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
#Entry for /dev/sda1 :
UUID=ea665e39-d9b0-4e83-a8df-bfaa99749a1c / ext3 relatime,errors=remount-ro 0 1
#Entry for /dev/sdb1 :
UUID=CEC004A1C00491BF /media/sdb1 ntfs-3g defaults,locale=es_ES.UTF-8 0 0
#Entry for /dev/sda5 :
UUID=b295081a-25ac-4e7d-beef-8e7cfcb2b3e6 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/proc/bus/usb usbfs devgid=126,devmode=666 0 0
/proc/bus/usb usbfs devgid=1000,devmode=666 0 0
/etc/init.d/mountdevsubfs.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: mountdevsubfs mountvirtfs
# Required-Start: mountkernfs
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Mount special file systems under /dev.
# Description: Mount the virtual filesystems the kernel provides
# that ordinarily live under the /dev filesystem.
### END INIT INFO
PATH=/lib/init:/sbin:/bin
TTYGRP=5
TTYMODE=620
[ -f /etc/default/devpts ] && . /etc/default/devpts
TMPFS_SIZE=
[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
KERNEL="$(uname -s)"
. /lib/lsb/init-functions
. /lib/init/mount-functions.sh
do_start () {
#
# Mount a tmpfs on /dev/shm
#
SHM_OPT=
[ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
domount tmpfs shmfs /dev/shm $SHM_OPT
#
# Mount /dev/pts. Create master ptmx node if needed.
#
domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
#
# Magic to make /proc/bus/usb work
#
# These following 4 lines were uncommented to make USB devices avabilable in vmware
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
}
case "$1" in
"")
echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
do_start
;;
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: mountdevsubfs [start|stop]" >&2
exit 3
;;
esac
There are two versions of Virtual Box:
- OSE (Open Source Edition) which is in the repos
- Closed Source Edition, or Standard, or just plain “Virtual Box”
OSE does not have USB support. There are a few other features from the closed source version that aren’t included in OSE, you can see the list here. So, if you want to have USB support in VirtualBox, you need to install closed source edition and make a change to /etc/fstab. Here are the steps:
1. Remove OSE
$ sudo apt-get autoremove virtualbox-ose
2. Add the VirtualBox repo for Intrepid Ibex
$ sudo synaptic
In Synaptic, click Settings > Repositories. Click the “Third-Party Software”tab. Click Add and enter:
deb http://download.virtualbox.org/virtualbox/debian intrepid non-free
Save the VirtualBox GPG key from here, then import it into Synaptic by clicking Settings > Repositories > Authentication > Import Key File.
Click the Reload button in Synaptic to reload the repositories.
3. Install virtualbox-2.1 by selecting it in Synaptic, or running this command from a terminal:
$ sudo apt-get install virtualbox-2.1
4. Add yourself to the vboxusers group:
$ sudo gpasswd -a YOURUSERNAME vboxusers
5. Find the devgid for ‘vboxusers’:
$ grep vboxusers /etc/group
It will return something like:
vboxusers:x:123:username
Add this line to the bottom of /etc/fstab, replace the devgid number with your devgid:
none /proc/bus/usb usbfs devgid=123,devmode=664 0 0
After you reboot you should now have USB support in VirtualBox.