Crates.io | virt-fwk |
lib.rs | virt-fwk |
version | 0.1.0 |
source | src |
created_at | 2023-05-15 22:02:00.895706 |
updated_at | 2023-05-15 22:02:00.895706 |
description | A library that exposes a safe set of API's unlocking the capabilities of Apple's Virtualization.framework in rust. |
homepage | |
repository | https://github.com/vandycknick/virt-fwk |
max_upload_size | |
id | 865429 |
size | 88,881 |
virt-fwk exposes a safe set of API's unlocking the capabilities of Apple's Virtualization.framework in rust. To explain Virtualization.framework I refer to the following quote directly from Apple's documentation.
The Virtualization framework provides high-level APIs for creating and managing virtual machines (VM) on Apple silicon and Intel-based Mac computers. Use this framework to boot and run macOS or Linux-based operating systems in custom environments that you define. The framework supports the Virtual I/O Device (VIRTIO) specification, which defines standard interfaces for many device types, including network, socket, serial port, storage, entropy, and memory-balloon devices.
This is still very much work in progress. As such the library is currently only with the latest macOS and Rust versions:
Add the following lines to your Cargo.toml
file or run cargo add virt-fwk
.
[dependencies]
virt-fw = "0.1.0"
Use the following if you prefer to use the package via the global vz
module name. This allows you to use the package in a similar fashion as to how the vz
golang library works:
[dependencies]
vz = { package="virt-fwk", version="0.1.0" }
In order to use the macOS virtualization api's your program should have the com.apple.security.virtualization
entitlement. To add this create an entitlements file with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.virtualization</key>
<true/>
</dict>
</plist>
And then sign you program with this entitlement using the following command:
$ codesign --entitlements <FILENAME>.entitlements -s - <YOUR BINARY PATH>
If you want to use VZBridgedNetworkDeviceAttachment
, you need to add also com.apple.vm.networking
entitlement.