vnc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package vnc provides headless remote display serving for virtual machines.

It is intended to wrap the private VZVNCServer APIs and their security configurations behind a small Go surface for attaching a virtual machine or graphics display to a TCP listener or Bonjour-published VNC service.

The package should focus on a small set of concepts:

Config for port, vm.Queue, and security settings
Server for lifecycle management
Helpers to attach a VM or specific display

This package relies on private Virtualization.framework APIs and should be kept separate from the public VM construction helpers in the parent package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        uint16
	ServiceName string
	Queue       *vm.Queue
	Mode        SecurityMode
	Password    string
}

Config controls VNC server creation.

type SecurityConfig

type SecurityConfig struct {
	// contains filtered or unexported fields
}

SecurityConfig wraps a private VNC security configuration.

func NewNoSecurityConfig

func NewNoSecurityConfig() SecurityConfig

NewNoSecurityConfig creates a configuration that allows unauthenticated access.

func NewPasswordSecurityConfig

func NewPasswordSecurityConfig(password string) (SecurityConfig, error)

NewPasswordSecurityConfig creates a password-protected VNC security configuration.

func NewSecurityConfig

func NewSecurityConfig(cfg Config) (SecurityConfig, error)

NewSecurityConfig builds a security configuration from Config.

func (SecurityConfig) Object

func (c SecurityConfig) Object() objectivec.IObject

Object returns the Objective-C object for the security configuration.

type SecurityMode

type SecurityMode string

SecurityMode selects the security configuration for the VNC server.

const (
	// SecurityNone disables authentication.
	SecurityNone SecurityMode = "none"
	// SecurityPassword enables password authentication.
	SecurityPassword SecurityMode = "password"
)

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps a private VNC server.

func New

func New(cfg Config) (*Server, error)

New constructs a VNC server using the provided configuration.

func (*Server) DebugDescription

func (s *Server) DebugDescription() string

DebugDescription returns the Objective-C debug description string.

func (*Server) Description

func (s *Server) Description() string

Description returns the Objective-C description string.

func (*Server) Port

func (s *Server) Port() uint16

Port returns the configured VNC port.

func (*Server) Raw

func (s *Server) Raw() pvz.VZVNCServer

Raw returns the underlying private VNC server.

func (*Server) SecurityConfiguration

func (s *Server) SecurityConfiguration() SecurityConfig

SecurityConfiguration returns the private security configuration.

func (*Server) SetGraphicsDisplay

func (s *Server) SetGraphicsDisplay(display pvz.IVZGraphicsDisplay)

SetGraphicsDisplay attaches a graphics display to the server.

func (*Server) SetVirtualMachine

func (s *Server) SetVirtualMachine(vm pvz.IVZVirtualMachine)

SetVirtualMachine attaches a VM to the server.

func (*Server) Start

func (s *Server) Start()

Start starts the VNC server.

func (*Server) State

func (s *Server) State() int64

State returns the VNC server state.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the VNC server.

Jump to

Keyboard shortcuts

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