WSL: Unable to Access OneDrive Personal Vault

The OneDrive Personal Vault stores files more securely than OneDrive itself. I have been unable to access the Personal Vault on OneDrive from the Windows Subsystem for Linux (WSL) Bash shells. When the vault is closed, I see a file named ‘Personal Vault.lnk’ in my WSL home directory; when the vault is unlocked I also see ‘Personal Vault’, which appears to be a symbolic link that does not function properly.

Console output attempting to access OneDrive Personal Vault directory from WSL Bash shell

Updated 24.Feb.2021: I cannot access the Personal Vault directory from WSL shells, but I can launch Windows programs that access its contents using a shell script I named vault:

#!/bin/sh

"wslpath "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe"" "/url:odopen://unlockVault/?accounttype=personal"

It takes some time to approve the authentication request on my phone, so I after running this, I use a fragment such as the following to wait some time while checking for an open vault. This depends on the ONEDRIVE environment variable to specify the path to the OneDrive directory,

#!/bin/sh

if [ "$ONEDRIVE" = "" ]; then
  echo ONEDRIVE environment variable not defined.
else
  if [ ls -l $ONEDRIVE 2>/dev/null | grep -v 'lnk' | grep -c 'Personal Vault' -ne "1" ]; then 
    vault
  fi
  for n in 1 2 3 4 5 6 7 8 9 10; do 
    if ls -l $ONEDRIVE 2>/dev/null | grep -v 'lnk' | grep -q 'Personal Vault'; then 
      break;
    else
      echo "Waiting for Personal Vault access…"
      sleep 5
    fi
  done
fi

# launch Windows programs that access $ONEDRIVE/Personal Vault

I got the odopen URL from the properties of the shortcut under the OneDrive directory on Windows that opens the Personal Vault. I got the /url command line prefix by using regedit to search for odopen.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: