Documentation
¶
Index ¶
- Variables
- type B2DUpdater
- type DiskCreator
- type Driver
- func (d *Driver) Create() error
- func (d *Driver) CreateVM() error
- func (d *Driver) DriverName() string
- func (d *Driver) GetCreateFlags() []mcnflag.Flag
- func (d *Driver) GetIP() (string, error)
- func (d *Driver) GetSSHHostname() (string, error)
- func (d *Driver) GetSSHUsername() string
- func (d *Driver) GetState() (state.State, error)
- func (d *Driver) GetURL() (string, error)
- func (d *Driver) IsVTXDisabled() bool
- func (d *Driver) IsVTXDisabledInTheVM() (bool, error)
- func (d *Driver) Kill() error
- func (d *Driver) PreCreateCheck() error
- func (d *Driver) Remove() error
- func (d *Driver) Restart() error
- func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error
- func (d *Driver) Start() error
- func (d *Driver) Stop() error
- type HostInterfaces
- type IPWaiter
- type LogsReader
- type RandomInter
- type SSHKeyGenerator
- type Sleeper
- type VBoxCmdManager
- type VBoxManager
- type VM
- type VirtualDisk
Constants ¶
This section is empty.
Variables ¶
var (
ErrMachineNotExist = errors.New("machine does not exist")
ErrVBMNotFound = errors.New("VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path")
)
var (
ErrUnableToGenerateRandomIP = errors.New("unable to generate random IP")
ErrMustEnableVTX = errors.New("This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory")
ErrNotCompatibleWithHyperV = errors.New("Hyper-V is installed. VirtualBox won't boot a 64bits VM when Hyper-V is activated. If it's installed but deactivated, you can use --virtualbox-no-vtx-check to try anyways")
ErrNetworkAddrCidr = errors.New("host-only cidr must be specified with a host address, not a network address")
ErrNetworkAddrCollision = errors.New("host-only cidr conflicts with the network address of a host interface")
)
Functions ¶
This section is empty.
Types ¶
type B2DUpdater ¶ added in v0.6.0
type B2DUpdater interface {
UpdateISOCache(storePath, isoURL string) error
CopyIsoToMachineDir(storePath, machineName, isoURL string) error
}
B2DUpdater describes the interactions with b2d.
func NewB2DUpdater ¶ added in v0.6.0
func NewB2DUpdater() B2DUpdater
type DiskCreator ¶ added in v0.6.0
type DiskCreator interface {
Create(size int, publicSSHKeyPath, diskPath string) error
}
func NewDiskCreator ¶ added in v0.6.0
func NewDiskCreator() DiskCreator
type Driver ¶
type Driver struct {
*drivers.BaseDriver
VBoxManager
HostInterfaces
CPU int
Memory int
DiskSize int
NatNicType string
Boot2DockerURL string
Boot2DockerImportVM string
HostDNSResolver bool
HostOnlyCIDR string
HostOnlyNicType string
HostOnlyPromiscMode string
NoShare bool
DNSProxy bool
NoVTXCheck bool
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(hostName, storePath string) *Driver
NewDriver creates a new VirtualBox driver with default settings.
func (*Driver) DriverName ¶
func (d *Driver) DriverName() string
DriverName returns the name of the driver
func (*Driver) GetCreateFlags ¶ added in v0.5.0
func (d *Driver) GetCreateFlags() []mcnflag.Flag
GetCreateFlags registers the flags this driver adds to "docker hosts create"
func (*Driver) GetSSHHostname ¶ added in v0.2.0
func (d *Driver) GetSSHHostname() (string, error)
func (*Driver) GetSSHUsername ¶ added in v0.2.0
func (d *Driver) GetSSHUsername() string
func (*Driver) IsVTXDisabled ¶ added in v0.5.0
func (d *Driver) IsVTXDisabled() bool
IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start. If we can't be sure it is disabled, we carry on and will check the vm logs after it's started. We want to check that either vmx or svm flags are present in /proc/cpuinfo.
func (*Driver) IsVTXDisabledInTheVM ¶ added in v0.5.0
func (d *Driver) IsVTXDisabledInTheVM() (bool, error)
IsVTXDisabledInTheVM checks if VT-X is disabled in the started vm.
func (*Driver) PreCreateCheck ¶
func (d *Driver) PreCreateCheck() error
PreCreateCheck checks that VBoxManage exists and works
func (*Driver) Restart ¶
func (d *Driver) Restart() error
Restart restarts a machine which is known to be running.
func (*Driver) SetConfigFromFlags ¶
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error
type HostInterfaces ¶ added in v0.7.0
type HostInterfaces interface {
Interfaces() ([]net.Interface, error)
Addrs(iface *net.Interface) ([]net.Addr, error)
}
HostInterfaces returns host network interface info. By default delegates to net.Interfaces()
func NewHostInterfaces ¶ added in v0.7.0
func NewHostInterfaces() HostInterfaces
type IPWaiter ¶ added in v0.6.0
type IPWaiter interface {
Wait(d *Driver) error
}
IPWaiter waits for an IP to be configured.
func NewIPWaiter ¶ added in v0.6.0
func NewIPWaiter() IPWaiter
type LogsReader ¶ added in v0.6.0
type LogsReader interface {
Read(path string) ([]string, error)
}
LogsReader describes the reading of VBox.log
func NewLogsReader ¶ added in v0.6.0
func NewLogsReader() LogsReader
type RandomInter ¶ added in v0.6.0
type RandomInter interface {
RandomInt(n int) int
}
RandomInter returns random int values.
func NewRandomInter ¶ added in v0.6.0
func NewRandomInter() RandomInter
type SSHKeyGenerator ¶ added in v0.6.0
type SSHKeyGenerator interface {
Generate(path string) error
}
SSHKeyGenerator describes the generation of ssh keys.
func NewSSHKeyGenerator ¶ added in v0.6.0
func NewSSHKeyGenerator() SSHKeyGenerator
type Sleeper ¶ added in v0.6.0
type Sleeper interface {
Sleep(d time.Duration)
}
Sleeper sleeps for given duration.
func NewSleeper ¶ added in v0.6.0
func NewSleeper() Sleeper
type VBoxCmdManager ¶ added in v0.5.0
type VBoxCmdManager struct {
// contains filtered or unexported fields
}
VBoxCmdManager communicates with VirtualBox through the commandline using `VBoxManage`.
func NewVBoxManager ¶ added in v0.5.6
func NewVBoxManager() *VBoxCmdManager
NewVBoxManager creates a VBoxManager instance.
type VBoxManager ¶ added in v0.5.0
type VBoxManager interface {
// contains filtered or unexported methods
}
VBoxManager defines the interface to communicate to VirtualBox.
type VirtualDisk ¶ added in v0.3.0
type VirtualDisk struct {
UUID string
Path string
}