Hack Azure Virtual Desktop to use OneDrive in Remote App Sessions
I’m not sure if it’s my elite hacker skillz, or just my wish for better user experiences that drives me to find ways to wash out the lines between your own computer and desktops running in the cloud. Either way, I found this method online that I want to share with you. I will share what my challenge was, how I solved it and what it feels like for the users.
The challenge:
The thing that always has bugged me with Remote Desktop-solutions are the fact that the user has TWO DESKTOPS! One local and one remote. The user experience is almost always better locally, but still they are forced to log on to a remote desktop and split the whole experience. Luckyli there is this possibility of using Remote Apps to make single applications available to end users. But… the experience is still split between your local computer and the remote app. There is little, to none connection between your local session and the session on the remote server.
What if you produce files in an Line of Business app and need that file as an attachment in an email or saved to another location? We do have the magic of OneDrive. But when you log in to a remote app , OneDrive will not start. It will only run when you log in to the full desktop. Why? The difference lies in what shell is executed. In a Desktop Session, explorer.exe is the shell the system loads. This is not the case with Remote App, which uses rdpshell.exe. This shell will not run stuff like OneDrive.
But with a little manual trickery (Or hacking, if you prefer) you can force what apps to launch together with rdpshell.exe.
Disclaimer:
Although this solution is proven to work, it’s not a supported scenario by any means. Microsoft is working on a supported solution, but it’s in preview.
Read more here: https://johanvanneuville.com/application/how-to-use-microsoft-onedrive-as-a-remoteapp-on-azure-virtual-desktop/
Prepare:
Make sure your OneDrive is installed as per-machine, and not per-user:
- Download OneDriveSetup.exe
- Run “OneDriveSetup.exe /allusers”
If your users are already using OneDrive per-user, they will continue to work just as fine after this change.
What to do in registry:
You can take this info, copy it to a .reg-file and import on your system and it should be good to go.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce]
"OneDrive"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,\
00,6f,00,66,00,74,00,20,00,4f,00,6e,00,65,00,44,00,72,00,69,00,76,00,65,00,\
5c,00,4f,00,6e,00,65,00,44,00,72,00,69,00,76,00,65,00,2e,00,65,00,78,00,65,\
00,20,00,2f,00,62,00,61,00,63,00,6b,00,67,00,72,00,6f,00,75,00,6e,00,64,00,\
00,00
Love PowerShell? Please use these two command to do the same thing.:
//First we must create the key
New-Item -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce"
//Next we add the value with the correct value
New-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce" -Name "OneDrive" -Value "C:\Program Files\Microsoft OneDrive\OneDrive.exe /background" -PropertyType MultiString
Or explained in another way, manually create a “Expandable String Value” with these values (This is not real YAML btw!):
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce
Name: OneDrive
Type: REG_EXPAND_SZ
Data: C:\Program Files\Microsoft OneDrive\OneDrive.exe /background
Either way, it should look like this:
What it feels like
If everything goes well, the users should now be able to use OneDrive as if it was running locally when they log in via remote app. It even shows up in your computers local “System Tray”, making it able to be managed and controled in the same way as your local running client. Your apps now can save files as if it’s directly on your own computer, and no one will notice the gap between the local or the remote computers.
Summary
One “gotcha” worth mentioning: use this together with FSLogix! Don’t try to use this with User Profile Disks 😉 Just sayin’…
Have you been able to use this method? Any eperience with these challenges and found this solution helpfull? Please let me know 🙂
Source:
2 kommentarer til «Hack Azure Virtual Desktop to use OneDrive in Remote App Sessions»
I tried everything you said above, and no OneDrive when I launched Remote Apps. I even tried it on 2 different machines. Do the AVD machines still need to be Win11 or will the above work on Win10 multi-session machines as well?
Thanks,
Thanks for the comment! I’ve got this working on Win 10 as well as Win 11.