Skip to content

build deps: Move hyperv and virtualbox drivers to minikube#21966

Merged
medyagh merged 3 commits intokubernetes:masterfrom
afbjorklund:internal-drivers
Dec 20, 2025
Merged

build deps: Move hyperv and virtualbox drivers to minikube#21966
medyagh merged 3 commits intokubernetes:masterfrom
afbjorklund:internal-drivers

Conversation

@afbjorklund
Copy link
Copy Markdown
Collaborator

@afbjorklund afbjorklund commented Nov 22, 2025

BEFORE

vendor/github.com/docker/machine/drivers/hyperv/
├── hyperv.go
└── powershell.go
vendor/github.com/docker/machine/drivers/virtualbox/
├── disk.go
├── ip.go
├── misc.go
├── network.go
├── vbm.go
├── virtualbox_darwin.go
├── virtualbox_freebsd.go
├── virtualbox.go
├── virtualbox_linux.go
├── virtualbox_openbsd.go
├── virtualbox_windows.go
├── vm.go
├── vtx.go
├── vtx_intel.go
└── vtx_other.go

AFTER

pkg/drivers/hyperv/
pkg/drivers/virtualbox/
--- a/pkg/minikube/registry/drvs/hyperv/hyperv.go
+++ b/pkg/minikube/registry/drvs/hyperv/hyperv.go
@@ -27,3 +27,2 @@ import (
 
-       "github.com/docker/machine/drivers/hyperv"
        "github.com/docker/machine/libmachine/drivers"
@@ -31,2 +30,3 @@ import (
 
+       "k8s.io/minikube/pkg/drivers/hyperv"
        "k8s.io/minikube/pkg/minikube/config"
--- a/pkg/minikube/registry/drvs/virtualbox/virtualbox.go
+++ b/pkg/minikube/registry/drvs/virtualbox/virtualbox.go
@@ -26,3 +26,2 @@ import (
 
-       "github.com/docker/machine/drivers/virtualbox"
        "github.com/docker/machine/libmachine/drivers"
@@ -30,2 +29,3 @@ import (
        "k8s.io/klog/v2"
+       "k8s.io/minikube/pkg/drivers/virtualbox"
        "k8s.io/minikube/pkg/minikube/config"

Preparing for making the libmachine API internal

Part of the issue to remove legacy docker machine:

The other PR got too big to review, since it did both.

Both imported 4 drivers, and imported libmachine:


We still need to import the other 2 (obsolete) drivers:

github.com/minikube-machine/machine-driver-parallels

github.com/minikube-machine/machine-driver-vmware

Before we can move the libmachine API over to internal.

Or you could delete them instead, to avoid the imports.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 22, 2025
@afbjorklund afbjorklund requested review from medyagh and nirs and removed request for ComradeProgrammer and prezha November 22, 2025 12:26
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 22, 2025
@afbjorklund
Copy link
Copy Markdown
Collaborator Author

Nice to get rid of the old Docker dependencies from the go.mod, when dropping the Docker Machine depends...

-github.com/docker/docker v0.0.0-20180621001606-093424bec097/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
-github.com/docker/docker v17.12.0-ce-rc1.0.20181225093023-5ddb1d410a8b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
-github.com/docker/docker v17.12.0-ce-rc1.0.20190115220918-5ec31380a5d3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
 github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 ...
-github.com/moby/term v0.0.0-20200416134343-063f2cd0b49d/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
 github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
 github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
-github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3 h1:LO7khkb1P2LpqCL8GnqPBPn1lZeqA/bqRinjveU2EaQ=
-github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3/go.mod h1:wrzTHaSSmyll2TxLCq4mTFL5RJfeFr6qger+VcqNm9g=
-github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417 h1:f+neTRGCtvmW3Tm1V72vWpoTPuNOnXSQsHZdYOryfGM=
-github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417/go.mod h1:NKwI5KryEmEHMZVj80t9JQcfXWZp4/ZYNBuw4C5sQ9E=
-github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5 h1:1z7xOzfMO4aBR9+2nYjlhRXX1773fX60HTS0QGpGRPU=
-github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5/go.mod h1:HifYFOWR0bAMN4hWtaSADClogvtPy/jV0aRC5alhrKo=

@medyagh
Copy link
Copy Markdown
Member

medyagh commented Nov 22, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Nov 22, 2025
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2025
Preparing for making the libmachine API internal
Use the year of the minikube-machine import
Note: we can't change exported errors

Since they are used in "known issues"
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2025
@minikube-pr-bot
Copy link
Copy Markdown

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21966 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 39.7s    │ 40.1s                  │
│ enable ingress │ 15.7s    │ 15.7s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube ingress: 15.2s 15.7s 16.3s 15.7s 15.7s
Times for minikube (PR 21966) ingress: 15.7s 15.7s 15.7s 15.7s 15.7s

Times for minikube start: 39.1s 38.1s 40.6s 37.9s 42.7s
Times for minikube (PR 21966) start: 41.1s 41.6s 41.3s 37.2s 39.3s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21966 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 22.1s    │ 21.7s                  │
│ enable ingress │ 10.8s    │ 11.2s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube ingress: 10.6s 10.6s 10.6s 11.6s 10.6s
Times for minikube (PR 21966) ingress: 13.6s 10.6s 10.6s 10.6s 10.6s

Times for minikube start: 23.2s 22.7s 23.3s 20.1s 21.1s
Times for minikube (PR 21966) start: 22.0s 20.0s 24.0s 22.2s 20.2s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21966 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 21.4s    │ 19.8s                  │
│ enable ingress │ 22.9s    │ 23.1s                  │
└────────────────┴──────────┴────────────────────────┘
Details

Times for minikube start: 21.1s 19.7s 21.3s 22.1s 22.7s
Times for minikube (PR 21966) start: 21.3s 22.0s 18.8s 18.6s 18.1s

Times for minikube ingress: 23.1s 22.1s 23.1s 23.1s 23.1s
Times for minikube (PR 21966) ingress: 23.1s 23.1s 23.1s 23.1s 23.1s

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@afbjorklund: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
integration-vfkit-docker-macos-arm64 c29e423 link false /test integration-vfkit-docker-macos-arm64
integration-none-docker-linux-x86-64 c29e423 link true /test integration-none-docker-linux-x86-64
integration-docker-crio-linux-x86-64 c29e423 link true /test integration-docker-crio-linux-x86-64
integration-kvm-docker-linux-x86 c29e423 link true /test integration-kvm-docker-linux-x86
integration-kvm-containerd-linux-x86 c29e423 link true /test integration-kvm-containerd-linux-x86
integration-docker-docker-linux-arm c29e423 link true /test integration-docker-docker-linux-arm
integration-docker-crio-linux-x86 c29e423 link true /test integration-docker-crio-linux-x86
integration-kvm-crio-linux-x86 c29e423 link true /test integration-kvm-crio-linux-x86
integration-none-docker-linux-x86 c29e423 link true /test integration-none-docker-linux-x86
integration-docker-containerd-linux-x86 c29e423 link true /test integration-docker-containerd-linux-x86
integration-docker-docker-linux-x86 c29e423 link true /test integration-docker-docker-linux-x86
integration-kvm-docker-linux-x86-64 c29e423 link true /test integration-kvm-docker-linux-x86-64
integration-kvm-crio-linux-x86-64 c29e423 link true /test integration-kvm-crio-linux-x86-64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

@minikube-pr-bot
Copy link
Copy Markdown

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate

Besides the following environments also have failed tests:

  • Docker_Linux_containerd_arm64: 34 failed (gopogh)

  • KVM_Linux_crio: 3 failed (gopogh)

  • Docker_Linux_crio: 26 failed (gopogh)

  • Docker_Linux_crio_arm64: 42 failed (gopogh)

To see the flake rates of all tests by environment, click here.

@medyagh medyagh changed the title Move hyperv and virtualbox drivers to minikube dep: Move hyperv and virtualbox drivers to minikube Dec 20, 2025
@medyagh medyagh changed the title dep: Move hyperv and virtualbox drivers to minikube build deps: Move hyperv and virtualbox drivers to minikube Dec 20, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund, medyagh

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

The pull request process is described here

Details 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 Dec 20, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR moves the hyperv and virtualbox drivers from the vendored docker/machine package into the minikube internal codebase under pkg/drivers/. This is part of the broader effort to remove the legacy docker-machine dependency and make the libmachine API internal.

Key changes:

  • Moved virtualbox driver code from vendor/github.com/docker/machine/drivers/virtualbox/ to pkg/drivers/virtualbox/
  • Moved hyperv driver code from vendor/github.com/docker/machine/drivers/hyperv/ to pkg/drivers/hyperv/
  • Updated import statements in registry files to reference the new internal driver locations
  • Promoted github.com/aregm/cpuid from indirect to direct dependency in go.mod

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/minikube/registry/drvs/virtualbox/virtualbox.go Updated import path from docker/machine to internal pkg/drivers/virtualbox
pkg/minikube/registry/drvs/hyperv/hyperv.go Updated import path from docker/machine to internal pkg/drivers/hyperv
pkg/drivers/virtualbox/*.go Complete virtualbox driver implementation with platform-specific variants and tests
pkg/drivers/hyperv/*.go Complete hyperv driver implementation with PowerShell integration
go.mod Moved cpuid from indirect to direct dependency and added testify as direct dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,1095 @@
/*
Copyright 2022 The Kubernetes Authors All rights reserved.
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The copyright year is 2022, but this PR is being created in 2025. The copyright year should be updated to 2025 for all newly added files to accurately reflect when the code was introduced to this repository.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,531 @@
/*
Copyright 2022 The Kubernetes Authors All rights reserved.
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The copyright year is 2022, but this PR is being created in 2025. The copyright year should be updated to 2025 for all newly added files.

Copilot uses AI. Check for mistakes.
Comment thread go.mod
github.com/Parallels/docker-machine-parallels/v2 v2.0.1
github.com/VividCortex/godaemon v1.0.0
github.com/Xuanwo/go-locale v1.1.3
github.com/aregm/cpuid v0.0.0-20181003105527-1a4a6f06a1c6
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The cpuid dependency is being moved from indirect to direct. Ensure that this package (github.com/aregm/cpuid) is still maintained and consider if there's a more recent or better-maintained alternative for CPU feature detection.

Suggested change
github.com/aregm/cpuid v0.0.0-20181003105527-1a4a6f06a1c6
github.com/aregm/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 // indirect

Copilot uses AI. Check for mistakes.
@medyagh medyagh merged commit a50017e into kubernetes:master Dec 20, 2025
46 of 67 checks passed
@bobsira
Copy link
Copy Markdown
Contributor

bobsira commented Dec 22, 2025

@medyagh @afbjorklund just to let you know that this change is breaking 5 virtual box unit tests in windows. Let me share a snippet of the logs

You are using version 4.10 of VirtualBox. If you encounter issues, you might want to upgrade to version 5 at https://www.virtualbox.org/
You are using version 4.3.1 of VirtualBox. If you encounter issues, you might want to upgrade to version 5 at https://www.virtualbox.org/
Creating VirtualBox VM...
Creating SSH key...
--- **FAIL: TestCreateVM (0.00s)**
    virtualbox_test.go:501: Unexpected call Generate path\machines\default\id_rsa
Creating VirtualBox VM...
Creating SSH key...
--- **FAIL: TestCreateVMWithSpecificNatNicType (0.00s)**
    virtualbox_test.go:501: Unexpected call Generate path\machines\default\id_rsa
Creating VirtualBox VM...
Creating SSH key...
--- **FAIL: TestCreateVMWithoutAccelerate3D (0.00s)**
    virtualbox_test.go:501: Unexpected call Generate path\machines\default\id_rsa
Check network to re-create if needed...
Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter"
Windows might ask for the permission to configure a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
--- **FAIL: TestStart (1.00s)**
    virtualbox_test.go:501: Unexpected call Read path\machines\default\default\Logs\VBox.log
Check network to re-create if needed...
Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
Creating a new host-only adapter produced an error: error: Failed to create the host-only adapter
This is a known VirtualBox bug. Let's try to recover anyway...
Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter"
Windows might ask for the permission to configure a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
--- **FAIL: TestStartWithHostOnlyAdapterCreationBug (2.00s)**
    virtualbox_test.go:501: Unexpected call Read path\machines\default\default\Logs\VBox.log
FAIL

star3am pushed a commit to star3am/minikube that referenced this pull request Jan 2, 2026
…s#21966)

* Move hyperv and virtualbox drivers to minikube

Preparing for making the libmachine API internal

* Run the minikube copyright boilerplate script

Use the year of the minikube-machine import

* Fix lint issues in the imported drivers

Note: we can't change exported errors

Since they are used in "known issues"
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants