Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
go.mod: github.com/lima-vm/vz/v4
  • Loading branch information
AkihiroSuda authored Oct 18, 2024
2 parents 9f62857 + e4903b6 commit ac2dbb8
Show file tree
Hide file tree
Showing 53 changed files with 76 additions and 99 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://github.com/Code-Hex/vz/blob/master/CONTRIBUTING.md
2. Please create a new issue before creating this PR. However, You can continue it without creating issues if this PR fixes any documentations such as typo.
3. Do not send Pull Requests for large (150 ~ lines) code changes. If so, I am not motivated to review your code. Basically, I write the code.
<!-- Thanks for sending a pull request!
If this is your first time, please read our contributor guidelines: https://lima-vm.io/docs/community/contributing/
-->

## Which issue(s) this PR fixes:
Expand Down
23 changes: 0 additions & 23 deletions CONTRIBUTING.md

This file was deleted.

21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
vz - Go binding with Apple [Virtualization.framework](https://developer.apple.com/documentation/virtualization?language=objc)
=======

[![Build](https://github.com/Code-Hex/vz/actions/workflows/compile.yml/badge.svg)](https://github.com/Code-Hex/vz/actions/workflows/compile.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/Code-Hex/vz/v3.svg)](https://pkg.go.dev/github.com/Code-Hex/vz/v3)
[![Build](https://github.com/lima-vm/vz/actions/workflows/compile.yml/badge.svg)](https://github.com/lima-vm/vz/actions/workflows/compile.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/lima-vm/vz/v4.svg)](https://pkg.go.dev/github.com/lima-vm/vz/v4)

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 (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.
This repository <https://github.com/lima-vm/vz> was forked from <https://github.com/Code-Hex/vz/tree/c3198942b1b797ac424b673e06769f45bef0d275>.

## Usage

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

## Requirements

Expand All @@ -21,11 +23,9 @@ Please see the [example](https://github.com/Code-Hex/vz/tree/main/example) direc
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:

```
$ go get github.com/Code-Hex/vz/v3
$ go get github.com/lima-vm/vz/v4
```

Deprecated older versions (v1, v2).

## Feature Overview

- ✅ Virtualize Linux on a Mac **(x86_64, arm64)**
Expand Down Expand Up @@ -74,6 +74,7 @@ If you compile using an older Xcode SDK, you will get the following warnings.

This example warns that macOS 12.3 API and macOS 13 API are not available in the binary build. This means these APIs are not available even if you are running this binary on a modern OS (macOS 12.3 or macOS 13).

<!-- If you wish to change Code-Hex/vz/v3 below to lima-vm/vz/v4, make sure to obtain the actual console output with lima-vm/vz/v4 -->
```
$ go build .
# github.com/Code-Hex/vz/v3
Expand Down Expand Up @@ -112,11 +113,13 @@ There are two items to check.

## 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.

https://github.com/Code-Hex/vz/wiki
Quote from [@Code-Hex](https://github.com/Code-Hex)'s upstream repository <https://github.com/Code-Hex/vz/tree/c3198942b1b797ac424b673e06769f45bef0d275>:

Anyone is free to edit this wiki. It would help someone if you could add information not listed here. Let's make a good wiki together!
> 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.
>
> https://github.com/Code-Hex/vz/wiki
>
> Anyone is free to edit this wiki. It would help someone if you could add information not listed here. Let's make a good wiki together!
## Testing

Expand Down
2 changes: 1 addition & 1 deletion audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// AudioDeviceConfiguration interface for an audio device configuration.
Expand Down
2 changes: 1 addition & 1 deletion bootloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"os"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// BootLoader is the interface of boot loader definitions.
Expand Down
2 changes: 1 addition & 1 deletion bootloader_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// MacOSBootLoader is a boot loader configuration for booting macOS on Apple Silicon.
Expand Down
2 changes: 1 addition & 1 deletion cgoutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import (
"fmt"
"unsafe"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// pointer is a type alias which is able to use as embedded type and
Expand Down
2 changes: 1 addition & 1 deletion clipboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// SpiceAgentPortAttachment is an attachment point that enables
Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// VirtualMachineConfiguration defines the configuration of a VirtualMachine.
Expand Down
2 changes: 1 addition & 1 deletion configuration_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package vz
# include "virtualization_14_arm64.h"
*/
import "C"
import "github.com/Code-Hex/vz/v3/internal/objc"
import "github.com/lima-vm/vz/v4/internal/objc"

// ValidateSaveRestoreSupport Determines whether the framework can save or restore the VM’s current configuration.
//
Expand Down
2 changes: 1 addition & 1 deletion console.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "C"
import (
"unsafe"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// ConsoleDeviceConfiguration interface for an console device configuration.
Expand Down
2 changes: 1 addition & 1 deletion debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "C"
import (
"runtime"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// DebugStubConfiguration is an interface to debug configuration.
Expand Down
2 changes: 1 addition & 1 deletion entropy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// VirtioEntropyDeviceConfiguration is used to expose a source of entropy for the guest operating system’s random-number generator.
Expand Down
6 changes: 3 additions & 3 deletions example/gui-linux/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/Code-Hex/vz/example/gui-linux
module github.com/lima-vm/vz/example/gui-linux

go 1.19

replace github.com/Code-Hex/vz/v3 => ../../
replace github.com/lima-vm/vz/v4 => ../../

require (
github.com/Code-Hex/vz/v3 v3.0.0-00010101000000-000000000000
github.com/Songmu/prompter v0.5.1
github.com/lima-vm/vz/v4 v4.0.0-00010101000000-000000000000
)

require (
Expand Down
2 changes: 1 addition & 1 deletion example/gui-linux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"runtime"
"time"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
)

var install bool
Expand Down
2 changes: 1 addition & 1 deletion example/gui-linux/rosseta_directory_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package main

import "github.com/Code-Hex/vz/v3"
import "github.com/lima-vm/vz/v4"

func createRosettaDirectoryShareConfiguration() (*vz.VirtioFileSystemDeviceConfiguration, error) {
return nil, errIgnoreInstall
Expand Down
2 changes: 1 addition & 1 deletion example/gui-linux/rosseta_directory_share_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"log"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
"github.com/Songmu/prompter"
)

Expand Down
6 changes: 3 additions & 3 deletions example/linux/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/Code-Hex/vz/example/linux
module github.com/lima-vm/vz/example/linux

go 1.19

replace github.com/Code-Hex/vz/v3 => ../../
replace github.com/lima-vm/vz/v4 => ../../

require (
github.com/Code-Hex/vz/v3 v3.0.0-00010101000000-000000000000
github.com/lima-vm/vz/v4 v4.0.0-00010101000000-000000000000
github.com/pkg/term v1.1.0
golang.org/x/sys v0.16.0
)
Expand Down
2 changes: 1 addition & 1 deletion example/linux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"syscall"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
"github.com/pkg/term/termios"
"golang.org/x/sys/unix"
)
Expand Down
6 changes: 3 additions & 3 deletions example/macOS/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/Code-Hex/vz/example/macOS
module github.com/lima-vm/vz/example/macOS

go 1.19

replace github.com/Code-Hex/vz/v3 => ../../
replace github.com/lima-vm/vz/v4 => ../../

require github.com/Code-Hex/vz/v3 v3.0.0-00010101000000-000000000000
require github.com/lima-vm/vz/v4 v4.0.0-00010101000000-000000000000

require (
github.com/Code-Hex/go-infinity-channel v1.0.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion example/macOS/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"time"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
)

func installMacOS(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion example/macOS/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"runtime"
"time"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
)

var install bool
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vz_test
import (
"errors"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
)

func ExampleErrUnsupportedOSVersion() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Code-Hex/vz/v3
module github.com/lima-vm/vz/v4

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion graphics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// GraphicsDeviceConfiguration is an interface for a graphics device configuration.
Expand Down
2 changes: 1 addition & 1 deletion graphics_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// MacGraphicsDeviceConfiguration is a configuration for a display attached to a Mac graphics device.
Expand Down
2 changes: 1 addition & 1 deletion internal/progress/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/Code-Hex/vz/v3/internal/progress"
"github.com/lima-vm/vz/v4/internal/progress"
)

func TestReader(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

func newTestConfig(t *testing.T) *VirtualMachineConfiguration {
Expand Down
2 changes: 1 addition & 1 deletion keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// KeyboardConfiguration interface for a keyboard configuration.
Expand Down
2 changes: 1 addition & 1 deletion keyboard_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// MacKeyboardConfiguration is a struct that defines the configuration
Expand Down
2 changes: 1 addition & 1 deletion memory_balloon.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// MemoryBalloonDeviceConfiguration for a memory balloon device configuration.
Expand Down
2 changes: 1 addition & 1 deletion network.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"syscall"
"unsafe"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// BridgedNetwork defines a network interface that bridges a physical interface with a virtual machine.
Expand Down
2 changes: 1 addition & 1 deletion network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net"
"testing"

"github.com/Code-Hex/vz/v3"
"github.com/lima-vm/vz/v4"
)

func TestFileHandleNetworkDeviceAttachmentMTU(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"os"
"unsafe"

"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// PlatformConfiguration is an interface for a platform configuration.
Expand Down
2 changes: 1 addition & 1 deletion platform_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package vz
*/
import "C"
import (
"github.com/Code-Hex/vz/v3/internal/objc"
"github.com/lima-vm/vz/v4/internal/objc"
)

// MacPlatformConfiguration is the platform configuration for booting macOS on Apple silicon.
Expand Down
Loading

0 comments on commit ac2dbb8

Please sign in to comment.