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
- Hit the Windows key, type “Settings,” and click on the Settings app
- Click “Accounts”
- Under “Other Users” click “Add someone else to this PC”
- 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
- On the “Create account” dialog, click “Add a user without a Microsoft account”
- 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
- Click on the newly created account name
- Click “Change account type”
- Click the “Standard User” drop-down and select “Administrator”
- 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.
- Click Ctrl-Alt-Del and click “Switch user”
- Click on the newly created user account
- Log in with the user name and password
- 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.
- 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.
- 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
- In the taskbar, right click the Docker icon and choose “Settings”
- Click “Shared Drives”
- Check the box next to the C drive and click “Apply”
- 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.
Thanks Matt, this was very helpful.
After I’ve done this do I need to keep the local user account or can I delete it?
Great observations/resolution, Matt. Thanks!