Documentation
¶
Overview ¶
Package macos provides macOS native virtualization.
Package macos provides macOS native virtualization backends.
Index ¶
- func DefaultVMImage(arch string) string
- func GenerateSandboxProfile(rootfs string, readOnly bool, network string) string
- type Backend
- type Capabilities
- type FSShare
- type PortForward
- type QEMUBackend
- func (b *QEMUBackend) Available() bool
- func (b *QEMUBackend) CreateVM(_ *VMConfig) error
- func (b *QEMUBackend) DeleteVM(_ string) error
- func (b *QEMUBackend) ForwardPort(_, _ int, _ string) error
- func (b *QEMUBackend) MinVersion() string
- func (b *QEMUBackend) Name() string
- func (b *QEMUBackend) RemoveForwardPort(_ int, _ string) error
- func (b *QEMUBackend) ShareHostDir(_, _, _ string, _ bool) error
- func (b *QEMUBackend) StartVM(_ string) error
- func (b *QEMUBackend) Stats(_ string) (*VMStats, error)
- func (b *QEMUBackend) StopVM(_ string, _ int) error
- func (b *QEMUBackend) UnshareHostDir(_ string) error
- func (b *QEMUBackend) VMStatus(_ string) (string, error)
- type SandboxBackend
- func (b *SandboxBackend) Available() bool
- func (b *SandboxBackend) CreateVM(_ *VMConfig) error
- func (b *SandboxBackend) DeleteVM(_ string) error
- func (b *SandboxBackend) ForwardPort(_, _ int, _ string) error
- func (b *SandboxBackend) MinVersion() string
- func (b *SandboxBackend) Name() string
- func (b *SandboxBackend) RemoveForwardPort(_ int, _ string) error
- func (b *SandboxBackend) ShareHostDir(_, _, _ string, _ bool) error
- func (b *SandboxBackend) StartVM(_ string) error
- func (b *SandboxBackend) Stats(_ string) (*VMStats, error)
- func (b *SandboxBackend) StopVM(_ string, _ int) error
- func (b *SandboxBackend) UnshareHostDir(_ string) error
- func (b *SandboxBackend) VMStatus(_ string) (string, error)
- type VMConfig
- type VMStats
- type VZBackend
- func (b *VZBackend) Available() bool
- func (b *VZBackend) CreateVM(_ *VMConfig) error
- func (b *VZBackend) DeleteVM(_ string) error
- func (b *VZBackend) ForwardPort(_, _ int, _ string) error
- func (b *VZBackend) MinVersion() string
- func (b *VZBackend) Name() string
- func (b *VZBackend) RemoveForwardPort(_ int, _ string) error
- func (b *VZBackend) ShareHostDir(_, _, _ string, _ bool) error
- func (b *VZBackend) StartVM(_ string) error
- func (b *VZBackend) Stats(_ string) (*VMStats, error)
- func (b *VZBackend) StopVM(_ string, _ int) error
- func (b *VZBackend) UnshareHostDir(_ string) error
- func (b *VZBackend) VMStatus(_ string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultVMImage ¶
Types ¶
type Backend ¶
type Backend interface {
Name() string
Available() bool
MinVersion() string
CreateVM(cfg *VMConfig) error
StartVM(id string) error
StopVM(id string, timeoutSec int) error
DeleteVM(id string) error
VMStatus(id string) (string, error)
ForwardPort(hostPort, guestPort int, proto string) error
RemoveForwardPort(hostPort int, proto string) error
Stats(id string) (*VMStats, error)
}
func SelectBackend ¶
func SelectBackend(caps *Capabilities) Backend
type Capabilities ¶
type Capabilities struct {
Version string
Arch string
IsTahoe bool
IsAppleSilicon bool
ASIF bool
NFSv41 bool
VZ bool
VirtioFS bool
Rosetta bool
Hypervisor bool
QEMU bool
Sandbox bool
BestBackend string
}
func DetectCapabilities ¶
func DetectCapabilities() *Capabilities
type PortForward ¶
type QEMUBackend ¶
type QEMUBackend struct{}
QEMUBackend is a stub for the QEMU-based macOS virtualization backend.
func NewQEMUBackend ¶
func NewQEMUBackend() *QEMUBackend
NewQEMUBackend returns nil on non-darwin platforms.
func (*QEMUBackend) Available ¶
func (b *QEMUBackend) Available() bool
Available reports that the backend is not available on this platform.
func (*QEMUBackend) CreateVM ¶
func (b *QEMUBackend) CreateVM(_ *VMConfig) error
CreateVM is a no-op stub.
func (*QEMUBackend) DeleteVM ¶
func (b *QEMUBackend) DeleteVM(_ string) error
DeleteVM is a no-op stub.
func (*QEMUBackend) ForwardPort ¶
func (b *QEMUBackend) ForwardPort(_, _ int, _ string) error
ForwardPort is a no-op stub.
func (*QEMUBackend) MinVersion ¶
func (b *QEMUBackend) MinVersion() string
MinVersion returns "N/A" as the backend is unavailable.
func (*QEMUBackend) RemoveForwardPort ¶
func (b *QEMUBackend) RemoveForwardPort(_ int, _ string) error
RemoveForwardPort is a no-op stub.
func (*QEMUBackend) ShareHostDir ¶
func (b *QEMUBackend) ShareHostDir(_, _, _ string, _ bool) error
ShareHostDir is a no-op stub.
func (*QEMUBackend) StartVM ¶
func (b *QEMUBackend) StartVM(_ string) error
StartVM is a no-op stub.
func (*QEMUBackend) Stats ¶
func (b *QEMUBackend) Stats(_ string) (*VMStats, error)
Stats returns nil stats on unsupported platforms.
func (*QEMUBackend) StopVM ¶
func (b *QEMUBackend) StopVM(_ string, _ int) error
StopVM is a no-op stub.
func (*QEMUBackend) UnshareHostDir ¶
func (b *QEMUBackend) UnshareHostDir(_ string) error
UnshareHostDir is a no-op stub.
type SandboxBackend ¶
type SandboxBackend struct{}
func NewSandboxBackend ¶
func NewSandboxBackend() *SandboxBackend
func (*SandboxBackend) Available ¶
func (b *SandboxBackend) Available() bool
func (*SandboxBackend) CreateVM ¶
func (b *SandboxBackend) CreateVM(_ *VMConfig) error
func (*SandboxBackend) DeleteVM ¶
func (b *SandboxBackend) DeleteVM(_ string) error
func (*SandboxBackend) ForwardPort ¶
func (b *SandboxBackend) ForwardPort(_, _ int, _ string) error
func (*SandboxBackend) MinVersion ¶
func (b *SandboxBackend) MinVersion() string
func (*SandboxBackend) Name ¶
func (b *SandboxBackend) Name() string
func (*SandboxBackend) RemoveForwardPort ¶
func (b *SandboxBackend) RemoveForwardPort(_ int, _ string) error
func (*SandboxBackend) ShareHostDir ¶
func (b *SandboxBackend) ShareHostDir(_, _, _ string, _ bool) error
func (*SandboxBackend) StartVM ¶
func (b *SandboxBackend) StartVM(_ string) error
func (*SandboxBackend) UnshareHostDir ¶
func (b *SandboxBackend) UnshareHostDir(_ string) error
type VZBackend ¶
type VZBackend struct{}
VZBackend is a stub for the macOS Virtualization framework backend.
func NewVZBackend ¶
func NewVZBackend() *VZBackend
NewVZBackend returns nil on non-darwin platforms.
func (*VZBackend) ForwardPort ¶
ForwardPort is a no-op stub.
func (*VZBackend) MinVersion ¶
MinVersion returns "N/A" as the backend is unavailable.
func (*VZBackend) RemoveForwardPort ¶
RemoveForwardPort is a no-op stub.
func (*VZBackend) ShareHostDir ¶
ShareHostDir is a no-op stub.
func (*VZBackend) UnshareHostDir ¶
UnshareHostDir is a no-op stub.