containers / libkrun

A dynamic library providing Virtualization-based process isolation capabilities
Apache License 2.0
908 stars 75 forks source link

macOS x86-64 support #34

Open jrmuizel opened 3 years ago

jrmuizel commented 3 years ago

This would be nice to have. What all needs to be done to make it work?

satmandu commented 3 years ago

Looks like https://github.com/containers/libkrun/tree/main/src/arch/src/x86_64 needs to be modified not to use the kvm_bindings crate, which is linux specific.

The aarch64 functionality in https://github.com/containers/libkrun/tree/main/src/arch/src/aarch64 appears to work without that, which is why that works for macos.

This would be really nice to have on macOS x86_64...

slp commented 3 years ago

Supporting macOS's Hypervisor.framework on x86_64 is doable, but requires some work, given that we need to emulate more devices than with KVM (which provides in-kernel implementations of them). So far nobody has volunteer to work on that.

satmandu commented 3 years ago

I'm not seeing a rust implementation for using the macOS Hypervisor.framework, but I am seeing:

Objective C implementation: https://github.com/evansm7/vftool Swift implementation: https://github.com/gyf304/vmcli

flouthoc commented 3 years ago

@satmandu There is C API for hypervisor framework. I think you could use that and FFI into libkrun.