crc icon indicating copy to clipboard operation
crc copied to clipboard

[Request] - Change the Machine Folder (.crc) location during installation

Open tal-hason opened this issue 2 years ago • 8 comments

Hi after installing the Code Ready Containers On windows i noticed that it store the VM in the OS drive.

I want to change the VM drive to a different drive (Bigger / Faster) and I don't want to break the system.

is it possible to added during the installation or in the config menu to set the VM and Cache (.crc) folder to a different path (such as another drive)

tal-hason avatar Apr 18 '22 09:04 tal-hason

Which platform is this reported for?

gbraad avatar Apr 18 '22 10:04 gbraad

Sorry forgot to mention it **edited the Original Comment ,the OS in Windows :-)

tal-hason avatar Apr 18 '22 10:04 tal-hason

Update: from #3114 I assume this is Windows, but thanks for confirming.

There is however an issue that is inherited from minishift and machine drivers. The virtualization files and the executable need to be on the main drive, identical to what is WINDIR to work properly. An alternative might be possible, but we never got around to resolving this. However, the situation would be the same for a WSL2 environment, so it has been marked as a non-issue and mostly a shortcoming in how Hyper-V on a 'desktop class' OS handles this.

Note: You might try something with junctions or relocating a path using Disk Manager to be on another disk, but these are non-supportable scenarios.

gbraad avatar Apr 18 '22 10:04 gbraad

Thanks for the answer, but both wsl2 rootfs and virtual drive can be set at a different location, i have a fedora wsl2 on my D: drive that is running without any issues and all my other VM's are also stored on drive D.

tal-hason avatar Apr 18 '22 10:04 tal-hason

(my memory of this might be wrong) it is a limitation with the original machine driver, it stores the artifacts in the user profile. when this isn't the case, the driver is unable to get the right permissions. You are free to experiment of course as at the moment this is not a priority for us. though, if this can be solved, that would be great. At the moment there is no OOTB solution for this.

gbraad avatar Apr 18 '22 10:04 gbraad

HI @gbraad you mean i can try to move the vdhx of the machine from it location (.crc) to where ever i want and test if it not broken? Screenshot 2022-04-19 082816

i went over the files in the machines\crc folder and inotice that in the config.json file there are configuration related to the machine location. Screenshot 2022-04-19 083032

so in order to move the vhdx i need to update the file? am i correct Screenshot 2022-04-19 083423

tal-hason avatar Apr 19 '22 05:04 tal-hason

I didn't say that; CRC has a reference to the hypervisor monitor, and both use their own references. I suggested 'junctions'. If you are unfamiliar to this it might better not to try this.

gbraad avatar Apr 19 '22 06:04 gbraad

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 19 '22 07:06 stale[bot]