Documentation
¶
Index ¶
- Constants
- func ScreenshotFromVM(_ vm.VM) ([]byte, error)
- func VNCGrabFrame(addr string, timeout time.Duration) ([]byte, error)
- func VNCGrabFrameTrace(addr string, timeout time.Duration, tracef func(format string, args ...any)) ([]byte, error)
- func VNCPortFromVM(_ vm.VM) uint16
- type Backend
- func (*Backend) CreateDisk(path string, sizeGB int, format vm.DiskFormat) error
- func (*Backend) CreateOverlay(path, base string) error
- func (*Backend) DefaultDiskFormat() vm.DiskFormat
- func (*Backend) Flatten(src, dst string) error
- func (*Backend) StartInstall(_ context.Context, _ vm.VMInstallConfig) (vm.VM, error)
- func (*Backend) StartRun(_ context.Context, _ vm.VMRunConfig) (vm.VM, error)
- type InstallOptions
- type RunOptions
Constants ¶
const DefaultVNCPort uint16 = 25900
DefaultVNCPort is the default TCP port for the headless VNC server.
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.
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 ¶
ScreenshotFromVM returns an error on non-darwin (stub).
func VNCGrabFrame ¶
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 ¶
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) CreateOverlay ¶
func (*Backend) DefaultDiskFormat ¶
func (*Backend) DefaultDiskFormat() vm.DiskFormat
func (*Backend) StartInstall ¶
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.