Documentation
¶
Overview ¶
Package vbox is a thin wrapper over VirtualBox's COM/XPCOM API. The exposed API follows the COM/XPCOM conventions, and will not feel natural to Go programmers. Most users should look into a higher-level library.
Index ¶
- Constants
- Variables
- func ComposeMachineFilename(name string, flags string, baseFolder string) (string, error)
- func Deinit() error
- func GetRevision() (int, error)
- func Init() error
- func SetExtraData(key string, value string) error
- type APICMode
- type AccessMode
- type AudioAdapter
- type BiosSettings
- func (settings *BiosSettings) GetACPIEnabled() (bool, error)
- func (settings *BiosSettings) GetAPICMode() (APICMode, error)
- func (settings *BiosSettings) GetBootMenuMode() (BootMenuMode, error)
- func (settings *BiosSettings) GetIOAPICEnabled() (bool, error)
- func (settings *BiosSettings) GetLogoDisplayTime() (time.Duration, error)
- func (settings *BiosSettings) GetLogoFadeIn() (bool, error)
- func (settings *BiosSettings) GetLogoFadeOut() (bool, error)
- func (settings *BiosSettings) GetLogoImagePath() (string, error)
- func (settings *BiosSettings) GetPXEDebugEnabled() (bool, error)
- func (settings *BiosSettings) GetTimeOffset() (time.Duration, error)
- func (settings *BiosSettings) Initialized() bool
- func (settings *BiosSettings) Release() error
- func (settings *BiosSettings) SetACPIEnabled(acpiEnabled bool) error
- func (settings *BiosSettings) SetAPICMode(apicMode APICMode) error
- func (settings *BiosSettings) SetBootMenuMode(menuMode BootMenuMode) error
- func (settings *BiosSettings) SetIOAPICEnabled(ioapicEnabled bool) error
- func (settings *BiosSettings) SetLogoDisplayTime(displayTime time.Duration) error
- func (settings *BiosSettings) SetLogoFadeIn(logoFadeIn bool) error
- func (settings *BiosSettings) SetLogoFadeOut(logoFadeOut bool) error
- func (settings *BiosSettings) SetLogoImagePath(logoImagePath string) error
- func (settings *BiosSettings) SetPXEDebugEnabled(PXEDebugEnabled bool) error
- func (settings *BiosSettings) SetTimeOffset(timeOffset time.Duration) error
- type BootMenuMode
- type CleanupMode
- type ClipboardMode
- type Console
- func (console *Console) GetDisplay() (Display, error)
- func (console *Console) GetEventSource() (EventSource, error)
- func (console *Console) GetKeyboard() (Keyboard, error)
- func (console *Console) GetMachine() (Machine, error)
- func (console *Console) GetMouse() (Mouse, error)
- func (console *Console) Initialized() bool
- func (console *Console) PowerDown() (Progress, error)
- func (console *Console) PowerUp() (Progress, error)
- func (console *Console) Release() error
- type DeviceType
- type Display
- func (display *Display) GetScreenResolution(screenId uint, resolution *Resolution) error
- func (display *Display) Initialized() bool
- func (display *Display) Release() error
- func (display *Display) TakeScreenShot(screenId uint, imageData []byte, width uint, height uint, bitmapFormat uint) ([]byte, error)
- func (display *Display) TakeScreenShotPngToArray(screenId uint, width uint, height uint) ([]byte, error)
- func (display *Display) TakeScreenShotToArray(screenId uint, width uint, height uint) ([]byte, error)
- type DnDMode
- type Event
- type EventListener
- type EventSource
- func (eventSource *EventSource) CreateAggregator(subordinates []EventSource) (EventSource, error)
- func (eventSource *EventSource) CreateListener() (EventListener, error)
- func (eventSource *EventSource) EventProcessed(eventListener EventListener, event Event) error
- func (eventSource *EventSource) FireEvent(eventListener EventListener, event Event, timeout int32) (bool, error)
- func (eventSource *EventSource) GetEvent(eventListener EventListener, timeout int32) (*Event, error)
- func (eventSource *EventSource) RegisterListener(eventListener EventListener, interesting []uint32, active bool) error
- func (eventSource *EventSource) Release() error
- func (eventSource *EventSource) UnregisterListener(eventListener EventListener) error
- type EventType
- type GuestOsType
- type GuestProperty
- type GuestPropertyChangedEvent
- type Keyboard
- type LockType
- type Machine
- func (machine *Machine) AddStorageController(name string, connectionType StorageBus) (StorageController, error)
- func (machine *Machine) AddUsbController(name string, controllerType UsbControllerType) (UsbController, error)
- func (machine *Machine) AttachDevice(controllerName string, controllerPort int, deviceSlot int, ...) error
- func (machine *Machine) CreateSharedFolder(name string, hostPath string, writable bool, automount bool) error
- func (machine *Machine) DeleteConfig(media []Medium) (Progress, error)
- func (machine *Machine) DeleteGuestProperty(key string) error
- func (machine *Machine) DetachDevice(controllerName string, controllerPort int, deviceSlot int) error
- func (machine *Machine) EnumerateGuestProperties(pattern string) ([]GuestProperty, error)
- func (machine *Machine) GetAccelerate2DVideoEnabled() (bool, error)
- func (machine *Machine) GetAccelerate3DEnabled() (bool, error)
- func (machine *Machine) GetAudioAdapter() (AudioAdapter, error)
- func (machine *Machine) GetBiosSettings() (BiosSettings, error)
- func (machine *Machine) GetCPUCount() (uint, error)
- func (machine *Machine) GetClipboardMode() (ClipboardMode, error)
- func (machine *Machine) GetDnDMode() (DnDMode, error)
- func (machine *Machine) GetGuestProperty(key string) (string, int, string, error)
- func (machine *Machine) GetGuestPropertyValue(key string) (string, error)
- func (machine *Machine) GetMedium(controllerName string, controllerPort int, deviceSlot int) (Medium, error)
- func (machine *Machine) GetMemorySize() (uint, error)
- func (machine *Machine) GetName() (string, error)
- func (machine *Machine) GetNetworkAdapter(deviceSlot int) (NetworkAdapter, error)
- func (machine *Machine) GetOsTypeId() (string, error)
- func (machine *Machine) GetPointingHidType() (PointingHidType, error)
- func (machine *Machine) GetSettingsFilePath() (string, error)
- func (machine *Machine) GetSettingsModified() (bool, error)
- func (machine *Machine) GetState() (uint, error)
- func (machine *Machine) GetVramSize() (uint, error)
- func (machine *Machine) Initialized() bool
- func (machine *Machine) Launch(session Session, uiType string, environment string) (Progress, error)
- func (machine *Machine) Register() error
- func (machine *Machine) Release() error
- func (machine *Machine) RemoveSharedFolder(name string) error
- func (machine *Machine) SaveSettings() error
- func (machine *Machine) SetAccelerate2DVideoEnabled(enabled bool) error
- func (machine *Machine) SetAccelerate3DEnabled(enabled bool) error
- func (machine *Machine) SetCPUCount(cpus uint) error
- func (machine *Machine) SetClipboardMode(mode ClipboardMode) error
- func (machine *Machine) SetDnDMode(mode DnDMode) error
- func (machine *Machine) SetExtraData(key string, value string) error
- func (machine *Machine) SetGuestProperty(key string, value string, flags string) error
- func (machine *Machine) SetGuestPropertyValue(key string, value string) error
- func (machine *Machine) SetMemorySize(ram uint) error
- func (machine *Machine) SetPointingHidType(pointingHidType PointingHidType) error
- func (machine *Machine) SetSettingsFilePath(path string) (Progress, error)
- func (machine *Machine) SetVramSize(vram uint) error
- func (machine *Machine) UnmountMedium(controllerName string, controllerPort int, deviceSlot int, force bool) error
- func (machine *Machine) Unregister(cleanupMode CleanupMode) ([]Medium, error)
- type MachineState
- type Medium
- func (medium *Medium) Close() error
- func (medium *Medium) CreateBaseStorage(size uint64, variants []MediumVariant) (Progress, error)
- func (medium *Medium) DeleteStorage() (Progress, error)
- func (medium *Medium) GetLocation() (string, error)
- func (medium *Medium) GetSize() (int64, error)
- func (medium *Medium) GetState() (MediumState, error)
- func (medium *Medium) Initialized() bool
- func (medium *Medium) Release() error
- type MediumFormat
- type MediumState
- type MediumVariant
- type Mouse
- func (mouse *Mouse) GetAbsoluteSupported() (bool, error)
- func (mouse *Mouse) GetRelativeSupported() (bool, error)
- func (mouse *Mouse) Initialized() bool
- func (mouse *Mouse) PutEvent(dx int, dy int, dz int, dw int, buttonState MouseButtonState) error
- func (mouse *Mouse) PutEventAbsolute(x int, y int, dz int, dw int, buttonState MouseButtonState) error
- func (mouse *Mouse) Release() error
- type MouseButtonState
- type NetworkAdapter
- func (adapter *NetworkAdapter) GetAdapterType() (NetworkAdapterType, error)
- func (adapter *NetworkAdapter) GetAttachmentType() (NetworkAttachmentType, error)
- func (adapter *NetworkAdapter) GetBridgeInterface() (string, error)
- func (adapter *NetworkAdapter) GetCableConnected() (bool, error)
- func (adapter *NetworkAdapter) GetEnabled() (bool, error)
- func (adapter *NetworkAdapter) GetGenericDriver() (string, error)
- func (adapter *NetworkAdapter) GetHostOnlyInterface() (string, error)
- func (adapter *NetworkAdapter) GetInternalNetwork() (string, error)
- func (adapter *NetworkAdapter) GetMACAddress() (string, error)
- func (adapter *NetworkAdapter) GetNATNetwork() (string, error)
- func (adapter *NetworkAdapter) GetSlot() (uint, error)
- func (adapter *NetworkAdapter) Release() error
- func (adapter *NetworkAdapter) SetAdapterType(adapterType NetworkAdapterType) error
- func (adapter *NetworkAdapter) SetAttachmentType(attachmentType NetworkAttachmentType) error
- func (adapter *NetworkAdapter) SetBridgedInterface(bridgedInterface string) error
- func (adapter *NetworkAdapter) SetCableConnected(cableConnected bool) error
- func (adapter *NetworkAdapter) SetEnabled(enabled bool) error
- func (adapter *NetworkAdapter) SetGenericDriver(genericDriver string) error
- func (adapter *NetworkAdapter) SetHostOnlyInterface(hostOnlyInterface string) error
- func (adapter *NetworkAdapter) SetInternalNetwork(internalNetwork string) error
- func (adapter *NetworkAdapter) SetMACAddress(macAddress string) error
- func (adapter *NetworkAdapter) SetNATNetwork(natNetwork string) error
- type NetworkAdapterType
- type NetworkAttachmentType
- type PointingHidType
- type Progress
- type Resolution
- type Session
- func (session *Session) GetConsole() (Console, error)
- func (session *Session) GetMachine() (Machine, error)
- func (session *Session) GetState() (SessionState, error)
- func (session *Session) GetType() (SessionType, error)
- func (session *Session) Init() error
- func (session *Session) Initialized() bool
- func (session *Session) LockMachine(machine Machine, lockType LockType) error
- func (session *Session) Release() error
- func (session *Session) UnlockMachine() error
- type SessionState
- type SessionType
- type StorageBus
- type StorageController
- func (controller *StorageController) GetBus() (StorageBus, error)
- func (controller *StorageController) GetName() (string, error)
- func (controller *StorageController) GetType() (StorageControllerType, error)
- func (controller *StorageController) Initialized() bool
- func (controller *StorageController) Release() error
- func (controller *StorageController) SetType(controllerType StorageControllerType) error
- type StorageControllerType
- type SystemProperties
- func (props *SystemProperties) GetMaxGuestCpuCount() (uint, error)
- func (props *SystemProperties) GetMaxGuestRam() (uint, error)
- func (props *SystemProperties) GetMaxGuestVram() (uint, error)
- func (props *SystemProperties) GetMediumFormats() ([]MediumFormat, error)
- func (props *SystemProperties) Initialized() bool
- func (props *SystemProperties) Release() error
- type UsbController
- type UsbControllerType
Constants ¶
const ( // Open the image file in read-only mode. AccessMode_ReadOnly = C.AccessMode_ReadOnly // Open the image file in read-write mode. AccessMode_ReadWrite = C.AccessMode_ReadWrite )
const ( APICMode_Disabled = C.APICMode_Disabled APICMode_APIC = C.APICMode_APIC APICMode_X2APIC = C.APICMode_X2APIC )
const ( BootMenuMode_Disabled = C.BIOSBootMenuMode_Disabled BootMenuMode_MenuOnly = C.BIOSBootMenuMode_MenuOnly BootMenuMode_MessageAndMenu = C.BIOSBootMenuMode_MessageAndMenu )
const ( // Unregister the machine, do not detach media or delete snapshots. CleanupMode_UnregisterOnly = C.CleanupMode_UnregisterOnly // Delete snapshots, detach media, do not return any media for closing. CleanupMode_DetachAllReturnNone = C.CleanupMode_DetachAllReturnNone // Delete snapshots, detach media, return hard disks for closing. // This does not return removable media attached to the VM. CleanupMode_DetachAllReturnHardDisksOnly = C.CleanupMode_DetachAllReturnHardDisksOnly // Delete snapshots, detach media, return all media for closing. // This is not recommended by the API documentation, because users generally // want to keep their ISOs around. CleanupMode_Full = C.CleanupMode_Full )
const ( ClipboardMode_Disabled = C.ClipboardMode_Disabled ClipboardMode_HostToGuest = C.ClipboardMode_HostToGuest ClipboardMode_GuestToHost = C.ClipboardMode_GuestToHost ClipboardMode_Bidirectional = C.ClipboardMode_Bidirectional )
const ( // No device DeviceType_Null = C.DeviceType_Null // Floppy device DeviceType_Floppy = C.DeviceType_Floppy // DVD/CD-ROM device DeviceType_Dvd = C.DeviceType_DVD // Hard disk device DeviceType_HardDisk = C.DeviceType_HardDisk // Hard disk device DeviceType_Network = C.DeviceType_Network // Hard disk device DeviceType_Usb = C.DeviceType_USB DeviceType_SharedFolder = C.DeviceType_SharedFolder )
const ( DnDMode_Disabled = C.DnDMode_Disabled DnDMode_HostToGuest = C.DnDMode_HostToGuest DnDMode_GuestToHost = C.DnDMode_GuestToHost DnDMode_Bidirectional = C.DnDMode_Bidirectional )
const ( EventType_Invalid = C.VBoxEventType_Invalid EventType_Any = C.VBoxEventType_Any EventType_Vetoable = C.VBoxEventType_Vetoable EventType_MachineEvent = C.VBoxEventType_MachineEvent EventType_SnapshotEvent = C.VBoxEventType_SnapshotEvent EventType_InputEvent = C.VBoxEventType_InputEvent EventType_LastWildcard = C.VBoxEventType_LastWildcard EventType_OnMachineStateChanged = C.VBoxEventType_OnMachineStateChanged EventType_OnMachineDataChanged = C.VBoxEventType_OnMachineDataChanged EventType_OnExtraDataChanged = C.VBoxEventType_OnExtraDataChanged EventType_OnExtraDataCanChange = C.VBoxEventType_OnExtraDataCanChange EventType_OnMediumRegistered = C.VBoxEventType_OnMediumRegistered EventType_OnMachineRegistered = C.VBoxEventType_OnMachineRegistered EventType_OnSessionStateChanged = C.VBoxEventType_OnSessionStateChanged EventType_OnSnapshotTaken = C.VBoxEventType_OnSnapshotTaken EventType_OnSnapshotDeleted = C.VBoxEventType_OnSnapshotDeleted EventType_OnSnapshotChanged = C.VBoxEventType_OnSnapshotChanged EventType_OnGuestPropertyChanged = C.VBoxEventType_OnGuestPropertyChanged EventType_OnMousePointerShapeChanged = C.VBoxEventType_OnMousePointerShapeChanged EventType_OnMouseCapabilityChanged = C.VBoxEventType_OnMouseCapabilityChanged EventType_OnKeyboardLedsChanged = C.VBoxEventType_OnKeyboardLedsChanged EventType_OnStateChanged = C.VBoxEventType_OnStateChanged EventType_OnAdditionsStateChanged = C.VBoxEventType_OnAdditionsStateChanged EventType_OnNetworkAdapterChanged = C.VBoxEventType_OnNetworkAdapterChanged EventType_OnSerialPortChanged = C.VBoxEventType_OnSerialPortChanged EventType_OnParallelPortChanged = C.VBoxEventType_OnParallelPortChanged EventType_OnStorageControllerChanged = C.VBoxEventType_OnStorageControllerChanged EventType_OnMediumChanged = C.VBoxEventType_OnMediumChanged EventType_OnVRDEServerChanged = C.VBoxEventType_OnVRDEServerChanged EventType_OnUSBControllerChanged = C.VBoxEventType_OnUSBControllerChanged EventType_OnUSBDeviceStateChanged = C.VBoxEventType_OnUSBDeviceStateChanged EventType_OnRuntimeError = C.VBoxEventType_OnRuntimeError EventType_OnCanShowWindow = C.VBoxEventType_OnCanShowWindow EventType_OnShowWindow = C.VBoxEventType_OnShowWindow EventType_OnCPUChanged = C.VBoxEventType_OnCPUChanged EventType_OnVRDEServerInfoChanged = C.VBoxEventType_OnVRDEServerInfoChanged EventType_OnEventSourceChanged = C.VBoxEventType_OnEventSourceChanged EventType_OnCPUExecutionCapChanged = C.VBoxEventType_OnCPUExecutionCapChanged EventType_OnGuestKeyboard = C.VBoxEventType_OnGuestKeyboard EventType_OnGuestMouse = C.VBoxEventType_OnGuestMouse EventType_OnNATRedirect = C.VBoxEventType_OnNATRedirect EventType_OnHostPCIDevicePlug = C.VBoxEventType_OnHostPCIDevicePlug EventType_OnVBoxSVCAvailabilityChanged = C.VBoxEventType_OnVBoxSVCAvailabilityChanged EventType_OnBandwidthGroupChanged = C.VBoxEventType_OnBandwidthGroupChanged EventType_OnGuestMonitorChanged = C.VBoxEventType_OnGuestMonitorChanged EventType_OnStorageDeviceChanged = C.VBoxEventType_OnStorageDeviceChanged EventType_OnClipboardModeChanged = C.VBoxEventType_OnClipboardModeChanged EventType_OnDnDModeChanged = C.VBoxEventType_OnDnDModeChanged EventType_OnNATNetworkChanged = C.VBoxEventType_OnNATNetworkChanged EventType_OnNATNetworkStartStop = C.VBoxEventType_OnNATNetworkStartStop EventType_OnNATNetworkAlter = C.VBoxEventType_OnNATNetworkAlter EventType_OnNATNetworkCreationDeletion = C.VBoxEventType_OnNATNetworkCreationDeletion EventType_OnNATNetworkSetting = C.VBoxEventType_OnNATNetworkSetting EventType_OnNATNetworkPortForward = C.VBoxEventType_OnNATNetworkPortForward EventType_OnGuestSessionStateChanged = C.VBoxEventType_OnGuestSessionStateChanged EventType_OnGuestSessionRegistered = C.VBoxEventType_OnGuestSessionRegistered EventType_OnGuestProcessRegistered = C.VBoxEventType_OnGuestProcessRegistered EventType_OnGuestProcessStateChanged = C.VBoxEventType_OnGuestProcessStateChanged EventType_OnGuestProcessInputNotify = C.VBoxEventType_OnGuestProcessInputNotify EventType_OnGuestProcessOutput = C.VBoxEventType_OnGuestProcessOutput EventType_OnGuestFileRegistered = C.VBoxEventType_OnGuestFileRegistered EventType_OnGuestFileStateChanged = C.VBoxEventType_OnGuestFileStateChanged EventType_OnGuestFileOffsetChanged = C.VBoxEventType_OnGuestFileOffsetChanged EventType_OnGuestFileRead = C.VBoxEventType_OnGuestFileRead EventType_OnGuestFileWrite = C.VBoxEventType_OnGuestFileWrite EventType_OnVideoCaptureChanged = C.VBoxEventType_OnVideoCaptureChanged EventType_OnGuestUserStateChanged = C.VBoxEventType_OnGuestUserStateChanged EventType_OnGuestMultiTouch = C.VBoxEventType_OnGuestMultiTouch EventType_OnHostNameResolutionConfigurationChange = C.VBoxEventType_OnHostNameResolutionConfigurationChange EventType_OnSnapshotRestored = C.VBoxEventType_OnSnapshotRestored EventType_OnMediumConfigChanged = C.VBoxEventType_OnMediumConfigChanged EventType_Last = C.VBoxEventType_Last )
const ( C.LockType_Shared // Exclusive lock needed to change VM settings or start it. LockType_Write = C.LockType_Write )LockType_Shared =
const ( MachineState_Null = C.MachineState_Null MachineState_PoweredOff = C.MachineState_PoweredOff MachineState_Saved = C.MachineState_Saved MachineState_Teleported = C.MachineState_Teleported MachineState_Aborted = C.MachineState_Aborted MachineState_Running = C.MachineState_Running MachineState_Paused = C.MachineState_Paused MachineState_Stuck = C.MachineState_Stuck MachineState_Teleporting = C.MachineState_Teleporting MachineState_LiveSnapshotting = C.MachineState_LiveSnapshotting MachineState_Starting = C.MachineState_Starting MachineState_Stopping = C.MachineState_Stopping MachineState_Saving = C.MachineState_Saving MachineState_Restoring = C.MachineState_Restoring MachineState_TeleportingPausedVM = C.MachineState_TeleportingPausedVM MachineState_TeleportingIn = C.MachineState_TeleportingIn MachineState_FaultTolerantSyncing = C.MachineState_FaultTolerantSyncing MachineState_DeletingSnapshotOnline = C.MachineState_DeletingSnapshotOnline MachineState_DeletingSnapshotPaused = C.MachineState_DeletingSnapshotPaused MachineState_OnlineSnapshotting = C.MachineState_OnlineSnapshotting MachineState_RestoringSnapshot = C.MachineState_RestoringSnapshot MachineState_DeletingSnapshot = C.MachineState_DeletingSnapshot MachineState_SettingUp = C.MachineState_SettingUp MachineState_Snapshotting = C.MachineState_Snapshotting MachineState_FirstOnline = C.MachineState_FirstOnline MachineState_LastOnline = C.MachineState_LastOnline MachineState_FirstTransient = C.MachineState_FirstTransient MachineState_LastTransient = C.MachineState_LastTransient )
const ( // The medium's backing image was not created or was deleted. MediumState_NotCreated = C.MediumState_NotCreated // The medium's backing image was not created or was deleted. MediumState_Created = C.MediumState_Created // The medium's backing image is locked with a shared reader lock. MediumState_LockedRead = C.MediumState_LockedRead // The medium's backing image is locked with an exclusive writer lock. MediumState_LockedWrite = C.MediumState_LockedWrite // The medium's backing image cannot / was not accessed. MediumState_Inaccessible = C.MediumState_Inaccessible // The medium's backing image is being built. MediumState_Creating = C.MediumState_Creating // The medium's backing image is being deleted. MediumState_Deleting = C.MediumState_Deleting )
const ( // No button is pressed. MouseButtonState_None = 0 MouseButtonState_LeftButton = C.MouseButtonState_LeftButton MouseButtonState_RightButton = C.MouseButtonState_RightButton MouseButtonState_MiddleButton = C.MouseButtonState_MiddleButton MouseButtonState_WheelUp = C.MouseButtonState_WheelUp MouseButtonState_WheelDown = C.MouseButtonState_WheelDown MouseButtonState_XButton1 = C.MouseButtonState_XButton1 MouseButtonState_XButton2 = C.MouseButtonState_XButton2 )
const ( NetworkAdapterType_Null = C.NetworkAdapterType_Null NetworkAdapterType_Am79C970A = C.NetworkAdapterType_Am79C970A NetworkAdapterType_Am79C973 = C.NetworkAdapterType_Am79C973 NetworkAdapterType_I82540EM = C.NetworkAdapterType_I82540EM NetworkAdapterType_I82543GC = C.NetworkAdapterType_I82543GC NetworkAdapterType_I82545EM = C.NetworkAdapterType_I82545EM NetworkAdapterType_Virtio = C.NetworkAdapterType_Virtio )
const ( NetworkAttachmentType_Null = C.NetworkAttachmentType_Null NetworkAttachmentType_NAT = C.NetworkAttachmentType_NAT NetworkAttachmentType_Bridged = C.NetworkAttachmentType_Bridged NetworkAttachmentType_Internal = C.NetworkAttachmentType_Internal NetworkAttachmentType_HostOnly = C.NetworkAttachmentType_HostOnly NetworkAttachmentType_Generic = C.NetworkAttachmentType_Generic NetworkAttachmentType_NATNetwork = C.NetworkAttachmentType_NATNetwork )
const ( // No mouse PointingHidType_None = C.PointingHIDType_None // PS/2 mouse PointingHidType_Ps2Mouse = C.PointingHIDType_PS2Mouse // USB mouse (relative pointer) PointingHidType_UsbMouse = C.PointingHIDType_USBMouse // USB tablet (absolute pointer) PointingHidType_UsbTablet = C.PointingHIDType_USBTablet // Combo PS2/2 or USB mouse, depending on guest (negative perf implications) PointingHidType_ComboMouse = C.PointingHIDType_ComboMouse // USB multi-touch device // This also adds USB tablet and mouse devices. PointingHidType_UsbMultiTouch = C.PointingHIDType_USBMultiTouch )
const ( // Null value that is never used by the API StorageBus_Null = C.StorageBus_Null StorageBus_Ide = C.StorageBus_IDE StorageBus_Sata = C.StorageBus_SATA StorageBus_Scsi = C.StorageBus_SCSI StorageBus_Floppy = C.StorageBus_Floppy StorageBus_Sas = C.StorageBus_SAS )
const ( // Null value that is never used by the API SessionState_Null = C.SessionState_Null // The session / machine is not locked. SessionState_Unlocked = C.SessionState_Unlocked // The session / machine is locked. SessionState_Locked = C.SessionState_Locked // Transient state while a VM is locked and started. SessionState_Spawning = C.SessionState_Spawning // The session is getting unlocked. SessionState_Unlocking = C.SessionState_Unlocking )
const ( // Null value that is never used by the API SessionType_Null = C.SessionType_Null // The session has an exclusive lock on a VM. SessionType_WriteLock = C.SessionType_WriteLock // The session has launched a VM process. SessionType_Remote = C.SessionType_Remote SessionType_Shared = C.SessionType_Shared )
const ( // Null value that is never used by the API StorageControllerType_Null = C.StorageControllerType_Null // SCSI controller of the LsiLogic variant StorageControllerType_LsiLogic = C.StorageControllerType_LsiLogic // SCSI controller of the BusLogic variant StorageControllerType_BusLogic = C.StorageControllerType_BusLogic // The only SATA controller available StorageControllerType_IntelAhci = C.StorageControllerType_IntelAhci // IDE controller of the PIIX3 variant StorageControllerType_Piix3 = C.StorageControllerType_PIIX3 // IDE controller of the PIIX4 variant StorageControllerType_Piix4 = C.StorageControllerType_PIIX4 // IDE controller of the ICH6 variant StorageControllerType_Ich6 = C.StorageControllerType_ICH6 // The only floppy drive controller available StorageControllerType_I82078 = C.StorageControllerType_I82078 // LsiLogic SCSI controller that uses SAS StorageControllerType_LsiLogicSas = C.StorageControllerType_LsiLogicSas )
const ( // Null value that is never used by the API UsbControllerType_Null = C.USBControllerType_Null // USB 1.1 controller available in the free VirtualBox edition UsbControllerType_Ohci = C.USBControllerType_OHCI // USB 2.0 controller that requires the extension pack UsbControllerType_Ehci = C.USBControllerType_EHCI )
Variables ¶
var ApiVersion uint = 0
var AppVersion uint = 0
Functions ¶
func ComposeMachineFilename ¶
ComposeMachineFilename returns a default VM config file path. If baseFolder is empty, VirtualBox's default machine folder will be used. It returns a string and any error encountered.
func Deinit ¶
func Deinit() error
Deinit cleans up the VirtualBox global state. After this method is called, all VirtualBox-related objects are invalid. It returns any error encountered.
func GetRevision ¶
GetRevision returns VirtualBox's SVN revision as a number.
func Init ¶
func Init() error
Init initializes the VirtualBox global data structures.
Due to VirtualBox oddness, Init should ideally be called in the application's main thread. The odds of this happening are maximized by calling Init() from the application's main goroutine.
It returns any error encountered.
func SetExtraData ¶
Types ¶
type AudioAdapter ¶
type AudioAdapter struct {
// contains filtered or unexported fields
}
The description of a audio adapter
func (*AudioAdapter) Release ¶
func (a *AudioAdapter) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
type BiosSettings ¶
type BiosSettings struct {
// contains filtered or unexported fields
}
Controls a running VM.
func (*BiosSettings) GetACPIEnabled ¶
func (settings *BiosSettings) GetACPIEnabled() (bool, error)
func (*BiosSettings) GetAPICMode ¶
func (settings *BiosSettings) GetAPICMode() (APICMode, error)
func (*BiosSettings) GetBootMenuMode ¶
func (settings *BiosSettings) GetBootMenuMode() (BootMenuMode, error)
GetBootMenuMode returns true if the BIOS logo fades out during boot. It returns a boolean and any error encountered.
func (*BiosSettings) GetIOAPICEnabled ¶
func (settings *BiosSettings) GetIOAPICEnabled() (bool, error)
func (*BiosSettings) GetLogoDisplayTime ¶
func (settings *BiosSettings) GetLogoDisplayTime() (time.Duration, error)
func (*BiosSettings) GetLogoFadeIn ¶
func (settings *BiosSettings) GetLogoFadeIn() (bool, error)
GetLogoFadeIn returns true if the BIOS logo fades in during boot. It returns a boolean and any error encountered.
func (*BiosSettings) GetLogoFadeOut ¶
func (settings *BiosSettings) GetLogoFadeOut() (bool, error)
GetLogoFadeOut returns true if the BIOS logo fades out during boot. It returns a boolean and any error encountered.
func (*BiosSettings) GetLogoImagePath ¶
func (settings *BiosSettings) GetLogoImagePath() (string, error)
func (*BiosSettings) GetPXEDebugEnabled ¶
func (settings *BiosSettings) GetPXEDebugEnabled() (bool, error)
func (*BiosSettings) GetTimeOffset ¶
func (settings *BiosSettings) GetTimeOffset() (time.Duration, error)
func (*BiosSettings) Initialized ¶
func (settings *BiosSettings) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*BiosSettings) Release ¶
func (settings *BiosSettings) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*BiosSettings) SetACPIEnabled ¶
func (settings *BiosSettings) SetACPIEnabled(acpiEnabled bool) error
func (*BiosSettings) SetAPICMode ¶
func (settings *BiosSettings) SetAPICMode(apicMode APICMode) error
func (*BiosSettings) SetBootMenuMode ¶
func (settings *BiosSettings) SetBootMenuMode(menuMode BootMenuMode) error
SetBootMenuMode sets whether the BIOS logo fades out during boot. It any error encountered.
func (*BiosSettings) SetIOAPICEnabled ¶
func (settings *BiosSettings) SetIOAPICEnabled(ioapicEnabled bool) error
func (*BiosSettings) SetLogoDisplayTime ¶
func (settings *BiosSettings) SetLogoDisplayTime(displayTime time.Duration) error
func (*BiosSettings) SetLogoFadeIn ¶
func (settings *BiosSettings) SetLogoFadeIn(logoFadeIn bool) error
SetLogoFadeIn sets whether the BIOS logo fades in during boot. It any error encountered.
func (*BiosSettings) SetLogoFadeOut ¶
func (settings *BiosSettings) SetLogoFadeOut(logoFadeOut bool) error
SetLogoFadeOut sets whether the BIOS logo fades out during boot. It any error encountered.
func (*BiosSettings) SetLogoImagePath ¶
func (settings *BiosSettings) SetLogoImagePath(logoImagePath string) error
func (*BiosSettings) SetPXEDebugEnabled ¶
func (settings *BiosSettings) SetPXEDebugEnabled(PXEDebugEnabled bool) error
func (*BiosSettings) SetTimeOffset ¶
func (settings *BiosSettings) SetTimeOffset(timeOffset time.Duration) error
type ClipboardMode ¶
type ClipboardMode uint
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Controls a running VM.
func (*Console) GetDisplay ¶
GetDisplay obtains the display of the VM controlled by this. It returns a new Display instance and any error encountered.
func (*Console) GetEventSource ¶
func (console *Console) GetEventSource() (EventSource, error)
func (*Console) GetKeyboard ¶
GetKeyboard obtains the keyboard of the VM controlled by this. It returns a new Keyboard instance and any error encountered.
func (*Console) GetMachine ¶
GetMachine obtains the VM associated with this set of VM controls. It returns a new Machine instance and any error encountered.
func (*Console) GetMouse ¶
GetMouse obtains the mouse of the VM controlled by this. It returns a new Mouse instance and any error encountered.
func (*Console) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
The display of a running VM.
func (*Display) GetScreenResolution ¶
func (display *Display) GetScreenResolution(screenId uint, resolution *Resolution) error
GetScreenResolution reads the VM display's resolution. It returns any error encountered.
func (*Display) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Display) Release ¶
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*Display) TakeScreenShot ¶
func (display *Display) TakeScreenShot(screenId uint, imageData []byte, width uint, height uint, bitmapFormat uint) ([]byte, error)
TakeScreenShot takes a screenshot of the VM's display. The slice passed in must be big enough to receive the image data, which is RGBA (4 bytes per pixel). It returns any error encountered.
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
The description of a VirtualBox machine
func (*Event) GetSource ¶
func (event *Event) GetSource() (EventSource, error)
func (*Event) GetWaitable ¶
func (*Event) Release ¶
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*Event) SetProcessed ¶
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
The description of a VirtualBox machine
func (*EventListener) Release ¶
func (eventListener *EventListener) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
type EventSource ¶
type EventSource struct {
// contains filtered or unexported fields
}
The description of a VirtualBox machine
func (*EventSource) CreateAggregator ¶
func (eventSource *EventSource) CreateAggregator(subordinates []EventSource) (EventSource, error)
func (*EventSource) CreateListener ¶
func (eventSource *EventSource) CreateListener() (EventListener, error)
func (*EventSource) EventProcessed ¶
func (eventSource *EventSource) EventProcessed(eventListener EventListener, event Event) error
func (*EventSource) FireEvent ¶
func (eventSource *EventSource) FireEvent(eventListener EventListener, event Event, timeout int32) (bool, error)
func (*EventSource) GetEvent ¶
func (eventSource *EventSource) GetEvent(eventListener EventListener, timeout int32) (*Event, error)
func (*EventSource) RegisterListener ¶
func (eventSource *EventSource) RegisterListener(eventListener EventListener, interesting []uint32, active bool) error
func (*EventSource) Release ¶
func (eventSource *EventSource) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*EventSource) UnregisterListener ¶
func (eventSource *EventSource) UnregisterListener(eventListener EventListener) error
type GuestOsType ¶
type GuestOsType struct {
// contains filtered or unexported fields
}
The description of a supported guest OS type
func GetGuestOsTypes ¶
func GetGuestOsTypes() ([]GuestOsType, error)
GetGuestOsTypes returns the guest OS types supported by VirtualBox. It returns a slice of GuestOsType instances and any error encountered.
func (*GuestOsType) GetId ¶
func (osType *GuestOsType) GetId() (string, error)
GetId returns the string used to identify this OS type in other API calls. It returns a string and any error encountered.
func (*GuestOsType) Initialized ¶
func (osType *GuestOsType) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*GuestOsType) Release ¶
func (osType *GuestOsType) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
type GuestProperty ¶
type GuestPropertyChangedEvent ¶
type GuestPropertyChangedEvent struct { Event // contains filtered or unexported fields }
func NewGuestPropertyChangedEvent ¶
func NewGuestPropertyChangedEvent(event *Event) (GuestPropertyChangedEvent, error)
func (*GuestPropertyChangedEvent) GetFlags ¶
func (event *GuestPropertyChangedEvent) GetFlags() (string, error)
func (*GuestPropertyChangedEvent) GetName ¶
func (event *GuestPropertyChangedEvent) GetName() (string, error)
func (*GuestPropertyChangedEvent) GetValue ¶
func (event *GuestPropertyChangedEvent) GetValue() (string, error)
type Keyboard ¶
type Keyboard struct {
// contains filtered or unexported fields
}
The keyboard of a running VM.
func (*Keyboard) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Keyboard) PutScancodes ¶
PutScancodes posts keyboard scancodes to the guest OS event queue. It returns any error encountered.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
The description of a VirtualBox machine
func CreateMachine ¶
CreateMachine creates a VirtualBox machine. The machine must be registered by calling Register before it shows up in the GetMachines list. Flags is comma-separated. The most interesting flag is forceOverwrite=1. It returns the created machine and any error encountered.
func FindMachine ¶
FindMachine returns the VirtualBox machine with the given name. It returns a new Machine instance and any error encountered.
func GetMachines ¶
GetMachines returns the machines known to VirtualBox. It returns a slice of Machine instances and any error encountered.
func (*Machine) AddStorageController ¶
func (machine *Machine) AddStorageController( name string, connectionType StorageBus) (StorageController, error)
AddStorageController attaches a storage controller to a VirtualBox VM. It returns the created StorageController and any error encountered.
func (*Machine) AddUsbController ¶
func (machine *Machine) AddUsbController( name string, controllerType UsbControllerType) (UsbController, error)
AddUsbController attaches a storage controller to a VirtualBox VM. It returns the created UsbController and any error encountered.
func (*Machine) AttachDevice ¶
func (machine *Machine) AttachDevice(controllerName string, controllerPort int, deviceSlot int, deviceType DeviceType, medium Medium) error
AttachDevice connects a Medium to this VM. deviceSlot is 0 for IDE master and 1 for IDE slave. All other bus types use deviceSlot 0. It returns any error encountered.
func (*Machine) CreateSharedFolder ¶
func (*Machine) DeleteConfig ¶
DeleteConfig removes a VM's config file, and can remove its disk images. The Medium array is intended to be obtained from a previous Unregister call. It returns a Progress instance and any error encountered.
func (*Machine) DeleteGuestProperty ¶
func (*Machine) DetachDevice ¶
func (machine *Machine) DetachDevice(controllerName string, controllerPort int, deviceSlot int) error
DetachDevice disconnects a Medium from this VM. deviceSlot is 0 for IDE master and 1 for IDE slave. All other bus types use deviceSlot 0. It returns any error encountered.
func (*Machine) EnumerateGuestProperties ¶
func (machine *Machine) EnumerateGuestProperties(pattern string) ([]GuestProperty, error)
func (*Machine) GetAccelerate2DVideoEnabled ¶
func (*Machine) GetAccelerate3DEnabled ¶
func (*Machine) GetAudioAdapter ¶
func (machine *Machine) GetAudioAdapter() (AudioAdapter, error)
func (*Machine) GetBiosSettings ¶
func (machine *Machine) GetBiosSettings() (BiosSettings, error)
GetBiosSettings obtains the controls for the VM associated with this machine. The call fails unless the VM associated with this machine has started. It returns a new BiosSettings instance and any error encountered.
func (*Machine) GetCPUCount ¶
func (*Machine) GetClipboardMode ¶
func (machine *Machine) GetClipboardMode() (ClipboardMode, error)
func (*Machine) GetDnDMode ¶
func (*Machine) GetGuestProperty ¶
func (*Machine) GetGuestPropertyValue ¶
func (*Machine) GetMedium ¶
func (machine *Machine) GetMedium(controllerName string, controllerPort int, deviceSlot int) (Medium, error)
GetMedium returns a Medium connected to this VM. It returns the requested Medium and any error encountered.
func (*Machine) GetMemorySize ¶
GetMemorySize returns the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) GetName ¶
GetName returns the machine's name. It returns a string and any error encountered.
func (*Machine) GetNetworkAdapter ¶
func (machine *Machine) GetNetworkAdapter(deviceSlot int) (NetworkAdapter, error)
func (*Machine) GetOsTypeId ¶
GetOsTypeId returns a string used to identify the guest OS type. It returns a string and any error encountered.
func (*Machine) GetPointingHidType ¶
func (machine *Machine) GetPointingHidType() (PointingHidType, error)
GetPointingHidType returns the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) GetSettingsFilePath ¶
GetSettingsFilePath returns the path of the machine's settings file. It returns a string and any error encountered.
func (*Machine) GetSettingsModified ¶
GetSettingsModified asks VirtualBox if this machine has unsaved settings. It returns a boolean and any error encountered.
func (*Machine) GetVramSize ¶
GetVramSize returns the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Machine) Launch ¶
func (machine *Machine) Launch(session Session, uiType string, environment string) (Progress, error)
Launch swapns a process that executes this VM. The given session will receive a shared lock on the VM. It returns a Progress and any error encountered.
func (*Machine) Register ¶
Register adds this to VirtualBox's list of registered machines. Once a VM is registered, it becomes immutable. Its configuration can only be changed by creating a Session, LockMachine-ing the machine to the session, and obtaining the Session's version of the machine via GetMachine. It returns any error encountered.
func (*Machine) Release ¶
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*Machine) RemoveSharedFolder ¶
func (*Machine) SaveSettings ¶
SaveSettings saves a machine's modified settings. A new machine must have its settings saved before it can be registered. It returns a boolean and any error encountered.
func (*Machine) SetAccelerate2DVideoEnabled ¶
func (*Machine) SetAccelerate3DEnabled ¶
func (*Machine) SetCPUCount ¶
func (*Machine) SetClipboardMode ¶
func (machine *Machine) SetClipboardMode(mode ClipboardMode) error
func (*Machine) SetDnDMode ¶
func (*Machine) SetGuestProperty ¶
func (*Machine) SetGuestPropertyValue ¶
func (*Machine) SetMemorySize ¶
SetMemorySize changes the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) SetPointingHidType ¶
func (machine *Machine) SetPointingHidType( pointingHidType PointingHidType) error
SetPointingHidType changes the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) SetSettingsFilePath ¶
func (*Machine) SetVramSize ¶
SetVramSize changes the machine's emulated mouse type. It returns a number and any error encountered.
func (*Machine) UnmountMedium ¶
func (machine *Machine) UnmountMedium(controllerName string, controllerPort int, deviceSlot int, force bool) error
UnmountMedium ejects a removable Medium from this VM. It returns any error encountered.
func (*Machine) Unregister ¶
func (machine *Machine) Unregister(cleanupMode CleanupMode) ([]Medium, error)
Unregister removes this from VirtualBox's list of registered machines. The returned slice of Medium instances is intended to be passed to DeleteConfig to get all the VM's files cleaned. It returns an array of detached Medium instances and any error encountered.
type Medium ¶
type Medium struct {
// contains filtered or unexported fields
}
The description of a VirtualBox storage medium
func CreateHardDisk ¶
CreateHardDisk creates a VirtualBox storage medium for a hard disk image. The disk's contents must be created by calling createBaseStorage. It returns the created Medium and any error encountered.
func OpenMedium ¶
func OpenMedium(location string, deviceType DeviceType, accessMode AccessMode, forceNewUuid bool) (Medium, error)
OpenMedium opens an image backing a VirtualBox storage medium. It returns the newly opened Medium and any error encountered.
func (*Medium) Close ¶
Close removes the bond between the Medium object and the image backing it. After this call, the Medium instance should be released, as any calls involving it will error out. The image file is not deleted, so it can be bound to a new Medium by calling OpenMedium. It returns any error encountered.
func (*Medium) CreateBaseStorage ¶
func (medium *Medium) CreateBaseStorage( size uint64, variants []MediumVariant) (Progress, error)
CreateBaseStorage starts building a hard disk image. It returns a Progress and any error encountered.
func (*Medium) DeleteStorage ¶
DeleteStorage starts deleting the image backing a storage medium. It returns a Progress and any error encountered.
func (*Medium) GetLocation ¶
GetLocation returns the path to the image file backing the storage medium. It returns a string and any error encountered.
func (*Medium) GetSize ¶
GetSize returns the actual size of the image backing the medium. The returned size can be smaller than the logical size for dynamically grown images. It returns a byte quantity and any error encountered.
func (*Medium) GetState ¶
func (medium *Medium) GetState() (MediumState, error)
GetState returns the last known medium state. It returns a MediumState enum instance and any error encountered.
func (*Medium) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
type MediumFormat ¶
type MediumFormat struct {
// contains filtered or unexported fields
}
The description of a supported storage medium format
func (*MediumFormat) GetId ¶
func (format *MediumFormat) GetId() (string, error)
GetId returns the string used to identify this format in other API calls. It returns a string and any error encountered.
func (*MediumFormat) Initialized ¶
func (format *MediumFormat) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*MediumFormat) Release ¶
func (format *MediumFormat) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
type MediumVariant ¶
type MediumVariant uint
Enumeration of MediumVariant values
const ( // Default image options. MediumVariant_Standard MediumVariant = C.MediumVariant_Standard // Entire image is allocated at creation time. MediumVariant_Fixed MediumVariant = C.MediumVariant_Fixed // The image's directory is not created. MediumVariant_NoCreateDir MediumVariant = C.MediumVariant_NoCreateDir )
type Mouse ¶
type Mouse struct {
// contains filtered or unexported fields
}
The mouse of a running VM.
func (*Mouse) GetAbsoluteSupported ¶
GetAbsoluteSupported checks if the guest handles absolute mouse positioning. If it returns false, PutEventAbsolute() is a no-op. It returns a number and any error encountered.
func (*Mouse) GetRelativeSupported ¶
GetRelativeSupported checks if the guest handles relative mouse positioning. If it returns false, PutEvent() is a no-op. It returns a number and any error encountered.
func (*Mouse) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Mouse) PutEvent ¶
PutEvent posts a mouse event to the guest OS event queue. dz represents vertical mouse wheel moves (rotations), with positive numbers for clockwise rotations. dw represents horizontal mouse wheel moves, with positive numbers for movements to the left. It returns any error encountered.
func (*Mouse) PutEventAbsolute ¶
func (mouse *Mouse) PutEventAbsolute(x int, y int, dz int, dw int, buttonState MouseButtonState) error
PutEventAbsolute posts a mouse event to the guest OS event queue. dz represents vertical mouse wheel moves (rotations), with positive numbers for clockwise rotations. dw represents horizontal mouse wheel moves, with positive numbers for movements to the left. It returns any error encountered.
type NetworkAdapter ¶
type NetworkAdapter struct {
// contains filtered or unexported fields
}
The description of a VirtualBox machine
func (*NetworkAdapter) GetAdapterType ¶
func (adapter *NetworkAdapter) GetAdapterType() (NetworkAdapterType, error)
func (*NetworkAdapter) GetAttachmentType ¶
func (adapter *NetworkAdapter) GetAttachmentType() (NetworkAttachmentType, error)
func (*NetworkAdapter) GetBridgeInterface ¶
func (adapter *NetworkAdapter) GetBridgeInterface() (string, error)
func (*NetworkAdapter) GetCableConnected ¶
func (adapter *NetworkAdapter) GetCableConnected() (bool, error)
func (*NetworkAdapter) GetEnabled ¶
func (adapter *NetworkAdapter) GetEnabled() (bool, error)
func (*NetworkAdapter) GetGenericDriver ¶
func (adapter *NetworkAdapter) GetGenericDriver() (string, error)
func (*NetworkAdapter) GetHostOnlyInterface ¶
func (adapter *NetworkAdapter) GetHostOnlyInterface() (string, error)
func (*NetworkAdapter) GetInternalNetwork ¶
func (adapter *NetworkAdapter) GetInternalNetwork() (string, error)
func (*NetworkAdapter) GetMACAddress ¶
func (adapter *NetworkAdapter) GetMACAddress() (string, error)
func (*NetworkAdapter) GetNATNetwork ¶
func (adapter *NetworkAdapter) GetNATNetwork() (string, error)
func (*NetworkAdapter) GetSlot ¶
func (adapter *NetworkAdapter) GetSlot() (uint, error)
func (*NetworkAdapter) Release ¶
func (adapter *NetworkAdapter) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*NetworkAdapter) SetAdapterType ¶
func (adapter *NetworkAdapter) SetAdapterType(adapterType NetworkAdapterType) error
func (*NetworkAdapter) SetAttachmentType ¶
func (adapter *NetworkAdapter) SetAttachmentType(attachmentType NetworkAttachmentType) error
func (*NetworkAdapter) SetBridgedInterface ¶
func (adapter *NetworkAdapter) SetBridgedInterface(bridgedInterface string) error
func (*NetworkAdapter) SetCableConnected ¶
func (adapter *NetworkAdapter) SetCableConnected(cableConnected bool) error
func (*NetworkAdapter) SetEnabled ¶
func (adapter *NetworkAdapter) SetEnabled(enabled bool) error
func (*NetworkAdapter) SetGenericDriver ¶
func (adapter *NetworkAdapter) SetGenericDriver(genericDriver string) error
func (*NetworkAdapter) SetHostOnlyInterface ¶
func (adapter *NetworkAdapter) SetHostOnlyInterface(hostOnlyInterface string) error
func (*NetworkAdapter) SetInternalNetwork ¶
func (adapter *NetworkAdapter) SetInternalNetwork(internalNetwork string) error
func (*NetworkAdapter) SetMACAddress ¶
func (adapter *NetworkAdapter) SetMACAddress(macAddress string) error
func (*NetworkAdapter) SetNATNetwork ¶
func (adapter *NetworkAdapter) SetNATNetwork(natNetwork string) error
type NetworkAttachmentType ¶
type NetworkAttachmentType uint
Enumeration of NetworkAttachmentType values
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Tracks the progress of a long-running operation.
func (*Progress) GetPercent ¶
GetPercent returns the completion percentage of the tracked operation. It returns a number and any error encountered.
func (*Progress) GetResultCode ¶
GetResultCode returns the result code of the tracked operation. It returns a number and any error encountered.
func (*Progress) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Progress) Release ¶
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*Progress) WaitForCompletion ¶
WaitForCompletion waits for all the operations tracked by this to complete. The timeout argument is in milliseconds. -1 is used to wait indefinitely. It returns any error encountered.
type Resolution ¶
type Resolution struct { Width uint Height uint BitsPerPixel uint XOrigin int YOrigin int GuestMonitorStatus uint }
Represents the resolution of a running VM's display.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A session gets associated to a VM lock.
func (*Session) GetConsole ¶
GetConsole obtains the controls for the VM associated with this session. The call fails unless the VM associated with this session has started. It returns a new Console instance and any error encountered.
func (*Session) GetMachine ¶
GetMachine obtains the VM associated with this session. It returns a new Machine instance and any error encountered.
func (*Session) GetState ¶
func (session *Session) GetState() (SessionState, error)
GetState obtains the current state of this session. It returns the SessionState and any error encountered.
func (*Session) GetType ¶
func (session *Session) GetType() (SessionType, error)
GetType obtains the session's type. It returns the SessionType and any error encountered.
func (*Session) Initialized ¶
Initialized returns true if there is VirtualBox data associated with this.
func (*Session) LockMachine ¶
LockMachine obtains a lock on a VM, so it can be modified or started. It returns any error encountered.
func (*Session) Release ¶
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*Session) UnlockMachine ¶
UnlockMachine releases the VM locked by this session. It returns any error encountered.
type StorageController ¶
type StorageController struct {
// contains filtered or unexported fields
}
The description of a VirtualBox storage controller
func (*StorageController) GetBus ¶
func (controller *StorageController) GetBus() (StorageBus, error)
GetBus returns the controller's bus type. It returns a number and any error encountered.
func (*StorageController) GetName ¶
func (controller *StorageController) GetName() (string, error)
GetName returns the controller's name. The controller's name identifies it in AttachDevice() calls. It returns a string and any error encountered.
func (*StorageController) GetType ¶
func (controller *StorageController) GetType() (StorageControllerType, error)
GetType returns the controller's type. It returns a number and any error encountered.
func (*StorageController) Initialized ¶
func (controller *StorageController) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*StorageController) Release ¶
func (controller *StorageController) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
func (*StorageController) SetType ¶
func (controller *StorageController) SetType( controllerType StorageControllerType) error
SetType changes the controller's type. It returns a number and any error encountered.
type StorageControllerType ¶
type StorageControllerType uint
Enumeration of StorageControllerType values
type SystemProperties ¶
type SystemProperties struct {
// contains filtered or unexported fields
}
The description of a VirtualBox storage medium
func GetSystemProperties ¶
func GetSystemProperties() (SystemProperties, error)
GetSystemProperties fetches the VirtualBox system properties. It returns the a new SystemProperties instance and any error encountered.
func (*SystemProperties) GetMaxGuestCpuCount ¶
func (props *SystemProperties) GetMaxGuestCpuCount() (uint, error)
GetMaxGuestCpuCount reads the maximum number of CPUs on a guest VM. It returns a number and any error encountered.
func (*SystemProperties) GetMaxGuestRam ¶
func (props *SystemProperties) GetMaxGuestRam() (uint, error)
GetMaxGuestRAM reads the maximum allowed amount of RAM on a guest VM. It returns a megabyte quantity and any error encountered.
func (*SystemProperties) GetMaxGuestVram ¶
func (props *SystemProperties) GetMaxGuestVram() (uint, error)
GetMaxGuestVRAM reads the maximum allowed amount of video RAM on a guest VM. It returns a megabyte quantity and any error encountered.
func (*SystemProperties) GetMediumFormats ¶
func (props *SystemProperties) GetMediumFormats() ([]MediumFormat, error)
GetMediumFormats returns the guest OS formats supported by VirtualBox. It returns a slice of MediumFormat instances and any error encountered.
func (*SystemProperties) Initialized ¶
func (props *SystemProperties) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*SystemProperties) Release ¶
func (props *SystemProperties) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.
type UsbController ¶
type UsbController struct {
// contains filtered or unexported fields
}
The description of a VirtualBox USB controller
func (*UsbController) GetName ¶
func (controller *UsbController) GetName() (string, error)
GetName returns the controller's name. It returns a string and any error encountered.
func (*UsbController) GetStandard ¶
func (controller *UsbController) GetStandard() (int, int, error)
GetStandard returns the USB standard supported by the controller. It returns two numbers (the major and minor versions of the standard), and any error encountered.
func (*UsbController) GetType ¶
func (controller *UsbController) GetType() (UsbControllerType, error)
GetType returns the controller's type. It returns a number and any error encountered.
func (*UsbController) Initialized ¶
func (controller *UsbController) Initialized() bool
Initialized returns true if there is VirtualBox data associated with this.
func (*UsbController) Release ¶
func (controller *UsbController) Release() error
Release frees up the associated VirtualBox data. After the call, this instance is invalid, and using it will cause errors. It returns any error encountered.