Docker on Windows 10: Sharing a Drive When Logging in With a Microsoft Account

If you’re using Windows 10 and you log into your computer with a Microsoft account, meaning you use an email address that’s associated with a Microsoft account as opposed to a local account on the computer itself, you may have run into the oft-reported issue of sharing your C drive with Docker. Without sharing the C drive, Docker basically can’t work properly.

The root of the problem is that when you log in with a Microsoft account it doesn’t have a password stored on the local machine, so when Docker asks you to enter your username and password to authorize the drive sharing, there is no password for you to enter, and Docker doesn’t let you leave it blank.

There are a lot of suggestions on the interwebs but to hopefully save others some time, this is the only way to solve this problem I found to work.

Create a New Local User Account

  1. Hit the Windows key, type “Settings,” and click on the Settings app
  2. Click “Accounts”
  3. Under “Other Users” click “Add someone else to this PC”
  4. On the “How will this person sign in?” dialog, click the “I don’t have this person’s sign-in information” link at the bottom
  5. On the “Create account” dialog, click “Add a user without a Microsoft account”
  6. Enter a user name and password, set your security questions and answers, and click “Next”

Change the Account Type of the New Account to Administrator

  1. Click on the newly created account name
  2. Click “Change account type”
  3. Click the “Standard User” drop-down and select “Administrator”
  4. Click “OK”

Log In as the New Account and Grant It Access to Your User’s Directory

In order for the new account to work correctly in the context of Docker, you have to log in under the new account and give the account full permissions on your user’s directory, or whatever directory you want Docker to be able to access to read/write/delete files.

  1. Click Ctrl-Alt-Del and click “Switch user”
  2. Click on the newly created user account
  3. Log in with the user name and password
  4. After the initial setup process completes, go to Windows Explorer and navigate to your user’s home directory (e.g. C:\Users\me) and click on it.
  5. You’ll get a message indicating that the new user doesn’t have access to that folder. Click Continue to grant the user access to the folder.
  6. When the permissions setting process completes, log out of the local user account and switch back to your own user’s account.

Enable Drive Sharing in Docker

  1. In the taskbar, right click the Docker icon and choose “Settings”
  2. Click “Shared Drives”
  3. Check the box next to the C drive and click “Apply”
  4. Enter the user name and password for the new local account you created above

At that point Docker should be happy. Hopefully in a future release Docker will support Microsoft accounts directly.