Skip to content
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

Minikube with driver "new Virtualization Framework" on Apple M1 #12826

Closed
cscetbon opened this issue Oct 31, 2021 · 23 comments · Fixed by #19423
Closed

Minikube with driver "new Virtualization Framework" on Apple M1 #12826

cscetbon opened this issue Oct 31, 2021 · 23 comments · Fixed by #19423
Labels
co/vfkit VFkit related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. os/macos priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@cscetbon
Copy link

cscetbon commented Oct 31, 2021

As more and more people are thinking of moving to Minikube to replace "Docker For Mac" some work to enable virtualization on it should be a priority to get them onboard. Hyperkit being deprecated going with the new Virtualization Framework which uses higher API and is supposed to be easier to use probably makes more sense

See https://github.com/Code-Hex/vz

@cscetbon
Copy link
Author

cscetbon commented Nov 1, 2021

Did someone start any work on this somewhere that could be used as a base or needs to be completed ?

@afbjorklund
Copy link
Collaborator

afbjorklund commented Nov 1, 2021

Currently containerd (lima) uses QEMU and podman (machine) uses QEMU, but there is room for more hypervisor drivers.

The main issue is actually not the CPU virtualization, at least not anymore. The problem is the network, especially VPN...

@afbjorklund afbjorklund added os/macos kind/feature Categorizes issue or PR as related to a new feature. labels Nov 1, 2021
@cscetbon
Copy link
Author

cscetbon commented Nov 1, 2021

@afbjorklund but as Minikube already supports hyperkit I thought it should be easier to start from there and migrate it to the new framework which is supposed to be simple and support everything that is already supported.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Nov 1, 2021

Yes, as far as I know both HyperKit and VpnKit are still Open Source even if Docker's new libraries might not be.

But it doesn't work on aarch64 (yet?)

@afbjorklund

This comment has been minimized.

@cscetbon
Copy link
Author

cscetbon commented Nov 1, 2021

migrate it to the new framework

What "new framework" are you talking about here ?

https://developer.apple.com/documentation/virtualization

The new one that deprecates hyperkit and there is a go binding for it at https://github.com/Code-Hex/vz

@afbjorklund
Copy link
Collaborator

Okay thanks, we will need someone to turn that into a "driver" for the libmachine framework:

https://github.com/docker/machine/blob/master/libmachine/drivers/drivers.go

@afbjorklund afbjorklund added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Nov 1, 2021
@cscetbon
Copy link
Author

cscetbon commented Nov 3, 2021

@afbjorklund You mean writing something like https://github.com/kubernetes/minikube/tree/master/pkg/drivers/hyperkit, right ? Also do you know why the hyperkit doesn't work on M1 atm ?

@afbjorklund
Copy link
Collaborator

afbjorklund commented Nov 3, 2021

@afbjorklund You mean writing something like https://github.com/kubernetes/minikube/tree/master/pkg/drivers/hyperkit, right ?

Right (you will notice it imports the libmachine framework)

There is also an old driver for QEMU.

Also do you know why the hyperkit doesn't work on M1 atm ?

Same reason as VirtualBox, I suppose. No arm64 support.

See moby/hyperkit#303 (comment)

@cscetbon
Copy link
Author

cscetbon commented Nov 3, 2021

As you need help, @yoelb and I can tackle it

@riaz7se
Copy link

riaz7se commented Dec 13, 2021

Any reference or links to follow for installing minikube on M1 using Apple Virtualization framework?
pls suggest

@sharifelgamal sharifelgamal added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Feb 9, 2022
@sharifelgamal
Copy link
Collaborator

This is still something we're looking into. One prerequisite for this to work is a minikube ISO that will work on the arm64/aarch64 architecture, which is still in progress.

@xaocon
Copy link

xaocon commented Apr 25, 2022

This is still something we're looking into. One prerequisite for this to work is a minikube ISO that will work on the arm64/aarch64 architecture, which is still in progress.

Is that conversation going on somewhere public? I'd like to help. Not sure I could help much with the GO stuff but I could probably help with the ISO or helping track down how other projects are doing similar things (looking through lima for example).

@sharifelgamal
Copy link
Collaborator

The tracking issue for the arm64 ISO is #9228

@spowelljr
Copy link
Member

We just released minikube v1.26.0-beta.0 that supports the QEMU driver --driver=qemu2.

https://github.com/kubernetes/minikube/releases/tag/v1.26.0-beta.0

@afbjorklund
Copy link
Collaborator

afbjorklund commented May 14, 2022

It would still be interesting to see a dedicated Mac driver (like the old HyperKit driver) using virtualization.framework

But the QEMU driver is also getting some real networking support, using the vmnet.framework (courtesy of lima-vm).

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 12, 2022
@afbjorklund
Copy link
Collaborator

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 11, 2022
@afbjorklund afbjorklund added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Sep 11, 2022
@tmoschou
Copy link
Contributor

Looks like Podman v5.0.0-rc7 have switched their driver on MacOS over from QEMU to the native MacOS virtualization framework / hypervisor thanks to https://github.com/crc-org/vfkit and https://github.com/Code-Hex/vz

As a side, it would be good to know if the new framework potentially fixes the networking issue / firewall bugs we have with socket_vmnet - we are running MacOS's enrolled in MDM, which prohibit firewall modifications and our IT are reluctant to deploy a custom Firewall MDM payload. We basically have to stop/uninstall/reboot/reinstall socket_vmnet as a workaround, which is a shame as its limiting uptake of minikube/kubernetes.

@afbjorklund

This comment was marked as off-topic.

@afbjorklund
Copy link
Collaborator

Now you can use gvproxy for the network, since it has integration with the vfkit program.

https://github.com/containers/gvisor-tap-vsock#run-with-vfkit

@afbjorklund
Copy link
Collaborator

afbjorklund commented Aug 11, 2024

Apparently using gvproxy is optional, since the built-in "nat" actually gives you an IP with dhcp.

So that can at least be used for ssh, by parsing the dhcpd_leases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/vfkit VFkit related issues help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. os/macos priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants