SOLVED

Start OneDrive when using a RemoteApp in WVD

Copper Contributor

Hi Guys,

 

I am testing with WVD in a Lab environment, and everything is working fine. I only have one thing that doesn't seem to work. OneDrive is starting when i'm using the "Full Desktop" mode in WVD, but when i start a RemoteApp, the OneDrive client isn't starting. 

 

Is this a WVD / FSLogix related issue? And how can i solve this?

 

Thanks,

 

Leon

78 Replies

@Baljit Aujla 

 

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.

bnicholson80_0-1603265058291.png

 

  • 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!

@racook 

 

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.

@Anon4343 You can fix that by whitelisting the Public IP of that server in the MFA console.

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

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

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

@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?

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

@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!

Just a heads up to everyone who is using RailRunOnce in the registry.  Microsoft updated OneDrive to a 64bit client which changed the path for me.  It no longer lives in ProgramFilesx86.  So make sure you update your registry key accordingly.

@mirthrock Hi, I a came across this problem last week. Took me a while to sort.

 

Annoyingly, what I am seeing now is that even on a x64 system, the newest version (21.109.0530.001) released June 15, 2021 is installing back into the Program Files (x86) folder which is crazy Microsoft!

 

Anyone seeing the same behaviour?

Yes, sadly... :(
I even had a deployment for a customer with two hosts, Onedrive updated 21. juni on one of them, 22. juni on the other. The first was installed in Program Files, the second in Program Files (X86). Crazy!! Both servers from same image.

@Mtollex70 That is exactly the same issue as me. I think one of them didn't 'self update' because it was always in use. I only realised when I went to manually update a host in drain mode.

 

Really poor from Micrososoft - is it native x64 bit or what?

 

What I have done is installed the x64 preview and works fine in c:\program files

 

Cheers

 

This thread contains a lot of good information regarding running OneDrive in AVD/WVD with RemoteApps and I have been using the setting described here for several years successfully.


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunOnce]
"OneDrive"="\"C:\\Program Files\\Microsoft OneDrive\\OneDrive.exe\" /background"

 

I'm currently having an issue with one of my clients where the OneDrive client will start at logon but the tray icon is missing/hidden. This particular deployment has been in production for some time now and was previously working without issue. The OneDrive process can be seen running in TaskManager as the user who initiated the remoteApp session. Stopping the process and starting OneDrive using 'Run new task' in the Task Manager, results in the same missing icon issue. However, if you stop the running process and launch OneDrive using a published OneDrive remoteApp, the tray icons are restored.

 

Reliance9636_0-1701187123232.png

 

Has anyone experienced similar issues?

 

Session Host

  • Windows Server 2019 Datacenter 1809 build 17763.5122
  • Microsoft OneDrive 23.231.1107.0002, per-machine installation.
  • FSLogix 2.9.8228.50276 // FSLogix user profiles are not in use on this system.

 

Client Computers

  • Windows Server 2019 Datacenter 1809 build 17763.5122 // Remote Desktop 1.2.4763.0
  • Windows 10 Pro 22H2 // Remote Desktop 1.2.4763.0

 

@Anon4343 

 

Thanks for your reply. Unfortunately, that article specifically states Windows 11 as a requirement. Setting that registry value has no effect on a Windows Server 2019 session host. The OneDrive process is not started after launching a remoteApp.

 

 

For Windows 11 AVD it only works with the preview version, so useless in production. I'm using the railrunonce workaround there as well.

@Reliance9636 

 

Do we still know if the RailRunonce regkey solution still works for OneDrive Remote Apps to initiate the OneDrive Sync Service?

 

I'm having issues getting the OneDrive.exe to start when using the RailRunOnce reg when remote apps are started. (also tried with REG_EXPAND_SZ key and also pointing to x86)

 

DarrenCederman_0-1703856533516.png

 

If I bundle onedrive.exe as a remote app and launch that, the OneDrive sync service starts.

 

Session Host

  • Windows 10 Multi-session host 22H2 19045.3803
  • Microsoft OneDrive 23.246.1127.0002, per-machine installation.
  • FSLogix 2.9.8612.60056, User Profiles