virtualbox: add ability to import b2d instances

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-04-08 12:05:28 -04:00
parent 576951e03a
commit 7a4e16e082
2 changed files with 10 additions and 2 deletions

View File

@ -192,7 +192,7 @@ func (d *Driver) Create() error {
}
log.Debugf("Importing SSH key...")
keyPath := filepath.Join(utils.GetHomeDir(), ".ssh", "id_rsa")
keyPath := filepath.Join(utils.GetHomeDir(), ".ssh", "id_boot2docker")
if err := utils.CopyFile(keyPath, d.GetSSHKeyPath()); err != nil {
return err
}
@ -203,7 +203,6 @@ func (d *Driver) Create() error {
}
log.Infof("Creating SSH key...")
if err := ssh.GenerateSSHKey(d.GetSSHKeyPath()); err != nil {
return err
}

View File

@ -79,6 +79,15 @@ func CopyFile(src, dst string) error {
return err
}
fi, err := os.Stat(src)
if err != nil {
return err
}
if err := os.Chmod(dst, fi.Mode()); err != nil {
return err
}
return nil
}