Skip to content

Commit

Permalink
fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Hex committed Nov 2, 2022
1 parent 5b4eee3 commit 9893eeb
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ vz provides the power of the Apple Virtualization.framework in Go. Put here is b

> 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)](https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html) specification, which defines standard interfaces for many device types, including network, socket, serial port, storage, entropy, and memory-balloon devices.
## USAGE
## Usage

Please see the [example](https://github.com/Code-Hex/vz/tree/main/example) directory.

## REQUIREMENTS
## Requirements

- Higher or equal to macOS Big Sur (11.0.0).
- Latest version of vz supports last two Go major [releases](https://go.dev/doc/devel/release) and might work with older versions.

Deprecated older versions (v1, v2).

## Installation

Initialize your project by creating a folder and then running `go mod init github.com/your/repo` ([learn more](https://go.dev/blog/using-go-modules)) inside the folder. Then install vz with the go get command:
Expand All @@ -26,6 +24,8 @@ Initialize your project by creating a folder and then running `go mod init githu
$ go get github.com/Code-Hex/vz/v3
```

Deprecated older versions (v1, v2).

## Feature Overview

- ✅ Virtualize Linux on a Mac **(x86_64, arm64)**
Expand All @@ -40,7 +40,7 @@ $ go get github.com/Code-Hex/vz/v3
-[Virtio Sockets](https://github.com/Code-Hex/vz/wiki/Sockets)
- ✅ Less dependent (only under golang.org/x/*)

## IMPORTANT
## Important

For binaries used in this package, you need to create an entitlements file like the one below and apply the following command.

Expand Down Expand Up @@ -90,6 +90,26 @@ You can check the version of the Xcode SDK available for each macOS on this site

https://xcodereleases.com/

## Version compatibility check

The package provides a mechanism for checking the availability of the respective API through error handling:

```go
bootLoader, err := vz.NewEFIBootLoader()
if errors.Is(err, vz.ErrUnsupportedOSVersion) || errors.Is(err, ErrBuildTargetOSVersion) {
return fallbackBootLoader()
}
if err != nil {
return nil, err
}
return bootLoader, nil
```

There are two items to check.

1. API is compatible with the version of macOS
2. The binary was built with the API enabled

## Knowledge for the Apple Virtualization.framework

There is a lot of knowledge required to use this Apple Virtualization.framework, but the information is too scattered and very difficult to understand. In most cases, this can be found in [the official documentation](https://developer.apple.com/documentation/virtualization?language=objc). However, the Linux kernel knowledge required to use the feature provided by this framework is not documented. Therefore, I have compiled the knowledge I have gathered so far into this wiki.
Expand Down

0 comments on commit 9893eeb

Please sign in to comment.