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.
Hi Randy,
Have adding the key:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce\
OneDrive \ REG_SZ \ "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background
This works for all existing issues - where a profile has been created previously.
However, for any new user during logon the user session will 'hang' on the process "Run Once Wrapper"
The remote desktop client will continue with the message: "Configuring remote session..."
If you kill the Run Once Wrapper the user will login and there doesn't seem to be an issue after that.
Have you or anyone else seen this issue?
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!
- Mtollex70Dec 16, 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.