Make OneDrive desktop play nice with Bitlocker protected drives

4

1

Here is my environment:

  • Windows 10 (also occurs with 8.1)
  • System partition C: is not encrypted using bitlocker
  • "Data" partition E: is encrypted using bitlocker with manual unlock
  • OneDrive desktop sync location: E:\OneDrive

When Windows starts, I manually unlock E: using my passphrase.

The problem

When my computer starts, OneDrive complains that my OneDrive sync location is not available. This is because the location is within a bitlocker-protected drive that is not yet unlocked.

We couldn't find the location of your OneDrive folder. Click OK to reconfigure your OneDrive folder.

We couldn't find the location of your OneDrive folder. Click OK to reconfigure your OneDrive folder.

[OK] [Close]

Whether I click OK or close, OneDrive deletes its own configuration and starts from scratch. "Hello, this is OneDrive, a place for all your files blah blah blah". I am forced to reconfigure the sync location and a very long sync operation starts.

sync operation

This has been reported on technet and on uservoice [1, 2]. The only answer people get is:

Encrypt your system partition and enable auto-unlock for your secondary partition. This way the partition will be unlocked before OneDrive starts.

OK but I do not want to encrypt the system partition. I want OneDrive to wait for my partition to be unlocked and then do its job.

Question

Do you know a way of delaying the startup of the OneDrive desktop app?
This would avoid the bug.

Do you know any other trick that would prevent the app from deleting its own configuration and state when this occurs?

SandRock

Posted 2015-10-21T09:57:57.423

Reputation: 473

Answers

4

This is how I solved this: So OneDrive in a secondary drive that has BitLocker enabled.

Problem is OneDrive should start and prompt for the drive to be unlocked, rather than crash and assume all needs to be set up again.

To fix you need to 1. Stop OneDrive from starting at boot + 2. Start OneDrive automatically when the drive is ready/unlocked.

  1. In OneDrive settings just untick the "Start OneDrive automatically when I sign in to Windows"

  2. Open "Task Scheduler"

  3. Click "Action" - "Create Task" (not basic)

  4. Change these settings (leaving the rest as defaults):

a) General tab

  • Name: Start OneDrive after BitLocker

b) Triggers tab - New...

  • Begin the task: On an event
  • Log: Microsoft-Windows-BitLocker-API/Management
  • Event ID: 782

c) Actions tab - New...

  • Action: Start a program
  • Program/script: powershell.exe
  • Add arguments: %USERPROFILE%\AppData\Local\Microsoft\OneDrive\OneDrive.exe /background

d) Conditions tab

  • Untick "Start the task only if the computer is on AC power"

    1. Done

So now OneDrive should not start after boot/logon and as soon as you unlock the encrypted drive OneDrive will start automatically.

Angel Abad Cerdeira

Posted 2015-10-21T09:57:57.423

Reputation: 141

Thanks. I will try. I'll give the result as soon as my computer boots up. – SandRock – 2017-07-18T08:58:40.637

It does not work :-/ The event does not trigger... – SandRock – 2017-12-04T20:15:22.223

It does for me, I am using Windows 10, here it is an screenshot: https://www.abadcer.com/wp-content/uploads/2017/12/bitlocker-event.png

– Angel Abad Cerdeira – 2017-12-07T04:56:44.453

Okay, in fact, it works. There is a delay of many minutes for the task to execute on my machine. – SandRock – 2019-02-02T15:44:33.797

0

You can prevent OneDrive from starting automatically. Open the task manager and disable OneDrive startup in the Startup tab.

disabled onedrive startup

Then when your drive is ready for use, start the OneDrive application.

SandRock

Posted 2015-10-21T09:57:57.423

Reputation: 473