Vagrant VirtualBox Ubuntu 14.04 USB Joystick Support

169 views
Skip to first unread message

pod...@gmail.com

unread,
Aug 28, 2014, 4:11:21 PM8/28/14
to vagra...@googlegroups.com
'm trying to create a Vagrant dev environment and I need to give it the ability to access a USB joystick plugged into the host machine.
Host: Windows 8.1
Guest: Vagrant's Ubuntu 14.04 base box
VirtualBox: 4.3.15
I have installed guest additions and the extension pack. I have also gone into my Window's registry and deleted the needed file.

I can get it so that VirtualBox captures the device (using a device filter with Vendor ID and product ID specificed) and when I unplug and replug the joystick and run dmesg in the Ubuntu guest and get lines like: usb2-1: new full-speed USB device number 5 using ohci-pci. It also shows up in lsusb.

The only problem is it doesn't show up in /dev/input at all. All I get in /dev/input are event0-4, mice, and mouse0. I tried creating a udev rule with the product and vendor ID and symbolic linking it to a name in /dev/input and the name shows up in /dev/input but jstest fails when I try it.

I'm pretty sure that this has to do with the Ubuntu box that Vagrant provides. Any ideas on how to fix this problem?

Another thing, VirtualBox thinks the OS is 32 bit but I have downloaded, and tell Vagrant to create, a 64 bit guest.

Alvaro Miranda Aguilera

unread,
Aug 28, 2014, 5:36:09 PM8/28/14
to vagra...@googlegroups.com
hello, once the virtual machine is up and running, then you are between the host and virtualbox + guest, vagrant won't do anything to the usb part.

what I have learn with usb in virtualbox, is sometimes work, sometimes it doesn't.

easiest way, you need to use the mouse over the gui, capture/activate the console, and then plug the usb device in the computer.

other option, but I am doing this by memory, but I think the way to do it is, when the guest is on, you plug the device, and you can select from the usb with device move from the host to the guest. this sometimes work

in my personal case, what I have found work better most of the times is, shutdown the vm, create an usb rule empty.

turn the vm on, click on the console (so you will have to enable the gui in the Vagrantfile) and then plug the device.

hope this helps in some way,
Alvaro.


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pod...@gmail.com

unread,
Sep 4, 2014, 12:34:38 PM9/4/14
to vagra...@googlegroups.com
Alvaro,

My problem is a little different from the one you describe in your post. 

From what I understand you are talking about having virtualbox capture the USB device. This isn't my problem.

I can get virtualbox to capture the device (shows up in the GUI and has the blue circle next to it) and vagrant can see the device in $lsusb (it is a USB joystick) but when I run $jstest on it it only wants to see it as a mouse; not as a joystick. It seems like the Ubuntu 14.04 that vagrant boxes doesn't support joysticks. 

Does anyone know where I can look that will tell me how to add this support?

pod...@gmail.com

unread,
Sep 4, 2014, 4:01:48 PM9/4/14
to vagra...@googlegroups.com
It seems that Vagrant's Ubuntu 14.04 is missing some of the needed modules to run the joystick. Specifically, the analogue module (the joydev module is already on the kernel and I can modprobe it).

So, I've tried to recompile the kernel with the needed joystick modules, but I'm not sure where to look in Kernel Configuration (all the joystick related information has already been labeled <M>) and when I try $make after I fill out the Kernel Configuration menu I get the following error:  
  make [1]: *** No rule to make target '/usr/src/linux-headers3.13.0-34-generic/arch/x86/syscalls/syscall_32.tbl' , needed by 'arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'. Stop.
make: *** [archheaders] Error 2

Any thoughts?
Reply all
Reply to author
Forward
0 new messages