Merge pull request #751 from slashk/750-virtualbox-saved-paused-support

fixes Issue #750 by allowing virtualbox driver
This commit is contained in:
Evan Hazlett 2015-03-09 22:41:19 -04:00
commit 790d0cbf49
1 changed files with 9 additions and 1 deletions

View File

@ -344,11 +344,19 @@ func (d *Driver) Start() error {
return err
}
if s == state.Stopped {
switch s {
case state.Stopped, state.Saved:
if err := vbm("startvm", d.MachineName, "--type", "headless"); err != nil {
return err
}
log.Infof("Waiting for VM to start...")
case state.Paused:
if err := vbm("controlvm", d.MachineName, "resume", "--type", "headless"); err != nil {
return err
}
log.Infof("Resuming VM ...")
default:
log.Infof("VM not in restartable state")
}
return ssh.WaitForTCP(fmt.Sprintf("localhost:%d", d.SSHPort))