virtualboxapi

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SshPortRuleName = "terraform_ssh_port_rule"
)

Variables

This section is empty.

Functions

func DeleteVM added in v0.0.2

func DeleteVM(vmName string) error

func DestroyVM

func DestroyVM(vmName string) error

func GetVmIp

func GetVmIp(vminfo *VirtualboxVMInfo) (string, error)

func InjectSSHKey

func InjectSSHKey(vmName, sshUser, sshKey string) error

Types

type NetworkType

type NetworkType string
const (
	Bridged     NetworkType = "bridged"
	Nat         NetworkType = "nat"
	Hostonly    NetworkType = "nostonly"
	Hostonlynet NetworkType = "hostonlynet"
	Generic     NetworkType = "generic"
	Natnetwork  NetworkType = "natnetwork"
)

type VMBootType

type VMBootType string
const (
	Gui      VMBootType = "gui"
	Headless VMBootType = "headless"
	Sdl      VMBootType = "sdl"
	Separate VMBootType = "separate"
)

type VMStateType added in v0.0.2

type VMStateType string
const (
	Poweroff VMStateType = "poweroff"
)

type VirtualboxVMInfo

type VirtualboxVMInfo struct {
	ID       string
	Name     string
	State    VMStateType
	VmdkPath string
	SSHPort  string
}

func CreateVM

func CreateVM(imagePath, vmName string, memory, cpus int64) (*VirtualboxVMInfo, error)

func ForwardLocalPort

func ForwardLocalPort(vmName string, guestPort int) (*VirtualboxVMInfo, error)

func GetVMInfo

func GetVMInfo(vmName string) (*VirtualboxVMInfo, error)

func StartVM

func StartVM(vmName string, vmType VMBootType) (*VirtualboxVMInfo, error)

func StopVM

func StopVM(vmName string) (*VirtualboxVMInfo, error)

Jump to

Keyboard shortcuts

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