diff --git a/pkg/machine/qemu/options_darwin_arm64.go b/pkg/machine/qemu/options_darwin_arm64.go index d75237938a..e9c0c5ab42 100644 --- a/pkg/machine/qemu/options_darwin_arm64.go +++ b/pkg/machine/qemu/options_darwin_arm64.go @@ -46,13 +46,23 @@ func getOvmfDir(imagePath, vmName string) string { */ func getEdk2CodeFdPathFromQemuBinaryPath() string { cfg, err := config.Default() - if err == nil { - execPath, err := cfg.FindHelperBinary(QemuCommand, true) - if err == nil { - return filepath.Clean(filepath.Join(filepath.Dir(execPath), "..", "share", "qemu")) - } + if err != nil { + return "" + } + execPath, err := cfg.FindHelperBinary(QemuCommand, true) + if err != nil { + return "" + } + + sharePath := func(path string) string { + return filepath.Clean(filepath.Join(filepath.Dir(path), "..", "share", "qemu")) + } + + symlinkedPath, err := filepath.EvalSymlinks(execPath) + if err != nil { + return sharePath(execPath) } - return "" + return sharePath(symlinkedPath) } /*