Hack Azure Virtual Desktop to use OneDrive in Remote App Sessions

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.


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/


Make sure your OneDrive is installed as per-machine, and not per-user:

  1. Download OneDriveSetup.exe
  2. 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
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce]

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
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.


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 🙂



Legg igjen en kommentar

Din e-postadresse vil ikke bli publisert. Obligatoriske felt er merket med *

I accept the Privacy Policy

Dette nettstedet bruker Akismet for å redusere spam. Lær om hvordan dine kommentar-data prosesseres.