de joutlan
The purpose of this how-to is to get usb devices, such as printers, working in a VirtualMachine Windows environment in Ubuntu/Kubuntu. Without usb support, a virtual machine is really only good for testing, and not production.
First off, if you haven’t done so already download and install the non-free version of VirtualBox 1.6.0 (no dinero, requires accepting license agreement) from here: https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=innotek-1.6-G-F@CDS-CDS_SMI
I did this in Kubuntu 8.04 RC, but below is for Ubuntu 8.04. This is written to apply to Gutsy, Ubuntu 7.10 also.
Go through the new VM set up routine in VirtualBox and install, let’s say XP in VirtualBox.
Here’s how I got usb devices working in an XP Virtual Machine in Hardy (8.04).
Add yourself to the group VirtualBox created during install called “vboxusers” The VB install creates this group, find it, don’t add another one.
Create a group named “usbusers” and put yourself in it.
sudo groupadd usbusers
sudo gpasswd -a usbusers
sudo gpasswd -a usbusers
Or do the above in Control Center under ‘users and groups’.
Now uncomment the 4 lines below ‘Magic to make /proc/bus/usb work’ in mountdevsubfs.sh , they will be commented out by default) so it looks like the following:
sudo gedit /etc/init.d/mountdevsubfs.sh
#
# Magic to make /proc/bus/usb work
#
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
# Magic to make /proc/bus/usb work
#
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
Now then,
Modify the rules in file “/etc/udev/rules.d/40-permissions.rules”
Change the lines :
Change the lines :
From:
# USB devices (usbfs replacement)
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, MODE=”0664”
SUBSYSTEM==”usb_device”, MODE=”0664”
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, MODE=”0664”
SUBSYSTEM==”usb_device”, MODE=”0664”
To :
# USB devices (usbfs replacement)
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, GROUP=”usbusers”, MODE=”0664”
SUBSYSTEM==”usb_device”, MODE=”0664”
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, GROUP=”usbusers”, MODE=”0664”
SUBSYSTEM==”usb_device”, MODE=”0664”
In Hardy Heron, I had to add the lines at the end of the file (under To: above) as this file is different in Hardy Heron, that is you won’t see the ‘from’ lines above like you will in Gutsy.
The Grande Finale,
add this line:
none /proc/bus/usb usbfs devgid=120,devmode=664 0 0
to your /etc/fstab file (at the bottom). Just make sure that 120 is your vboxusers group (use your own number).
Reboot the computer.
Reboot the computer.
Open VirtualBox and click on “Settings”.
Click on the “USB” item in the left pane to edit the USB prefs.
Click on the “Add device” button to add a filter and select your printer from the list and click on the “Ok” button.
Start your VM and Windows should detect your printer.
The above was taken mostly from various scattered posts in the Ubuntu forums, some from me, and put together here, all mods in one place, in order, for future reference.
Comments and/or edit recommendations welcomed.
1. Habilitar soporte USB a. Abrir un terminal y ejecutar el comando sudo gedit /etc/init.d/mountdevsubfs.sh b. Buscar estas l챠neas: #
ResponderEliminar# Magic to make /proc/bus/usb work
#
#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 c. Descomentar parte del c처digo de tal manera que quede as챠: #
# Magic to make /proc/bus/usb work
#
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 d. Guardar el archivo
2. Montar el soporte a. Desde el terminal ejecutar el comando: grep vbox /etc/group - te saldr찼 algo como: vboxusers:x::cris, donde puede variar b. Activando la interfaz USB: sudo gedit /etc/init.d/mountkernfs.sh - A챰adir la siquiente linea en alg첬n lugar despu챕s de que /proc es montado: domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=,devmode=664 - donde es lo que te aparec챠a en el anterior paso c. Guardar.
3. Poner el usb dentro de fstab a. Ir al terminar y escribir: sudo gedit /etc/fstab b. Pon la siguiente l챠nea debajo de las dem찼s, y aseg첬rate de no cambiar nada m찼s: #usbfs
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0 c. Reiniciar el equipo.
4. Conectar tu dispositivo USB 쩔A poco necesitas que te explique este paso?
5. Ejecutar Virtualbox a. Ir a Configurar (Settings)
b. Buscar y hacer clic en USB en el panel izquierdo
c. Activar Controlador USB y USB 2.0
d. A챰adir tu dispositivo USB (con el icono USB que tiene un m찼s [+]).
e. Clic en OK e inicia tu m찼quina virtual