Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker Desktop] Cannot change default installation drive on Windows? #94

Open
MoacirSchmidt opened this issue May 18, 2020 · 78 comments
Open
Assignees
Labels
community_new New idea raised by a community contributor docker_desktop Improvements or additions to Docker Desktop

Comments

@MoacirSchmidt
Copy link

Cannot change default installation drive on Windows?

Is that right? I refuse to believe!

Seizing the opportunity: Congratulations for your excellent product!

@stephen-turner stephen-turner added community_new New idea raised by a community contributor docker_desktop Improvements or additions to Docker Desktop labels Mar 8, 2021
@odupuy
Copy link

odupuy commented Aug 13, 2021

Why cannot we chose the install folder like in any other application?

  • Some corporate developer machines only allow installs to specific directories.
  • Spaces may be an issue (my case, it is creating all sorts of problems to run in scripts supporting Mac, Linux, Windows 7 (not dead everywhere) and 10 and losing hours and hours on that.
  • You may have a faster disc as D: vs the default C:
  • Your C: can be full

We are in 2021. Please just give us the choice of where to install.
Don't assume our choices and needs.

If you read this, you maybe interested in this band aid solution

@crimunit
Copy link

Same issue over here..
Is there somehow a bypass solution in some small steps I can follow to accomplish this please (also running WIN10 Docker Hyper-V with C drive, not possible to use D drive)?

@odupuy
Copy link

odupuy commented Aug 20, 2021

@crimunit try the band aid solution that I posted upper

@jordanhooper73
Copy link

Any update on this?

@nebuk89
Copy link
Contributor

nebuk89 commented Sep 1, 2021

Hey all, sorry we haven't responded! No update on this one yet :( cc @stephanierifai as an FYI

@dmdhrumilmistry
Copy link

are there any updates?

@stephanierifai
Copy link
Contributor

Hi all, sorry still no updates here yet :( Thanks for checking in

@sinaqahremani
Copy link

Hi,
still no updates here yet!

@sahlekebe
Copy link

Hi,
any updates... ?

@odupuy
Copy link

odupuy commented Dec 26, 2021

2022 is knocking at our door and still no traction on this.

@logm1lo
Copy link

logm1lo commented Jan 11, 2022

Hi,
any updates....??

@sinaqahremani
Copy link

We get the "still any updates?" message all the time and still no updates!

@logm1lo
Copy link

logm1lo commented Jan 11, 2022

Fine.......
I will do this myself

@Chetan177
Copy link

First month of 2022 is about to end still no update !!

@Chetan177
Copy link

I have tried this and moved the ext4 volume to a secondary drive and Docker working fine

wsl  --shutdown
mkdir D:\Docker\wsl\data\
wsl --export docker-desktop-data "D:\Docker\wsl\data\docker-desktop-data.tar"
wsl --unregister docker-desktop-data
wsl --import docker-desktop-data "D:\Docker\wsl\data" "D:\Docker\wsl\data\docker-desktop-data.tar" --version 2

Make sure you only use this on the fresh installation only.
If you have docker containers and images it throws an OutOfMemory error

Link

@gallargit
Copy link

gallargit commented Jan 18, 2022

I was able to achieve this by manually creating symlinks. Here's my setup, everything goes into "D:\Program Files\Docker". Run this before installing Docker Desktop

md "D:\Program Files\Docker\ProgramDataDocker"
md "D:\Program Files\Docker\ProgramDataDockerDesktop"
md "D:\Program Files\Docker\ProgramFiles"
md "D:\Program Files\Docker\RoamingDockerDesktop"
md "D:\Program Files\Docker\RoamingDocker"
md "D:\Program Files\Docker\AppDataDocker"

mklink /j "C:\ProgramData\Docker" "D:\Program Files\Docker\ProgramDataDocker"
mklink /j "C:\ProgramData\DockerDesktop" "D:\Program Files\Docker\ProgramDataDockerDesktop"
mklink /j "C:\Program Files\Docker" "D:\Program Files\Docker\ProgramFiles"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker Desktop" "D:\Program Files\Docker\RoamingDockerDesktop"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker" "D:\Program Files\Docker\RoamingDocker"
mklink /j "C:\Users\Administrator\AppData\Local\Docker" "D:\Program Files\Docker\AppDataDocker"

You'll need to replace "Administrator" with your Windows user name and "D:\Program Files\Docker" with whatever your desired destination folder is.

@sinaqahremani
Copy link

sinaqahremani commented Jan 18, 2022

I was able to achieve this by manually creating symlinks. Here's my setup, everything goes into "D:\Program Files\Docker". Run this before installing Docker Desktop

md "D:\Program Files\Docker\ProgramDataDocker"
md "D:\Program Files\Docker\ProgramDataDockerDesktop"
md "D:\Program Files\Docker\ProgramFiles"
md "D:\Program Files\Docker\RoamingDockerDesktop"
md "D:\Program Files\Docker\RoamingDocker"
md "D:\Program Files\Docker\AppDataDocker"

mklink /j "C:\ProgramData\Docker" "D:\Program Files\Docker\ProgramDataDocker"
mklink /j "C:\ProgramData\DockerDesktop" "D:\Program Files\Docker\ProgramDataDockerDesktop"
mklink /j "C:\Program Files\Docker" "D:\Program Files\Docker\ProgramFiles"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker Desktop" "D:\Program Files\Docker\RoamingDockerDesktop"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker" "D:\Program Files\Docker\RoamingDocker"
mklink /j "C:\Users\Administrator\AppData\Local\Docker" "D:\Program Files\Docker\AppDataDocker"

You'll need to replace "Administrator" with your Windows user name and "D:\Program Files\Docker" with whatever your desired destination folder is.

I appreciate your solution and consider it as a good one for my challenge, but I think such an application in this scale of usability must provide this feature.

@stephanierifai
Copy link
Contributor

Thanks all for your continued input! No updates yet, but going to look a bit more into it with the team.

@mouhsineelachbi
Copy link

Actually this feature is really demanded, It shows user that they have choices about where they can put file of installed software

@CatalinSerafimescu
Copy link

Looks like Microsoft "resolved" it:

Unhandled Exception: System.Exception: Path contains symlink: C:\ProgramData\DockerDesktop
at Docker.Core.PermissionUtils.CheckPath(String path, Boolean allowDockerAppData) in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Core\PermissionUtils.cs:line 274
at Docker.Core.PermissionUtils.CheckACLBeforeRestrictAndCheckSymlink(ILogger logger, String path) in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Core\PermissionUtils.cs:line 93

@mouhsineelachbi
Copy link

Looks like Microsoft "resolved" it:

Unhandled Exception: System.Exception: Path contains symlink: C:\ProgramData\DockerDesktop at Docker.Core.PermissionUtils.CheckPath(String path, Boolean allowDockerAppData) in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Core\PermissionUtils.cs:line 274 at Docker.Core.PermissionUtils.CheckACLBeforeRestrictAndCheckSymlink(ILogger logger, String path) in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Core\PermissionUtils.cs:line 93

How they solve It ?

@CatalinSerafimescu
Copy link

CatalinSerafimescu commented May 4, 2022

It explicitly checks for symlinks and blocks the installation. @gallargit 's solution doesn't work anymore. Though one can install it, then move the folders. For me it needed 3 tries until it started eventually (it took a while to initialize)

@mouhsineelachbi
Copy link

It explicitly checks for symlinks and blocks the installation. @gallargit 's solution doesn't work anymore. Though one can install it, then move the folders. For me it needed 3 tries until it started eventually (it took a while to initialize)

Fool me, I though they really solved it

@usama-saeed831
Copy link

This solution help me in 2022
https://blog.codetitans.pl/post/howto-docker-over-wsl2-location/

@dieucao dieucao assigned dieucao and mat007 and unassigned dieucao May 20, 2022
@mat007
Copy link
Member

mat007 commented Nov 4, 2022

@charithjayasanka you may want to quote the path:

 "Docker Desktop Installer.exe" install --installation-dir="D:\Program Files\Docker"

@luucaslfs
Copy link

This is no good. We need a way to store all the container and image data in another drive, not just docker install files

@mat007
Copy link
Member

mat007 commented Nov 4, 2022

For being able to configure the location of the data, there is a separate issue, see e.g. my comment there.

@andrei-z-albu
Copy link
Member

Closing this due to the new installer flag used to change the installation location. For changing where Docker Desktop stores it's data please follow progress on the following roadmap item here

@caner-cetin
Copy link

Closing this due to the new installer flag used to change the installation location. For changing where Docker Desktop stores it's data please follow progress on the following roadmap item here

...are you serious? This still doesnt work.

.\Docker.exe install --installation-dir=D:\Docker

Does NOT work!

PS D:\> .\Docker.exe install --installation-dir=D:\Docker
PS D:\> -------------------------------------------------------------------------------->8
Version: 4.17.0 (99724)
Sha1:
Started on: 2023/03/17 16:53:28.438
Resources: D:\resources
OS: Windows 10 Pro
Edition: Professional
Id: 2009
Build: 19045
BuildLabName: 19041.1.amd64fre.vb_release.191206-1406
File: C:\ProgramData\DockerDesktop\install-log-admin.txt
CommandLine: "D:\Docker.exe" install --installation-dir=D:\Docker
You can send feedback, including this log file, at https://github.com/docker/for-win/issues
[2023-03-17T16:53:28.635419400Z][ManifestAndExistingInstallationLoader][I] Install path is D:\Docker. Loading manifest first
[2023-03-17T16:53:28.644420200Z][ManifestAndExistingInstallationLoader][I] No manifest found, returning no existing install
[2023-03-17T16:53:28.644420200Z][Installer][I] No installation found
[2023-03-17T16:53:28.872417900Z][InstallWorkflow][I] Cancel pending background download
[2023-03-17T16:53:28.875418500Z][BackgroundTransfer][I] Cancel current background transfer job
[2023-03-17T16:53:28.886421200Z][InstallWorkflow][I] Using package: res:DockerDesktop
[2023-03-17T16:53:28.887419200Z][InstallWorkflow][I] Downloading
[2023-03-17T16:53:29.074420900Z][InstallWorkflow][E] Installation failed System.Exception: Download failed: Diskte yeterli yer yok.

this tries to download to C DRIVE. year is 2023, and I cannot pick where I can install the software, well done, bravo, woohoo!

@caner-cetin
Copy link

Someone please re-open this issue. The issue he leads to #239 is completely unrelated with INITIAL installation of Docker Desktop. NOT Docker Data. DOCKER DESKTOP.

@tyoc213
Copy link

tyoc213 commented Apr 8, 2023

Why it is difficult to set the desired path for docker after 3 years?

using "Docker Desktop Installer.exe" install --installation-dir="D:\Program Files\Docker" I get a permanent

docker ps
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.

image

@christophermclellan
Copy link
Collaborator

Hi, apologies that there continues to be some difficulty with changing the default installation drive. I've made a note of the various issues and we're going to look at these in planning early next week.

@kt-bouse
Copy link

Just to provide a bit more "current" info, since much of what I see is 5-7 years old.
Device name -----
Processor AMD Ryzen 7 2700X Eight-Core Processor 3.70 GHz
Installed RAM 48.0 GB
Device ID -----
Product ID -----
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Edition Windows 10 Pro
Version 22H2
Installed on -----
OS build 19045.2846
Experience Windows Feature Experience Pack 120.2212.4190.0
WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2846
Default Distribution: Ubuntu-20.04
Default Version: 2
NAME STATE VERSION

  • Ubuntu-20.04 Stopped 2
    Debian-11 Stopped 2

I am using WSL2 (most recent, installed from MS Store) to do cross-compilation on Windows for a custom Yocto-based distribution that requires Docker. So I am attempting to install Docker Desktop on my Windows system rather than a Linux Docker Desktop inside a WSL2 Distro. This is because much (most) of the application container development will be done using Windows, so I want to understand the process and be able to help get developers up-and-running. You can't give them a development container if you can't get the environment working...

For my Linux distros, they also installed "by default" on the C: drive under AppData -- but I was able to successfully move them to my external development drive (8TB) ... this simply required wsl --shutdown, move the .vhdx files to the desired location, and then (1) edit the base path in the registry /or/ (2) use wsl --import-in-place ... I have done it both ways and had no issues. I have also modified the .vhdx descriptor, and used fdisk inside the distro, to extend the storage space available inside the WSL2 environment (20GB -> 128GB to support Yocto builds) -- again, with no issues.

After having installed Docker Desktop 4.19.0 (106363) once, and finding it placed 3GB of program and another 2GB of Linux distros and sundry on my C drive, I attempted the same process to move the Docker distros. It worked for one (wsl\data), but not the other (wsl\distro); every time I restarted Docker it would recreate the wsl\distro .vhdx on the C drive under AppData\Local in addition to some stuff under ProgramData. And like others have mentioned, I could not change the path for the "image" under Settings -> Resources, so it's pretty obvious there must be some "magic strings" lurking and/or no accounting for moving across volumes rather than just renaming within one.

Doing some research, I was initially "excited" to see the --installation-dir option for installing. So I uninstalled, and re-installed using that method. Unfortunately, it didn't work ... in fact, it failed rather spectacularly.

I am completely baffled why anyone would distribute a system in 2023 without the ability for the user to completely control where everything is stored. Not just the program and supporting infrastructure, not just the output data --- everything.

I get it: this was originally created under Linux, and then "ported and adapted" to Windows -- but that only leaves me more confused, because most Linux users/admins are positively rabid about controlling their systems, mounting separate drives for large databases, etc. Yet the equivalent under Windows -- junction points -- has apparently been explicitly disabled! The very technique any Linux sysad would immediately use (graft a new drive onto the filesystem at the point of use) has been disallowed for Windows installs!

I have no idea how the Docker devs work; maybe like one of my other vendors they have access to systems with 32 cores and 64GB of memory, with effectively infinite storage on their C: drive ... or maybe they work totally in Linux and have zero experience with Windows.

Regardless, many devs who need to use Docker are working on Windows machines, with controlled resources, and can't afford to run the Docker system inside a Linux VM or WSL2 distro. Many companies "lock down" the C drive, or at least provide drives just large enough to boot and then expect all tools and data to be on an external drive.

I am heartened to see this issue has been re-opened, with a recognition that the initial solution didn't work. I'm not sure why this issue has remained open for 5+ years -- perhaps the Windows dev community is simply too small? -- but we need a real, robust, solution built into the installer, not requiring people to run hither and yon attempting to patch together a Chucky-doll of a solution that works for some but not others.

Thanks, and Best Regards,
k

@BellemareMederic
Copy link

2023 cannot choose where i install my wsl docker disk... it's so sad 😢

@MihaelaStoica
Copy link

Thank you for your patience on this. We had fixed the issue with changing the installation drive. This will be included in the next Docker Desktop release, due at the end of this month.

@caner-cetin
Copy link

Thanks Mihaela! #464 is also solved, but it is closed anyways.

@Quang2003-SpicyCarrot
Copy link

Hi guys, I recently trying to download DockerDesktop 4.21.1 and I think i successfully installed Docker to different path. By using the cmd, I changed the current directory to the directory that the installed DockerInstaller.exe file is in, then I typed this into the cmd:

start /w "" "Docker Desktop Installer.exe" install --installation-dir=E:\Other_tool\VSCode\Downloaded-package-local\Docker

And it started to download the packages to the mentioned path above.

I hope this helps somehow to you guys

@CodePlayer
Copy link

Hi, apologies that there continues to be some difficulty with changing the default installation drive. I've made a note of the various issues and we're going to look at these in planning early next week.

My disk C is FULL space.
Has the latest version been able to customize the installation directory ?
It's already 2023, still can't support it?

@christophermclellan
Copy link
Collaborator

christophermclellan commented Aug 2, 2023

Hi @CodePlayer, as per comment above from @MihaelaStoica , this was resolved in Docker Desktop v4.20 (released end of May). Let us know if any issues once you've tried on a version of Docker Desktop >= v4.20. Cheers, Chris

@vitorogen
Copy link

Hi @CodePlayer, as per comment above from @MihaelaStoica , this was resolved in Docker Desktop v4.20 (released end of May). Let us know if any issues once you've tried on a version of Docker Desktop >= v4.20. Cheers, Chris

I believe that the installation directory is irrelevant when considering disk space usage. The primary space consumption in Docker Desktop is attributed to image storage, which is downloaded by default to %ProgramData%\Docker and it cannot be changed anywhere. This issue becomes even worse when dealing with windows images.
The recent patch blocking the usage of directory junctions to bypass this limitation made this software unusable for anyone that has to deal with large images and use small SSD drives or partitioned drives for their OS.

@MihaelaStoica
Copy link

Both the installation and the data directories can be changed at install time, see the installer flags here. This issue can be closed.

@LavredisG
Copy link

An option for anyone using the interactive installation would be helpful too.

@dare2netsec
Copy link

2024 and we're still stuck with an installer from 1995. Hello people from 2027! I'm sure you'll be here when the time comes.

@CatalinSerafimescu
Copy link

2024 and we're still stuck with an installer from 1995. Hello people from 2027! I'm sure you'll be here when the time comes.

I ceased trying to use Docker Desktop. Last time I installed it (on a different drive), still eat 10GB from my system drive.
I have installed docker on WSL and live happily ever after

@hsbtr
Copy link

hsbtr commented May 18, 2024

C disk capacity is small because of this problem into storage anxiety

@MichaelNZ85
Copy link

Both the installation and the data directories can be changed at install time, see the installer flags here. This issue can be closed.

Why should we have to use command-line flags? Why not simply include the option to choose a data directory in the graphical installer like many other applications do?

@kinshuk-code-1729
Copy link

kinshuk-code-1729 commented May 22, 2024

I was able to achieve this by manually creating symlinks. Here's my setup, everything goes into "D:\Program Files\Docker". Run this before installing Docker Desktop

md "D:\Program Files\Docker\ProgramDataDocker"
md "D:\Program Files\Docker\ProgramDataDockerDesktop"
md "D:\Program Files\Docker\ProgramFiles"
md "D:\Program Files\Docker\RoamingDockerDesktop"
md "D:\Program Files\Docker\RoamingDocker"
md "D:\Program Files\Docker\AppDataDocker"

mklink /j "C:\ProgramData\Docker" "D:\Program Files\Docker\ProgramDataDocker"
mklink /j "C:\ProgramData\DockerDesktop" "D:\Program Files\Docker\ProgramDataDockerDesktop"
mklink /j "C:\Program Files\Docker" "D:\Program Files\Docker\ProgramFiles"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker Desktop" "D:\Program Files\Docker\RoamingDockerDesktop"
mklink /j "C:\Users\Administrator\AppData\Roaming\Docker" "D:\Program Files\Docker\RoamingDocker"
mklink /j "C:\Users\Administrator\AppData\Local\Docker" "D:\Program Files\Docker\AppDataDocker"

You'll need to replace "Administrator" with your Windows user name and "D:\Program Files\Docker" with whatever your desired destination folder is.

This solution didn't worked for me @gallargit . I have created the symlinks following your commands like :

md "E:\Program Files\Docker\ProgramDataDocker"
md "E:\Program Files\Docker\ProgramDataDockerDesktop"
md "E:\Program Files\Docker\ProgramFiles"
md "E:\Program Files\Docker\RoamingDockerDesktop"
md "E:\Program Files\Docker\RoamingDocker"
md "E:\Program Files\Docker\AppDataDocker"

mklink /j "C:\ProgramData\Docker" "E:\Program Files\Docker\ProgramDataDocker"
mklink /j "C:\ProgramData\DockerDesktop" "E:\Program Files\Docker\ProgramDataDockerDesktop"
mklink /j "C:\Program Files\Docker" "E:\Program Files\Docker\ProgramFiles"
mklink /j "C:\Users\Kinshuk Banerjee\AppData\Roaming\Docker Desktop" "E:\Program Files\Docker\RoamingDockerDesktop"
mklink /j "C:\Users\Kinshuk Banerjee\AppData\Roaming\Docker" "E:\Program Files\Docker\RoamingDocker"
mklink /j "C:\Users\Kinshuk Banerjee\AppData\Local\Docker" "E:\Program Files\Docker\AppDataDocker"

But it gave me this error while running the Docker Desktop Installer :

For security reasons C:\ProgramData\DockerDesktop cannot be a symlink.

Here's the screenshot of above issue :

image

I have tried to run Docker Installer as Administrator but still didn't worked and it displayed the same issue again.

@gallargit
Copy link

Well, I haven't used Docker for a while and it seems my original solution does not work anymore as Docker itself has blocked it. It's a real shame they did that. What I would do is either get a new C: drive or move the entire C:\ProgramData folder to a different drive, as explained here:
https://superuser.com/questions/445654/how-to-move-completely-the-programdata-folder-from-one-partition-in-to-another-p
I haven't tried this myself, so be careful with that. You may destroy your Windows installation.

Another workaround that might work is moving individual virtual machine folders immediately after they are created, while their size is still small, using the same symlink technique.

Or there's always the option of using an old Docker Desktop version and do not update it, ever 😄

@CatalinSerafimescu
Copy link

I ceased to use Docker Desktop after its Scout almost left me without space on system drive. I deactivated it, and I was still using a different drive for data, but it eat space on system drive at each command. So I uninstalled.
Thanks to a smart guy, I installed docker (simple docker) on WSL2 and I am happy now

@elvirag
Copy link

elvirag commented May 23, 2024

Actually, the line I used is:
& '.\Docker Desktop Installer.exe' install --installation-dir=D:\Programming\Docker
It worked

@lostpassword
Copy link

lostpassword commented Jul 6, 2024

Thanks @elvirag for the command!
I would also add that it might be worth changing image location for some people like me. I found the solution here:
https://stackoverflow.com/questions/75727062/how-to-install-docker-desktop-on-a-different-drive-location-on-windows
The command is
& '.\Docker Desktop Installer.exe' install --installation-dir=E:\Docker --wsl-default-data-root=E:\Docker_images

Somehow, changing this in the Docker options in GUI was not possible after the installation for me.
Would be great if we could specify all that in the installer's GUI as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_new New idea raised by a community contributor docker_desktop Improvements or additions to Docker Desktop
Projects
Status: Upcoming
docker-roadmap
  
Upcoming
Development

No branches or pull requests