3

It downloads openshift into C:\Users\[user]\.minishift\machines folder. How to change this location to, say, D:\My VMs\? The config set is not very helpful in explaining setting which config for which.

  • Minishift verision: v1.15.1
  • Platform: Windows
  • Driver: Hyper-V

Any help would be greatly appreciated.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
Gopikrishna S
  • 2,221
  • 4
  • 25
  • 39

2 Answers2

4

It looks like the machines directory can't be set directly through config. It is set relative to a base directory in instance_dirs.go.

That base directory, by default, is the .minishift directory in the home directory of the user, e.g. C:\Users\[user]\.minishift on Windows, but this can be overridden by setting the environment variable MINISHIFT_HOME.

The base directory could also be a profile directory, if you are not using the default profile (the default being minishift).

$ minishift profile list
- minishift Stopped
$ minishift profile myprofile
Profile 'myprofile' set as active profile.

The machines directory for myprofile would then be created under $MINISHIFT_HOME/profiles/myprofile/machines, e.g. on Windows C:\Users\[user]\.minishift\profiles\myprofile\machines.

So you can set MINISHIFT_HOME and move the whole contents of the .minishift directory, including machines, somewhere else but it doesn't look like you can move just machines alone.

Perhaps, you could solve this at the OS-level by creating a symlink between C:\Users\[user]\.minishift\machines and D:\My VMs\.

codemonkey
  • 3,510
  • 3
  • 23
  • 35
  • 1
    +1 for symlink suggestion. Thank you for the reply. Also: 1) I also found in the meantime from the devs that adjusting MINISHIFT_HOME might have side effects and is not officially supported 2) You can move just the machines to a different location through hypervisor but reprovisioning might be tricky – Gopikrishna S Apr 24 '18 at 14:22
0

In case it helps others and so they don't need to test the different ways of using symlink as well as to expand on @codemonkey great answer this is what I did to use symlink as my C drive had no available space. I'm also using hyper-v as the driver.
Note: I do have minishift.exe installed in the apps folder on my D drive
Note 2: I did have to run the command prompt in admin mode

  1. From the C:\Users\[user]\.minishift folder I moved the "machines" folder to D:\Apps\minishift-1.32.0-windows-amd64\
  2. I first tried a soft link which didn't work, I then tried a hadr link, but I was getting errors so I used a "directory junction" link with the /J switch as such C:\WINDOWS\system32>mklink /J C:\Users\[user]\.minishift\machines D:\Apps\minishift-1.32.0-windows-amd64\machines
  3. You should get the following result Junction created for C:\Users\[user]\.minishift\machines <<===>> D:\Apps\minishift-1.32.0-windows-amd64\machines
  4. Then if necessary run minishift delete --clear-cache WARNING this will delete any previous images and hosts you might have!
  5. Then start minishift as normal with minishift start
  6. Grab a cup of coffee or go smoke a cigarette or vape as it will take awhile for the OpenShift server to be started.

    Hope this answer might help others who face a similar issue.
JGlass
  • 1,427
  • 2
  • 12
  • 26