-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 codehex | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
vz - Go binding with Apple [Virtualization.framework](https://developer.apple.com/documentation/virtualization?language=objc) | ||
======= | ||
|
||
vz provides the power of the Apple Virtualization.framework in Go. Put here is block quote of overreview which is written what is Virtualization.framework from the document. | ||
|
||
> The Virtualization framework provides high-level APIs for creating and managing virtual machines on Apple silicon and Intel-based Mac computers. Use this framework to boot and run a Linux-based operating system in a custom environment that you define. The framework supports the Virtio specification, which defines standard interfaces for many device types, including network, socket, serial port, storage, entropy, and memory-balloon devices. | ||
## USAGE | ||
|
||
Please see the example directory. | ||
|
||
## REQUIREMENTS | ||
|
||
- Higher or equal to macOS Big Sur (11.0.0) | ||
- Higher or equal to Go 1.16 in Apple M1 Users | ||
|
||
## IMPORTANT | ||
|
||
For binaries used in this package, you need to create an entitlements file like the one below and apply the following command. | ||
|
||
<details> | ||
<summary>vz.entitlements</summary> | ||
|
||
``` | ||
<?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> | ||
``` | ||
|
||
</details> | ||
|
||
```sh | ||
$ codesign --entitlements vz.entitlements -s - <YOUR BINARY PATH> | ||
``` | ||
|
||
> A process must have the com.apple.security.virtualization entitlement to use the Virtualization APIs. | ||
If you want to use [`VZBridgedNetworkDeviceAttachment`](https://developer.apple.com/documentation/virtualization/vzbridgednetworkdeviceattachment?language=objc), you need to add also `com.apple.vm.networking` entitlement. | ||
|
||
## TODO | ||
|
||
- [ ] [VZMACAddress](https://developer.apple.com/documentation/virtualization/vzmacaddress?language=objc) | ||
|
||
## LICENSE | ||
|
||
MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Example | ||
======= | ||
|
||
You can get knowledge build and codesign process in Makefile. | ||
|
||
## Build | ||
|
||
```sh | ||
make all | ||
``` | ||
|
||
## Setup Hints | ||
|
||
- I used `ubuntu-20.04.1-live-server-arm64.iso` in this example | ||
- [The Unarchiver](https://apps.apple.com/us/app/the-unarchiver/id425424353?mt=12) can extracts some important files from iso. | ||
- `vmlinuz` and `initrd` in `/casper` | ||
- Need to rename vmlinuz to vmlinuz.gz and unarchive it. | ||
- https://forums.macrumors.com/threads/ubuntu-linux-virtualized-on-m1-success.2270365/ |