Move MobyLinuxVM.vhdx to another drive

Docker for win create the hard drive for MobyLinuxVM in
C:\Users\Public\Documents\Hyper-V\Virtual hard disks
which I think is not a good practice as it can consume a lot of space on the C drive.

I stopped docker, moved MobyLinuxVM hard disk to a new drive, docker crashed.
Is it not allowed? If no, how can we acheive this?
Thanks

How did you move the MobyLinuxVM? I wouldn’t expect it to work if you use the Hyper-V application.

The ability to move is fairly new in the Docker for Windows beta channel: https://docs.docker.com/docker-for-windows/release-notes/#/beta-33-release-notes-2016-12-15-1130-rc3-beta33

I don’t have another drive to test with, but moving using the new Docker for Windows GUI option works for me on beta34 with Win10. Does that work for you?

After moving it updates my %APPDATA%\Docker\settings.json with a "MobyVhdPathOverride":"C:\\Users\\Public\\Documents\\Hyper-V\\New folder\\MobyLinuxVM.vhdx" setting. Note the New Folder in there

Hi, I have 1.13 RC 4 and but the Images and VHD box and associated Browse button are greyed out in advanced tab, Can you please let me know how I can do this?
Thanks in davnce

So same version as me then.

Sorry not sure I can help when it’s greyed out, apart from that I just noted it’s greyed out until the Linux container mode is in a running state (note the green “running” dot in my screenshot). Just saw that now while switching from windows containers.

Id switched to windows containers, then back to linux containers and still greyed out and can not enter anything. Also, I am wondring, how we can change Memory size if we need to

Well, as you can see in the image posted above the CPU/memory sliders are also not greyed out for me, so that those does not work in your environment does not really add much new info.

Something is clearly not right in your environment (but working elsewhere, e.g. for me). Whatever the settings application is looking for to “un-greyout” does not happen on your machine. Have you tried a factory reset?

If factory reset or a complete un/reinstall doesn’t clean up your environment I guess you can open an issue on GitHub providing as much info about your environment as possible via Diagnose & Feedback posting the diagnostic ID OS version etc.

I just did a factory reset. The Advanced Settings still works after that. Here a few detailed observations I hope will be useful to someone who need to troubleshoot their environment:

Factory reset also resets %APPDATA%\Docker\settings.json including the VHD location which now is null so it points to the original location. To learn a bit about how reset works before doing the reset I had set an alternative location for the VHD. The factory reset apparently removes a possible MobyLinuxVM VHD in the factory location (observed in Hyper-V) but leaves a possible alternative VHD alone. If the reset is performed while in Windows container mode it is on switching to Linux container mode the re-download of the VHD is triggered.

Just found this related issue already reported https://github.com/docker/for-win/issues/347#issuecomment-269043422 which I commented a bit on.

Your original issue is probably due to the same (that you did a complete move including the .iso?). So, maybe there is a workaround for you if you can’t get the Advanced Settings enabled via factory reset or reinstall:

  1. Shut off Docker

  2. Edit you MobyVhdPathOverride as I commented on above

  3. In Hyper-V move just the VHD but let the .iso etc stay

  4. Cross your fingers & start docker

jornh, I tried all, I even removed docker for windows, rebooted my VM, downloaed lsat version and did a frsh new setup, getting the exact same behavior, memory sizing and image locations are greyed out.
I am more than sure that there is an issue with this functionality.
I hope that somebody from docker can respond to this thread

Also, I want to add that by reseting Docker destroys all images and containers, I took this risk for nothing

Ah, you’re in a VM - I’m on a physical Win10. So there’s one difference that probably complicates it. Maybe that scenario isn’t supported with virtualization in virtualization? Guess it could even differ depending on which “outer” VM brand is used …

Can’t you get around the whole issue by moving your complete VM to the other drive then?

I have already done this yesterday, restarting docker for windows goes back to the VM in c\user…\public by itself

Jornh, do you work for docker or yiu are an end user like me?

Just another end user here trying to figure things out and learn along the way :slight_smile:

I’m sure the Docker staff will return after some well deserved holiday rest with their families and friends.

I see, merry Xmass and happy new year to you and all the docker team. From my short experience working with Docker (1 year), I have noticed that docker team are not so active and reactive to those forums. I can understand that they are a small company and may not have time to respond to threads

My workaround with MKLINK

stop docker engine

create a target folder in the new location:

mkdir d:\docker\vhd

copy the VHD “MobyLinuxVM.vhdx” to the target folder

rename (and backup) the original folder

rename “C:\Users\Public\Documents\Hyper-V\Virtual hard disks” “C:\Users\Public\Documents\Hyper-V\Virtual hard disks_backup”

create a hard symbolic link (junction)

mklink /J “C:\Users\Public\Documents\Hyper-V\Virtual hard disks” d:\docker\vhd

start docker engine