need help with Sunshine, moonlight and Duo

sorry if this is long winded, but I've been down this rabbithole for a few days now.  Here's my situation:

I have a Raspberry Pi on my network with a USB controller attached
I have a windows PC I use for  TV, browsing etc.

What I would like to do is to stream emulators to the Pi (things it can't run natively) from the Windows PC, and have the USB device on the Pi control that content.  I also don't want the streamed content to interfere with the video or audio of my logged in session.

I messed around for some days with virtual displays and virtual output devices with Sunshine and Moonlight (streaming server/client), and while I made progress, it was flakey at best.  Then I discovered Duo, which is a sort of context manager for Sunlight.  This enabled me to create a new user to launch Sunshine, and from there programs in a discrete user session.  This worked great, with complete isolation of video and audio from the active session.

The next issue is the controller mapping, which is how I came to Virtualhere.  I could not, for the life of me get the controller to talk over moonlight.  It recognised the device, but it just didn't want to read inputs.  Virtualhere just worked, or so I thought.  The issue I narrowed down, was that if the other user (the streaming user) has an active session, I can set up a scheduled task to run on the creation of a session for that user, and the USB device will connect.  If that user has never logged on, the task never triggers.  I also don't seem to be able to launch virtualhere via Sunshines pre-launch commands.  If I try, it hangs at that point.

So it would appear that Virtualhere needs something, (like explorer.exe?) as a prerequisite before it can launch.  That's what I'm guessing.  I've given a lot of thought to this before reaching out for help but my three questions are:

1.  Is this a solved problem?  There's a lot of moving parts here and google is a bit shit these days, so I'm not sure.
2.  Is there a command line switch I can use that will help?
3.  I have a suspicion that running the client as a service may help part of my problem, but then it will run for every user, and I don't want the USB device to be available for every user, so I suspect it will solve one problem and introduce another

Thanks in advance, fingers crossed there's a way forward

 

#3

Virtualhere client can run as a service and that will run before anyone logs in.

 So using the client_api is the correct thing to do to control this. You must run the virtualhere client in VM session (or a real pc). Not in some windows terminal services session, if thats what you are trying to do. It wont be separated if its using session isolation. Its VM or real machine only on the client side.

#4

damn.  It is a real PC, but it's a session creation (as I understand it) rather than an actual login,  And that's why it works when there's a logged in session as opposed to simply creating a session.  I hate that Microsoft have made this so difficult.