vz

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVNCPort uint16 = 25900

DefaultVNCPort is the default TCP port for the headless VNC server.

View Source
const DefaultVsockPort uint32 = 2222

DefaultVsockPort is the guest vsock port gosshd listens on for vz backend SSH. The host-side proxy connects to this port via VirtioSocketDevice.

View Source
const SharedDirTag = "winkit"

SharedDirTag is the virtio-fs tag the guest uses to mount the shared directory: net use X: \\virtiofs\winkit

Variables

This section is empty.

Functions

func ScreenshotFromVM

func ScreenshotFromVM(_ vm.VM) ([]byte, error)

ScreenshotFromVM returns an error on non-darwin (stub).

func VNCGrabFrame

func VNCGrabFrame(addr string, timeout time.Duration) ([]byte, error)

VNCGrabFrame connects to a VNC server at addr, performs a minimal RFB handshake (no auth), requests a single full framebuffer update, and returns the result as PNG bytes. The server must support RAW encoding and SecurityType None.

func VNCGrabFrameTrace

func VNCGrabFrameTrace(addr string, timeout time.Duration, tracef func(format string, args ...any)) ([]byte, error)

VNCGrabFrameTrace is VNCGrabFrame with a per-step trace callback so a crash or protocol error can be localized to the exact RFB message that preceded it. tracef may be nil.

func VNCPortFromVM

func VNCPortFromVM(_ vm.VM) uint16

VNCPortFromVM returns 0 on non-darwin (stub).

Types

type Backend

type Backend struct{}

Backend implements vm.VMBackend using Apple's Virtualization.framework. This stub exists so the package compiles on non-darwin platforms; all methods return an error.

func (*Backend) CreateDisk

func (*Backend) CreateDisk(path string, sizeGB int, format vm.DiskFormat) error

func (*Backend) CreateOverlay

func (*Backend) CreateOverlay(path, base string) error

func (*Backend) DefaultDiskFormat

func (*Backend) DefaultDiskFormat() vm.DiskFormat

func (*Backend) Flatten

func (*Backend) Flatten(src, dst string) error

func (*Backend) StartInstall

func (*Backend) StartInstall(_ context.Context, _ vm.VMInstallConfig) (vm.VM, error)

func (*Backend) StartRun

func (*Backend) StartRun(_ context.Context, _ vm.VMRunConfig) (vm.VM, error)

type InstallOptions

type InstallOptions struct {
	EFIVarsPath  string
	VsockSSHPort uint32
	VNCPort      uint16
	Logger       *slog.Logger
	// BootVolume is a raw FAT image containing the Windows Setup EFI boot
	// chain (BOOTAA64.EFI, BCD, boot.wim). Attached as USB mass storage so
	// the EFI firmware can boot from it. Required for fresh installs.
	BootVolume string
}

InstallOptions holds vz-specific options for StartInstall.

type RunOptions

type RunOptions struct {
	EFIVarsPath  string
	VsockSSHPort uint32
	VNCPort      uint16
	Logger       *slog.Logger
}

RunOptions holds vz-specific options for StartRun.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL