Docker doesn't open after changing drive

I just downloaded Docker and I didn’t want it to clog up my C: drive. After googling I added this to my daemon file through the docker gui.

"data-root": "E:\\DockerStuff\\data-root",

after trying to open docker again it timed out with the crash report

System.Exception:
1 error occurred:
	* waiting for docker daemon: context deadline exceeded


   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__11.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 108
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 108
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.Engines.<StartAsync>d__23.MoveNext() in C:\workspaces\4.17.x\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 109

after that i just reset to factory settings. I want to use docker in another drive but this method has failed me so i dont know what to do.

1 Like

I’m sorry to hear that you had trouble configuring Docker to use a different drive. It’s understandable to want to avoid filling up your C: drive with Docker files.

When you updated the daemon file to specify a new data root directory on your E: drive, it’s possible that there was an error in the file syntax or configuration that caused Docker to fail to start. This could explain why you encountered a timeout and crash report when trying to launch Docker.

Since you’ve reset Docker to its factory settings, you could try again to configure it to use a different drive. One possible approach is to use the Docker command line interface (CLI) to set the data root directory. Here’s an example of how you can do this:

  1. Open a command prompt window as an administrator.
  2. Type the following command to stop the Docker service:net stop docker
  3. Create a new folder on your E: drive where you want Docker to store its files, for example:E:\DockerStuff\data-root
  4. Type the following command to set the data root directory:dockerd --data-root E:\DockerStuff\data-rootThis command starts the Docker daemon with the specified data root directory.
  5. Open a new command prompt window and verify that Docker is using the correct data root directory by typing the following command:docker infoLook for the “Docker Root Dir” field in the output, which should show the path to the new data root directory on your E: drive.

If this approach doesn’t work or you encounter any issues, please let me know and I’ll try my best to help you troubleshoot further.

Hi thanks for the response but i googled a bit more and used the guide on How can I change the location of docker images when using Docker Desktop on WSL2 with Windows 10 Home? - Stack Overflow

Which used the built in WSL features to change the directory of the docker-desktop-data virtual machine.
I assume it worked because space in my ssd was freed up but when I run docker info i am not sure why it shows the root dir as linux
Docker Root Dir: /var/lib/docker

1 Like