Documentation ¶
Index ¶
- func AddSharedFolder(app, vmx string, shareName, newHostPath string) error
- func CaptureScreen(app, vmx, username, password, dst string) error
- func CopyFileFromGuestToHost(app, vmx, username, password, guestFilepath, hostFilepath string) error
- func CopyFileFromHostToGuest(app, vmx, username, password, hostFilepath, guestFilepath string) error
- func CreateTempfileInGuest(app, vmx, username, password string) (string, error)
- func DeleteFileInGuest(app, vmx, username, password, filename string) error
- func DeleteSnapshot(app, vmx, snapshotName string, deleteChildren bool) error
- func DirectoryExistsInGuest(app, vmx string, username, password string, dir string) bool
- func DisableSharedFolders(app, vmx string, runtime bool) error
- func EnableSharedFolders(app, vmx string, runtime bool) error
- func FileExistsInGuest(app, vmx string, username, password string, filename string) bool
- func GetGuestIPAddress(app, vmx string, wait bool) (string, error)
- func KillProcessInGuest(app, vmx, username, password string, pid int) error
- func ListDirectoryInGuest(app, vmx, username, password, dir string) ([]string, error)
- func ListSnapshots(app, vmx string) ([]string, int, error)
- func Pause(app, vmx string) error
- func ReadVariable(app, vmx, username, password string, mode VariableMode, env string) (string, error)
- func RemoveSharedFolder(app, vmx, shareName string) error
- func RenameFileInGuest(app, vmx, username, password, src, dst string) error
- func Reset(app, vmx string, hard bool) error
- func RevertToSnapshot(app, vmx, snapshotName string) error
- func RunProgramInGuest(app, vmx string, username, password string, config RunInGuestConfig, ...) error
- func RunScriptInGuest(app, vmx, username, password string, config RunInGuestConfig, ...) error
- func SetSharedFolderState(app, vmx string, shareName, hostPath string, writable bool) error
- func Snapshot(app, vmx, snapshotName string) error
- func Start(app, vmx string, gui bool) error
- func Stop(app, vmx string, hard bool) error
- func Suspend(app, vmx string, hard bool) error
- func Unpause(app, vmx string) error
- func WriteVariable(app, vmx, username, password string, mode VariableMode, env, value string) error
- type ListProcessesInGuestInfo
- type RunInGuestConfig
- type VariableMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSharedFolder ¶
AddSharedFolder add a Host-Guest shared folder.
func CaptureScreen ¶
CaptureScreen capture the screen of the VM to a local file.
func CopyFileFromGuestToHost ¶
func CopyFileFromGuestToHost(app, vmx, username, password, guestFilepath, hostFilepath string) error
CopyFileFromGuestToHost copy a file from guest OS to host OS.
func CopyFileFromHostToGuest ¶
func CopyFileFromHostToGuest(app, vmx, username, password, hostFilepath, guestFilepath string) error
CopyFileFromHostToGuest copy a file from host OS to guest OS.
func CreateTempfileInGuest ¶
CreateTempfileInGuest create a temporary file in Guest OS.
func DeleteFileInGuest ¶
DeleteFileInGuest delete a file in Guest OS.
func DeleteSnapshot ¶
DeleteSnapshot remove a snapshot from a VM.
func DirectoryExistsInGuest ¶
DirectoryExistsInGuest check if a directory exists in Guest OS.
func DisableSharedFolders ¶
DisableSharedFolders disable shared folders in Guest. Stops the guest virtual machine, specified by .vmx file, from sharing folders with its host.
The optional runtime argument means to stop sharing folders only until the virtual machine is powered off. Otherwise, the setting persists at next power on.
func EnableSharedFolders ¶
EnableSharedFolders enable shared folders in Guest.
The optional runtime argument means to share folders only until the virtual machine is powered off. Otherwise, the setting persists at next power on.
func FileExistsInGuest ¶
FileExistsInGuest check if a file exists in Guest OS.
func GetGuestIPAddress ¶
GetGuestIPAddress gets the IP address of the guest.
func KillProcessInGuest ¶
KillProcessInGuest kill a process in Guest OS.
func ListDirectoryInGuest ¶
ListDirectoryInGuest list a directory in Guest OS.
func ListSnapshots ¶
ListSnapshots list all snapshots in a VM.
func ReadVariable ¶
func ReadVariable(app, vmx, username, password string, mode VariableMode, env string) (string, error)
ReadVariable read a variable in the VM state.
func RemoveSharedFolder ¶
RemoveSharedFolder remove a Host-Guest shared folder.
func RenameFileInGuest ¶
RenameFileInGuest rename a file in Guest OS.
func RevertToSnapshot ¶
RevertToSnapshot set VM state to a snapshot.
func RunProgramInGuest ¶
func RunProgramInGuest(app, vmx string, username, password string, config RunInGuestConfig, cmdPath string, cmdArgs ...string) error
RunProgramInGuest run a program in Guest OS.
func RunScriptInGuest ¶
func RunScriptInGuest(app, vmx, username, password string, config RunInGuestConfig, interpreter, script string) error
RunScriptInGuest run a script in Guest OS.
func SetSharedFolderState ¶
SetSharedFolderState modify a Host-Guest shared folder.
func WriteVariable ¶
func WriteVariable(app, vmx, username, password string, mode VariableMode, env, value string) error
WriteVariable write a variable in the VM state.
Types ¶
type ListProcessesInGuestInfo ¶
ListProcessesInGuestInfo represents a result of listprocessesinguest command.
func ListProcessesInGuest ¶
func ListProcessesInGuest(app, vmx, username, password string) ([]ListProcessesInGuestInfo, error)
ListProcessesInGuest List running processes in Guest OS.
type RunInGuestConfig ¶
type RunInGuestConfig int
RunInGuestConfig represents a runProgramInGuest and runScriptInGuest commands flag.
const ( // NoWait returns a prompt immediately after the program starts in the guest, rather than waiting for it to finish. // This option is useful for interactive programs. NoWait RunInGuestConfig = 1 << iota // ActiveWindow ensures that the Windows GUI is visible, not minimized. // It has no effect on Linux. ActiveWindow // Interactive forces interactive guest login. // It is useful for Vista and Windows 7 guests to make the program visible in the console window. Interactive )
func (RunInGuestConfig) String ¶
func (r RunInGuestConfig) String() string
String implements a fmt.Stringer interface.
type VariableMode ¶
type VariableMode int
VariableMode represents a writeVariable or readVariable command mode.
const ( // RuntimeConfig runtime‐only value that provides a simple way to pass runtime values in and out of the guest. RuntimeConfig VariableMode = 1 << iota // GuestEnv non‐persistent guest variable. GuestEnv // GuestVar runtime configuration parameter as stored in the .vmx file, or an environment variable. GuestVar )
func (VariableMode) String ¶
func (v VariableMode) String() string
String implements a fmt.Stringer interface.