When you sign out of a virtual desktop session and sign back in, OneDrive for Business often fails to start automatically. The OneDrive icon may not appear in the system tray, and files stop syncing until you manually launch the application. This problem typically occurs because Windows startup programs are not reliably triggered in non-persistent or pooled virtual desktop environments. This article explains why OneDrive fails to start after a reboot in virtual desktop infrastructure and provides tested fixes to ensure it launches on every session.
Key Takeaways: OneDrive Startup in Virtual Desktops
- Windows Registry > HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run: Ensures OneDrive.exe is listed and the path points to the correct 64-bit installation.
- Group Policy > Computer Configuration > Administrative Templates > Windows Components > OneDrive: Prevents OneDrive from being disabled by policy in non-persistent VDI.
- Task Scheduler > OneDrive Standalone Update Task: Launches OneDrive at user logon even when the Run key is blocked by profile reset tools.
Why OneDrive Fails to Start After Reboot in Virtual Desktops
Virtual desktop environments such as Azure Virtual Desktop, Windows 365, or VMware Horizon often use non-persistent or pooled session hosts. In these configurations, user profiles are discarded after sign-out and recreated from a base image at the next logon. Because the Windows Run registry key is stored in the per-user profile, it is lost when the profile is reset. OneDrive depends on this Run key to start automatically. Additionally, Group Policy settings in many organizations disable OneDrive startup explicitly to reduce logon delays. The combination of profile reset and policy restrictions results in OneDrive not launching after reboot.
Profile Reset and the Run Key
The Run key at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run is created when OneDrive is installed or configured. In persistent virtual desktops, this key survives reboots. In non-persistent environments, any changes made to the user registry hive during a session are discarded at sign-out. When the user signs back in, the Run key is missing, and OneDrive does not start.
Group Policy Restrictions
Many administrators apply the policy setting “Prevent the usage of OneDrive for file storage” under Computer Configuration > Administrative Templates > Windows Components > OneDrive. This policy disables the OneDrive startup entry and can also block the sync client from launching entirely. Even if the Run key is present, this policy overrides it.
Steps to Fix OneDrive Startup After Reboot in Virtual Desktops
Use the following methods in order. Test each method on a single virtual desktop session before deploying broadly.
- Verify OneDrive Is Installed in the Base Image
Open File Explorer and navigate to C:\Program Files\Microsoft OneDrive. If the folder is missing, install OneDrive using the Microsoft 365 deployment tool or the standalone installer. Ensure you install the 64-bit version for Windows 10 and Windows 11. Reboot the virtual desktop and check that OneDrive.exe appears in the Task Manager Processes tab. - Check the Run Key in the Current User Registry
Press Windows key + R, type regedit, and press Enter. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. Look for a value named “OneDrive” with data pointing to C:\Program Files\Microsoft OneDrive\OneDrive.exe. If the value is missing, right-click an empty area, select New > String Value, name it OneDrive, and set the value data to “C:\Program Files\Microsoft OneDrive\OneDrive.exe” /background. Sign out and sign back in to test. - Modify Group Policy to Allow OneDrive Startup
Open Group Policy Management Console on the domain controller or local policy editor on the session host. Navigate to Computer Configuration > Administrative Templates > Windows Components > OneDrive. Set the policy “Prevent the usage of OneDrive for file storage” to Disabled or Not Configured. Run gpupdate /force on the virtual desktop, then sign out and back in. - Create a Startup Script via Local Group Policy
Open gpedit.msc. Go to Computer Configuration > Windows Settings > Scripts > Startup. Add a new script with the path “C:\Program Files\Microsoft OneDrive\OneDrive.exe” and arguments /background. This runs OneDrive with system context before any user logs on. Note that this method may cause OneDrive to run as SYSTEM; test for file permission issues. - Use a Logon Script to Add the Run Key
Create a batch file named OneDriveStartup.cmd with the content: reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Run” /v OneDrive /t REG_SZ /d “\”C:\Program Files\Microsoft OneDrive\OneDrive.exe\” /background” /f. Deploy this script as a user logon script via Group Policy: User Configuration > Windows Settings > Scripts > Logon. This adds the Run key every time a user signs in. - Enable the OneDrive Standalone Update Task in Task Scheduler
Open Task Scheduler and navigate to Task Scheduler Library > Microsoft > Windows > OneDrive. Locate the task named “OneDrive Standalone Update Task v2” or similar. Right-click it and select Properties. On the Triggers tab, add a new trigger: Begin the task “At logon” for any user. On the Actions tab, verify the action is to start OneDrive.exe with arguments /background. Enable the task if it is disabled. This task persists across profile resets because it is stored in the system task folder.
If OneDrive Still Has Issues After the Main Fix
OneDrive Shows a Red X on Shared Office Files
If OneDrive starts but sync fails with a red X on shared Office files, the issue is often a stale sync token. Reset OneDrive by pressing Windows key + R, typing %localappdata%\Microsoft\OneDrive\onedrive.exe /reset, and pressing Enter. Wait 30 seconds, then launch OneDrive manually from the Start menu. This clears cached credentials and forces a fresh authentication.
OneDrive Opens but Immediately Closes
If OneDrive opens and then closes within seconds, check for conflicting startup entries. Press Ctrl + Shift + Esc to open Task Manager. Go to the Startup tab and look for multiple OneDrive entries. Disable all except the one pointing to C:\Program Files\Microsoft OneDrive\OneDrive.exe. Also check the Windows Services console for a service named “Microsoft OneDrive Updater Service” and set it to Automatic.
OneDrive Sync Engine Does Not Load After Profile Reset
In non-persistent VDI with FSLogix profile containers, the OneDrive Run key may be stored in the container but not loaded. Configure FSLogix to include the HKCU\Software\Microsoft\Windows\CurrentVersion\Run key in the registry exclusion list. Alternatively, use the Task Scheduler method described in step 6, which bypasses profile-based startup entirely.
Files On-Demand vs Always Keep on This Device: Key Differences for Virtual Desktops
| Item | Files On-Demand | Always Keep on This Device |
|---|---|---|
| Description | Files appear as placeholders until opened; data downloads on demand | Files are fully downloaded to the local drive and synced |
| Disk space usage | Minimal; only metadata stored locally | High; full file content stored locally |
| Network usage | Requires constant network access to open files | Files available offline after initial sync |
| Startup impact | OneDrive starts quickly because no full sync is needed | OneDrive may perform a full sync after each logon, delaying startup |
| Best for VDI | Recommended for non-persistent desktops to reduce logon time | Use only in persistent desktops with ample local storage |
In virtual desktop environments, Files On-Demand is the preferred setting because it minimizes local storage use and speeds up the logon process. To enable it, right-click the OneDrive icon in the system tray, select Settings > Sync and backup > Advanced settings, and turn on Files On-Demand.
You can now configure OneDrive to start reliably after every reboot in your virtual desktop environment. Start by verifying the Run key and Group Policy settings on a single session host. Next, deploy the Task Scheduler trigger or logon script to the entire collection. For persistent issues, check FSLogix registry exclusions and verify that the OneDrive Standalone Update Task is enabled and set to run at logon.