Skip to content

Commit

Permalink
fix mount hostPath by making it absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed May 7, 2020
1 parent 755206f commit 7a19246
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vms/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/mhewedy/vermin/db"
"github.com/mhewedy/vermin/db/info"
"github.com/mhewedy/vermin/images"
"path/filepath"
"strconv"
"time"
)
Expand All @@ -27,11 +28,16 @@ func Mount(vmName string, hostPath string) error {
return err
}

absHostPath, err := filepath.Abs(hostPath)
if err != nil {
return err
}

if _, err = command.VBoxManage("sharedfolder",
"add",
vmName,
"--name", strconv.FormatInt(time.Now().Unix(), 10),
"--hostpath", hostPath,
"--hostpath", absHostPath,
"--transient",
"--automount",
"--auto-mount-point", "/vermin").Call(); err != nil {
Expand Down

0 comments on commit 7a19246

Please sign in to comment.