Switching devices from different client

Hi,

I'd have a virtualhere server on a raspberry pi 4, running using systemd, and several client daemons on other linux machines. I read in the client api post that it is possible to send commands to another instance of the client using named pipes.

If I look on my machines, I see the single path '/tmp/vhclient_ipc/socket', where the post says linux uses two pipes, one for each direction. As I understand it, pipes and sockets are different things.

Do you have any examples of accessing different clients?

My end goal would be to have virtualhere connect a keyboard and mouse to one of several machines, by pressing buttons attached to the GPU pins of a raspberry pi.

Thanks,

Adrian.

#3

Hi, actually you dont need to worry about using the pipe remotely you can just use ssh to call the virtualhere client to do the control like this

For example to use the keyboard/mouse on a remote x86_64 client running the virtualhere client daemon already

ssh username@clienthost '/usr/sbin/vhclientx86_64 -t USE,keyboardaddress.number'
ssh username@clienthost '/usr/sbin/vhclientx86_64 -t USE,mouseaddress.number'

etc

(https://www.cyberciti.biz/faq/unix-linux-execute-command-using-ssh/)

#4

Ok, I got time to try this and while it works, it's a bit clunky.

Thinking more on the subject, what I was looking for is a server api, not a client one. The api call to release a device from one client and attach it to another could be completed in a single server side message, instead of sending separate messages to each client.

Is this something that would be possible?

Thanks,

Adrian.

#5

The API for virtualhere is client based, as the server is usually runs on a box by itself somewhere (at least thats how originally wrote the system) so the only way to control the devices is via the client

#6

Yes, the box running the server is a headless pi4 under my coffee table. Keyboard, mouse and spacemouse are all connected to that.

I found I can disconnect a device from a remote client with the -a argument. Could this mechanism not also push a device to a remote client?

Thanks,

Adrian.

#7

No its not that simple change. You need to use the dongle from the client that wants to use it thats the easiest way. Just turn on "Auto-Use" on the other client so when you stop using it the other client picks it up. (There is a 3 second delay so you could grab it again from the local client if thats what you want to do.)

#8

I currently have seven clients.

Any way to remove the delay or make it smaller?

#9

There are settings in USB Hubs->Advanced Settings...->Auto-Use but they are set to the minimums by default so there is no way to make it smaller