Forum Discussion
Start OneDrive when using a RemoteApp in WVD
- Sep 26, 2019
We are in the process of documenting how to auto-start OneDrive in a Remote App scenario.
We will be documenting the following registry entry:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce
I believe this works the same as the regular run keys, except that anything listed under this key will be launched when the remote session starts.
What happens is that in a remote session, Explorer.exe is not used as the Windows shell. rdpshell.exe is run instead. rdpshell.exe does not process Run entries. It does do the RailRunonce key though.
mshepherdDid you ever find a solution to this? We're using OneDrive/SharePoint for all of our users and we're publishing a couple remote apps that need OneDrive running in the background so that the user can access the SharePoint libraries via File Explorer when they're in a RemoteApp. I'm in the same boat - works fine on a full session, but doesn't work on a RemoteApp. My line of thinking is to run some sort of script or launch the OnedDrive EXE when the user launches a RemoteApp. But I haven't quite figured out how to make this work yet.
We are in the process of documenting how to auto-start OneDrive in a Remote App scenario.
We will be documenting the following registry entry:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce
I believe this works the same as the regular run keys, except that anything listed under this key will be launched when the remote session starts.
What happens is that in a remote session, Explorer.exe is not used as the Windows shell. rdpshell.exe is run instead. rdpshell.exe does not process Run entries. It does do the RailRunonce key though.
- Mtollex70Dec 17, 2020Brass Contributor
adam222 Yes, i moved the "OneDriveSetup=C:\\Windows\\SysWOW64\\OneDriveSetup.exe /thfirstsetup" from the Run key of the default user profile to the RailRunonce key in GPO instead. But i suspect its enough to just remove it, and not set it in RailRunonce. I had no time yesterday to check this, but will now. 🙂 Thanx for your reply!
- adam222Dec 16, 2020Copper Contributor
Mtollex70 Hi, I tried the deletion of run keys in the default user hive and works for me. I deleted entries for Run and RunOnce though as there was another OneDrive entry in there. I will test and see if I need to delete both.
One thing to note, if you delete the reg keys above, and you also use the host pool for a desktop, you may need to use a GPO to launch OneDrive for normal logons..
- adam222Dec 16, 2020Copper Contributor
Mtollex70 I am having the same problem. First login hangs on preparing Windows for 5 or so minutes. When RemoteApp opens, OneDrive is not configured. But on subsequent logons, it's there.
I can see in task manager that the renounce.exe is running for the user. I'd I kill renounce.exe in those 5 minutes while it's "preparing windows" it logs on successfully straight away.
I cannot work out why the runonce task is holding the login...
Any thoughts?
- Mtollex70Dec 16, 2020Brass Contributor
bnicholson80 Are you sure you didnt do anything else in this process? I've been struggling with this problem for a while, feel i have tried everything, including now your solution. Still 5 min on first login, 20-sek on logins after that. 😞 And OneDrive does not work on first login.
- Stefan GeorgievDec 03, 2020Former Employee
mirthrock our official statement is captured here https://docs.microsoft.com/en-us/onedrive/sync-vdi-support
While it is possible to get the desired outcome as you have seen its not elegant.
- Anon4343Oct 23, 2020Brass ContributorGood thinking. It already is. I suspect that another process isn't running because the issue does not occur when a new user logs into the desktop for the first time.
- Anon4343Oct 23, 2020Brass Contributor
Looks like if MFA is enabled, the user will not be automatically signed in. I had to publish OneDrive and allow the user to walk through the setup process. During the process, the MFA takes place. Subsequent logins (at least on that server) do not require MFA.
- bnicholson80Oct 21, 2020Copper Contributor
Baljit, I believe I found a solution to this hang on RemoteApp application launch for new users with OneDrive integrated using the RailRunonce method.
- Load the default user profile hive into your registry editor.
- From within the default user profile hive, browse to Software\Microsoft\Windows\CurrentVersion\RunOnce
- There you will find the issue. In the RunOnce key of the Default profile hive is the below string value.
- New accounts logging in for the first time are having the above run automatically when it builds the new user profile. This combined with RailRunonce causes the Runonce wrapper to hang up.
- Delete this string value from the default profile hive.
- Unload the default user profile hive in your registry editor.
- Attempt to launch a RemoteApp with a new user account.
- My initial logins went down from 5+ minutes to just 25 seconds by removing this string value from the default registry hive.
- Also to note, OneDrive works on first login which is a bonus!
- mirthrockSep 03, 2020Brass Contributor
Sure jrngsg !
Login to portal.azure.com and navigate to "Multifactor Authentication" (you may have to search for it in the Azure search bar). Then under "Configure", click the link for "Additional Cloud-Based MFA Settings". Then you'll see a box labeled "Skip multi-factor authentication requests from the following range of IP address subnets". Add your public IP addresses and subnet mask in CIDR format. Now, if a user authenticates from any of those IP addresses you added, they will not be prompted for 2FA.
Regarding the registry key, I don't think you need it. I might be wrong, but if you're using Office 365, Modern Auth is enabled by default on Outlook (if its updated) and your tenant. See here for more info:
https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/enable-or-disable-modern-authentication-in-exchange-online
Hope that helps!
- mirthrockAug 05, 2020Brass Contributor
Hi luzmariae! Glad I could help. Here are screenshots of my GPOs. Make sure you apply them to the proper OUs for your organization. And if you need anything else, don't hesitate to ask. If this works for you, let us know on here so that others can use this method as well.
Good luck!
- luzmariaeAug 03, 2020Copper Contributor
mirthrock Thank you so much for reverting back!!!
I had more guidance from you in a single post than having two open cases with OneDrive and WVD...
I don't have 2FA for Onedrive, and the only point i'm not clear (completed as you did) is the point 4:
I used GPOs to have OneDrive silently sign in users, use files-on-demand, sync specific SharePoint Libraries, and most importantly limit each user to one session. Is too much to ask if I can see your GPO configuration for those settings? I will research also from my side but I would like to have your input as well.
Thank you again for your help!!
- mirthrockJul 31, 2020Brass Contributor
Hi luzmariae ! I apologize but its been a while since I set this up. I just went through my settings and there are a few things to note:
1) RailRunOnce must be enabled
2) OneDrive Installer must be Machine-Wide
3) I used GPOs to have OneDrive silently sign in users, use files-on-demand, sync specific SharePoint Libraries, and most importantly limit each user to one session. This is very important as OneDrive has no idea how to log itself in if its running on multiple sessions for the same user.
4) If the accounts have 2FA enabled, I had to log in as the user to the FULL Remote Desktop experience, follow the OneDrive 2FA prompts, and then log off. This is a bit of a pain since the 2FA prompts return every 60 days or so. So sometimes, I need to log in as the user to the full remote desktop experience again to re-input the 2FA prompts. If you don't use 2FA (or have your IP configured in the 2FA exceptions) this step isn't necessary.
After all that, I was able to launch a RemoteApp and have OneDrive launch in the background without any issues.
If you need more detail, let me know. Happy to help where I can.
Edit: Updated with more information and clarity.
- luzmariaeJul 30, 2020Copper Contributor
DannyBoy65 thanks for the reply! I must have per machine as im using W10 multi session as a session host. the weird behavior here is that it does work but after couple days it stops. Running in circles here and MS nor O365 supports helps, I have 2 cases opened and they haven't provide the solution nor a clear path to follow...
- luzmariaeJul 30, 2020Copper Contributor
i'm struggling with the same issue, after reading your advice I've tried but im having the "run as administrator" problem, can you kindly share how you wrote your batch file? I manually added my admin credentials as a test and found that OneDrive is not getting started... I have the following registry keys configured for autoconfigure OneDrive:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive]
"SilentAccountConfig"=dword:00000001
"FilesOnDemandEnabled"=dword:00000001is that enough?
I have RailRunOnce key as well but this just worked one time, after couple days everything stopped working.
Hope you can guide me through this as I've been suffering for couple weeks.
Regards!!
- DannyBoy65Jul 15, 2020Copper Contributor
luzmariae Hi, I´m using this one:
C:\Users\USER\AppData\Local\Microsoft\OneDrive\OneDrive.exe /background
here:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce
Got it on this post and it works ok (maybe 98 out 100 sessions).
Please notice this is on a per use install, not a per machine one.
Best regards.
- ronald2424Jun 05, 2020Copper ContributorThank you for your input..
I am trying to use One Drive as a File Explorer substitute.
The initial launch and setup works perfectly. But when you try to launch One Drive subsequently, it gets launched in the system tray with no option to relaunch it onto the Desktop in File Explorer view. This would allow the users to K access the files in network shares.
Will really appreciate if someone can confirm if this is possible and point me to the right direction. - DannyBoy65Jun 04, 2020Copper Contributor
Hi,
In my case, I´m relying on sharepoint and synced document libraries for that. So remote users save their documents to the server´s onedrive (I have a per user installation, but will be trying the per machine installation soon on another implementation), onedrive syncs to sharepoint and SP syncs to the user´s workstation.
- ronald2424Jun 04, 2020Copper Contributor
Hi,
I applied the 3 registry settings for One Drive. However when the app is selected it does not open as a window for the users as they need to do map to network drives. Is that possible to achieve?
RD
- SebCerazyMay 20, 2020Iron Contributor
Whatever OS MS provides for WVD in Azure (1909)
Client per-machine comes as default in that instll
Yes, I have the settings done in registry
User is still asked to login to OD
- Rhys WilliamsMay 20, 2020Iron Contributor
SebCerazy What OS version are you using? Do you have the per-machine OD client installed and have the correct GPO settings applied?
- SebCerazyMay 20, 2020Iron Contributor
Even with EnableADAL=2 none of my full RD users do get auto login to OD
- DannyBoy65May 06, 2020Copper ContributorHi,
Just to thank racook for that registry key. Just migrated a file system to sharepoint and onedrive is where users get and save their files from remoteapp (thinstuff, btw) sessions.
Ended up adding a key for each user to avoid uninstalling user's onedrives and installing the per machine one.
Thanks! Life saver that one.