Skip to content

Conversation

james-world
Copy link
Contributor

fixes #20529

getWindowsVolumeNameCmd uses the deprecated wmic.exe, this breaks minikube image load on newer installs of windows. Whilst wmic.exe can be added, it will be removed from Windows 11 soon.

See here for details.

This fix replaces the use of wmic.exe with a call to the Powershell equivalent.

Copy link

linux-foundation-easycla bot commented Jun 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: james-world / name: James World (e17b3f4)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @james-world!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @james-world. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 10, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 10, 2025
@james-world james-world changed the title Fix minikube load on windows (#20529) Fix minikube image load on windows (#20529) Jun 10, 2025
@james-world james-world force-pushed the fix-20529 branch 2 times, most recently from 7a66934 to 211296e Compare June 12, 2025 10:27
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 12, 2025
@james-world james-world requested a review from medyagh June 12, 2025 20:44
@gabrielgbs97
Copy link

If powershell.exe is not available in PATH (it should be...) it can be discovered via SystemRoot env variable:
'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

@spowelljr spowelljr removed their request for review June 26, 2025 23:50
@james-world
Copy link
Contributor Author

OK, sorry for the hiatus - been busy at work. @medyagh I've removed the fallback as discussed and added code to robustly discover Powershell.exe, using the cited approaches.

@medyagh
Copy link
Member

medyagh commented Jul 9, 2025

thank you @james-world, let me ask @bobsira for last approve and then we can merge it
@bobsira can you plz test this on windows and see if it fixes the issue?

Copy link

@bobsira bobsira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this on Windows machine, works fine! Approved @medyagh

Had a successful run with the changes,

`C:\dev\minikube\out>minikube.exe image load nginx:latest --alsologtostderr I0714 02:30:21.918732 24816 out.go:345] Setting OutFile to fd 96 ... I0714 02:30:21.949424 24816 out.go:392] TERM=,COLORTERM=, which probably does not support color I0714 02:30:21.949424 24816 out.go:358] Setting ErrFile to fd 100... I0714 02:30:21.950091 24816 out.go:392] TERM=,COLORTERM=, which probably does not support color I0714 02:30:21.969639 24816 config.go:182] Loaded profile config "minikube": Driver=hyperv, ContainerRuntime=docker,
KubernetesVersion=v1.33.2

=== some of the logs removed to have this fit in the comment

I0714 02:30:36.438734 24816 cache_images.go:123] Successfully loaded all cached images I0714 02:30:36.438734 24816 cache_images.go:92] duration metric: took 5.9631078s to LoadCachedImages I0714 02:30:36.439366 24816 cache_images.go:262] succeeded pushing to: minikube `

@medyagh
Copy link
Member

medyagh commented Jul 14, 2025

@james-world plz see last comments and then we can merge this

getWindowsVolumeNameCmd uses the deprecated wmic.exe.

See https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic for
details.

Replace the implementation with a call to the Powershell equivalent.

Look in path and system environment vars to locate Powershell.

Improve Powershell discovery
@james-world
Copy link
Contributor Author

@medyagh Added the requested comment.

@james-world james-world requested a review from medyagh July 16, 2025 01:42
@medyagh
Copy link
Member

medyagh commented Jul 21, 2025

thank you @james-world

@medyagh
Copy link
Member

medyagh commented Jul 21, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 21, 2025
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 49.5s    │ 50.5s                  │
│ enable ingress │ 15.0s    │ 15.3s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 49.2s 50.9s 48.2s 48.4s 50.8s
Times for minikube (PR 20921) start: 49.3s 48.8s 49.4s 52.7s 52.3s

Times for minikube ingress: 15.0s 15.0s 15.0s 14.9s 14.9s
Times for minikube (PR 20921) ingress: 15.1s 15.0s 15.5s 15.9s 15.0s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.9s    │ 23.2s                  │
│ enable ingress │ 12.3s    │ 12.5s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 25.2s 22.3s 21.8s 26.9s 23.1s
Times for minikube (PR 20921) start: 23.0s 24.3s 25.2s 21.4s 22.2s

Times for minikube ingress: 10.7s 12.7s 12.7s 12.7s 12.7s
Times for minikube (PR 20921) ingress: 12.2s 12.7s 11.2s 13.8s 12.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 20921 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.4s    │ 22.4s                  │
│ enable ingress │ 29.2s    │ 24.4s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 24.1s 24.1s 23.5s 21.0s 24.1s
Times for minikube (PR 20921) start: 20.6s 25.2s 21.2s 22.9s 22.2s

Times for minikube ingress: 22.7s 38.8s 38.7s 23.3s 22.7s
Times for minikube (PR 20921) ingress: 22.7s 22.7s 22.7s 31.2s 22.7s

@rata
Copy link
Member

rata commented Jul 23, 2025

The failures seem unrelated to this PR (failed to pull an image)

@james-world
Copy link
Contributor Author

james-world commented Jul 27, 2025

@medyagh I've started to see this kind of error at work; it's docker.io rate-limiting. Definitely nothing to do with this PR.

The rate limiting on anonymous logins is by IP - see here. That means if you are using any shared IP on the build agent pool you can hit limits faster than you might think.

We've addressed it by using pull-through caches (we use ACR for this: https://learn.microsoft.com/en-us/azure/container-registry/artifact-cache-overview)

Guess minikube would need to cut a deal with docker.io, or do something similar.

@james-world
Copy link
Contributor Author

@medyagh Just following up on this - not sure what else I can do? I'm pretty sure the build failure here is an unrelated transient issue with throttled image pulls from docker registry. Anything I can do to help move it along?

@medyagh
Copy link
Member

medyagh commented Aug 7, 2025

@medyagh I've started to see this kind of error at work; it's docker.io rate-limiting. Definitely nothing to do with this PR.

The rate limiting on anonymous logins is by IP - see here. That means if you are using any shared IP on the build agent pool you can hit limits faster than you might think.

We've addressed it by using pull-through caches (we use ACR for this: https://learn.microsoft.com/en-us/azure/container-registry/artifact-cache-overview)

Guess minikube would need to cut a deal with docker.io, or do something similar.

thank you for sharing that I will check that out. we have two different rate limit issue,
on the host we login, but inside minikube, minikube itself pull images for addons and things like that that causes rate limit. one option would be login to docker inside minikube as well

I will checkout the caching you have linked

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: james-world, medyagh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2025
@medyagh
Copy link
Member

medyagh commented Aug 7, 2025

thank you very much @james-world for your patience and presistance and making minikube better for our windows users, I look forward to see more contributions from you, maybe you could join one of our Office Hours or Triage Parties
https://minikube.sigs.k8s.io/community/

@medyagh medyagh merged commit f4dd7b4 into kubernetes:master Aug 7, 2025
28 of 38 checks passed
pavansaikrishna78 pushed a commit to pavansaikrishna78/minikube that referenced this pull request Aug 11, 2025
getWindowsVolumeNameCmd uses the deprecated wmic.exe.

See https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic for
details.

Replace the implementation with a call to the Powershell equivalent.

Look in path and system environment vars to locate Powershell.

Improve Powershell discovery
pavansaikrishna78 pushed a commit to pavansaikrishna78/minikube that referenced this pull request Aug 18, 2025
getWindowsVolumeNameCmd uses the deprecated wmic.exe.

See https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic for
details.

Replace the implementation with a call to the Powershell equivalent.

Look in path and system environment vars to locate Powershell.

Improve Powershell discovery
pavansaikrishna78 pushed a commit to pavansaikrishna78/minikube that referenced this pull request Sep 9, 2025
getWindowsVolumeNameCmd uses the deprecated wmic.exe.

See https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic for
details.

Replace the implementation with a call to the Powershell equivalent.

Look in path and system environment vars to locate Powershell.

Improve Powershell discovery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube image load my-local-image:latest ❌ Exiting due to GUEST_IMAGE_LOAD
8 participants