Skip to content

vfkit: Bump to Preferred driver on macOs #20808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/minikube/registry/drvs/vfkit/vfkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"
"os/exec"
"path/filepath"
"runtime"

"github.com/docker/machine/libmachine/drivers"
"github.com/google/uuid"
Expand All @@ -41,13 +42,17 @@ const (
)

func init() {
priority := registry.Unknown
if runtime.GOOS == "darwin" {
priority = registry.Preferred
Copy link
Member

Choose a reason for hiding this comment

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

I think is better than preffered registry.Default so it be the same level as qemu,

Copy link
Member

@medyagh medyagh May 21, 2025

Choose a reason for hiding this comment

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

based on comment from @nirs I agree to bump prefered.

Both vfkit and qemu are using the native hypervisor interface (hypervisor framewlrk).
But vfkit is using Apple virtualization framework maintained by the vendor. qemu is not well maintained on macOS.
You may not notice it because you was using an old mac, but M4 is still not fully supported in qemu. Not long ago starting qemu on M4 was crashing and it took few month until they fixed the issue, only after I pushed for it and convinced UTM maintainer to send a trivial workaround to avoid the crash to qemu.
lima is using VZ as the default vm type instead of qemu since 1.0 (Nov 6, 2024). Podman switch to vfkit long time ago (was using qemu before). We should move forward and recommend vfkit.
Unless we have some important features that does not work on vfkit and work on qemu. I'm not a ware of any.

}
if err := registry.Register(registry.DriverDef{
Name: driver.VFKit,
Init: func() drivers.Driver { return vfkit.NewDriver("", "") },
Config: configure,
Status: status,
Default: true,
Priority: registry.Experimental,
Priority: priority,
}); err != nil {
panic(fmt.Sprintf("register failed: %v", err))
}
Expand Down Expand Up @@ -104,7 +109,7 @@ func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) {
func status() registry.State {
_, err := exec.LookPath("vfkit")
if err != nil {
return registry.State{Error: err, Fix: "Run 'brew tap cfergeau/crc && brew install vfkit'", Doc: docURL}
return registry.State{Error: err, Fix: "Run 'brew install vfkit'", Doc: docURL}

Choose a reason for hiding this comment

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

πŸ‘
vfkit in cfergeau/crc will no longer be updated now that it’s in the main repo. I should remove it from this personal tap.

Copy link
Member

Choose a reason for hiding this comment

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

sure

Copy link
Collaborator

Choose a reason for hiding this comment

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

}
return registry.State{Installed: true, Healthy: true, Running: true}
}
Expand Down
Loading