Unity Editor and Virtual Desktop

Heya
Im Developing in Unity (latest ver) and am starting to work on VR games. One point, i havent been using a link cable because ive been streaming games to my Quest via VD so i havent needed to buy one.

What i want to know is has anyone had any luck connecting Unity Editor to the Quest via Virtual desktop?

ive followed a few tutorials online but they are outdated as the VR plugins are being superceded by the XR plugin so its super confusing.

i have no problem connecting to Steam VR but have no idea if i ccan edit my Software and test on the fly inside the quest.Im hoping this is possible otherwise im screwed by the fact that i cant get a link cable on the planet atm.

TYIA

2 Likes

I like to have the same. But i’ve a cable for Link. Trick is that Oculus will Hook when we go to PlayMode with Editor. It always says no HMD. Thats why the Hook goes from Virtual Desktop to Oculus. So you’ve to start an App via Virtual Desktop. Thats tricky with the editor and only works with a build. I wonder there is somehing possible…

I managed to run Unity Editor bypassing Hub VD injection problem. So sweet to have wireless VR development ability again! All you have to do is open unity project using command line with VD injection.
Like this:

VirtualDesktop.Streamer.exe "C:\Program Files\Unity\Hub\Editor\2020.2.0b2\Editor\Unity.exe" -projectpath D:/Projects/XR-Interaction-Toolkit-Examples/VR -useHub -hubIPC -cloudEnvironment production

PS: I don’t know exactly what these arguments mean, I just captured them using API Monitor

4 Likes

Hey @dnnkeeper , tried the command, but that just opens the Unity Hub, and I could not get the Unity Editor to “see” my headset or controllers. Could I trouble you for some step by step process?

Try launching Unity Hub manually prior to executing this command. Then hit Play through the VD or make sure headset is active and connected at this moment. Your project must have XR Management plugin for Oculus installed and enabled.

2 Likes

After a bit of back and forth I finally got it working, thanks @dnnkeeper ! For you others stumbling in here wondering about the same, I’ll post what I did.

First of all: Localize your Virtual Desktop (VD) folder, specifically the “Virtual Desktop Streamer” folder. We’re gonna need the exe path here, so usually it’s
“C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe”. Take note of the path.

Second, find your project folder, i.e. “S:\UnityProjects\VRToolkitUnity”, only the “top” path of the folder is needed. It’s VERY important that the proejct path does NOT contain any white spaces. Even if its enclosed I couldn’t getting it to work, so I had to remove any whitespace in the actual folder names in Windows.

Next is the Unity Editor executable, the one installed through the hub. In most cases it’s located like this: “C:\Program Files\Unity\Hub\Editor\2020.1.3f1\Editor\Unity.exe”
Replace “2020.1.3f1” with the version your specific project uses.

So let inject things here:
Open a cmd window (Windows + R, write “cmd”, or search for “command” or “cmd” in Start menu search. so here’s the kicker: With paths we’ve just located paste in this, in this syntax: " “<Unity Editor executable path”> -projectpath “<Unity project path”.

An example here:

"C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe" "C:\Program Files\Unity\Hub\Editor\2020.1.3f1\Editor\Unity.exe" -projectpath "S:\UnityProjects\VRToolkitUnity"

Don’t forget the " " when pasting in your own paths!

Then Unity starts, if you hit play when VD is active on the Quest, it runs! Even if you start VD after you’ve started Unity, it still works!

EDIT: Some reported that adding “-useHub -hubIPC -cloudEnvironment production” after the project path cleared up some HMD detection issues.

Project path would then be:

-projectpath "S:\UnityProjects\VRToolkitUnity -useHub -hubIPC -cloudEnvironment production"

Again creds to @dnnkeeper !

8 Likes

It worked! I even made a batch to be able to call this command from the context menu! Thanks guys!

1 Like

I bought the VD Quest app and it works, but even though I can run the commands above and get the Unity editor running, it won’t “preview” in Quest as VR, it will preview as if I had no HMD connected, in the flat editor screen. Any thoughts?

1 Like

It worked for me too, but the hand controllers are not being detected as expected… I do see them in the XR input inspector, but when I do “InputDevices.GetDevices(allDevices);” in the code, only the headset appears, and not the hands! With the cable it finds the 3 of them… Is anyone else having this problem? Any idea or possible solution? Thank you very much

Adding the “-useHub -hubIPC -cloudEnvironment production” seems to have solved the problem in case someone is struggling with this

Strange and interesting, I found the “-useHub -hubIPC -cloudEnvironment production” not making any difference for me.
I’ll update my answer with this!

2 Likes

I’ve installed countless Unity Editor versions, patched VD via SideQuest and still nothing happens when I click play. Tried with and without the “-useHub -hubIPC -cloudEnvironment production”, no success at all. Other than downloading VD, patching it with SideQuest, is there something else?

Have you tried using Oculus Link with this project? Sometimes even wired connection doesn’t work properly. If you able to run it with usb cable then you should be able to run it with VD injection. Try opening Oculus app before starting editor.

Turns out I was putting the extra commands ‘outside’ the project path argument. It works now and I’m the happiest programmer on earth :slight_smile: Thanks everyone!

1 Like

Unity Editor just crashes for me. =( Any suggestions?

I added the sidequest file, then I made a .bat file of:

“C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe” “C:\Program Files\Unity\Hub\Editor\2020.1.16f1\Editor\Unity.exe” -projectpath “C:\MarshallVisions\GitHub\WizardsKeep -useHub -hubIPC -cloudEnvironment production”

This causes Unity Editor to run. Then when I click play, a second Unity icon appears on the taskbar for a couple seconds, then disappears then the Editor crashes.

This sounds fantastic. Brilliant I am going to give it a shot in the morning.

That would be exactly what I am looking for, maybe better than ALVR and not having to be connected with a Link cable.

Does this support the controllers too?

Did you ever get that working? I tried adding that, but doesn’t seem to work, where when I try InputDevices.GetDevices, it only returns 1 device (QuestHeadMounted, TrackedDevice).

I used the following:

"C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe" "C:\Program Files\Unity\Hub\Editor\2020.2.0f1\Editor\Unity.exe" -projectpath "D:\UnityProjects\TestUnity1 -useHub -hubIPC -cloudEnvironment production"

Be good if that’s working… appreciate anyone’s help, thanks!

It’s actually working now. Turns out I just need to make sure I have the Oculus software opened, and then it all worked like normal. Thanks everyone here! It’s so awesome to be able to code remotely.

Did this for my specific project and it started VD desktop, started the unity project, I put a XR room scale camera in the scene, pressed play and it just crashes unity.
So we need more info on which version of unity, XR intergration or legacy Oculus?, any other settings.
It would be nice if you could chat on the Virtual Desktop Discord. I am there too.

this was my console to start everything

“C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe” “C:\Program Files\Unity\Hub\Editor\2019.4.14f1\Editor\Unity.exe” -projectpath “C:\UnityProjectsNov2020SSD\QuestURPDez2020”

Apparently some are having some luck with this solution. So if anyone else manages to get this solution or another working, then it would be great if you could share your success with us all and how you got it working. Maybe even let us know on the Virtual Desktop discord.

Thanks in advance to any feedback.

I cannot get this to work for me. Using Unity 2020.2.1f1

Here’s my cmd line.

"C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe" "C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Unity.exe" -projectpath "D:\GitHub\VRProject2\VR-Unity-2020 -useHub -hubIPC -cloudEnvironment production"

I have the Oculus app open. I’ve tried with VD already running and opening it after. It opens Unity to the correct project. The project has the XR stuff set up, but when I press Play, it doesn’t go to my Quest. It’s just the normal Playback in the editor, that I can see on VD.