Devices no longer accessable/visible locally when plugged in Ubuntu

I am having an issue with my Ubuntu workstation, Ubuntu 12.04.3 LTS x64, and I have the latest virtualhere server, vhusbd64 v1.7.4. The USB devices work fine remotely via the virtualhere software, even new devices plugged show fine in virtualhere and work when connected to windows client. The problem is I can no longer use USB devices with my local station, even if they are not used with virtualhere or ignored. Devices that were working fine when starting the daemon like my external USB drive keyboard and mouse will no longer work if I unplug/replug them, forcing me to hard shutdown my computer if it happens to be the keyboard/mouse. The USB devices are being recognized by the system when they are plugged in (can see entries in syslog). I do see when unplugging devices not even being used by virtualhere in the syslog like: vhusbd64: Unmanaging device 11. Why would the virtualhere prevent access to devices not in use by it? is this by design? This is a problem as I have various devices that will be plugged/unplugged and may or may not be used with virtualhere, so the AllowedDevices/IgnoredDevices/IgnoredBuses config would be useless. Anything that can be done with this?

#2

Hi DiverseCG, sorry for the delay in responding, i was on holidays. If the device is already connected when virtualhere starts it will not take control of the device until it is needed, otherwise if it is plugged in after virtualhere is running virtualhere will take control of the device. This was the original way i wrote the software. However i can see use-cases where this is not optimal, so in the next build of the software i can change it to allow use locally after it is unshared... i will include this in version 1.7.5 of the server to be released in a few days.

#3

OK this is implemented in version 1.7.5 of the server. Stop and exit the server, add the parameter AttachToKernelOnUnbind=1 to your config.ini file and start the server again.

#4

This is still not the way I would like to see it. Here is my scenario using AttachToKernelOnUnbind=0

  • start virtual here
  • attach the device, but do not connect any client! Now the device is in use on the system! (USB interface is claimed)
  • connect the device to a client
  • disconnect the device from the client: now the device is not in use any longer and the USB interface can be claimed by other processes! This should IMO be the state after switching on the device while virtual here is running! Just claim the USB interface when a client connects to the device!

BTW, if I use AttachToKernelOnUnbind=1, the USB interface is still claimed after disconnecting the client!

#5

I wrote it the way it works now because some devices are sensitive to configuration being set by the server before being taken by the remote client so this provides maximum compatibility.

However i can change the AttachToKernelOnUnbind parameter to AutoAttachToKernel instead and that will attach to the server kernel whenever it is not being used by a remote client... I will put this in the next build. You would then need to have AutoAttachToKernel=1 in your configuration. This build should be out in the next day or so...

#6

In version 1.7.6 of the server this now supports AutoAttachToKernel. Set this to 1 to allow the server to use the device whenever its not in use by a client.