Skip to content

Commit 17bea09

Browse files
committed
fix failure to start container with networking enabled
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent b7fc692 commit 17bea09

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

internal/shim/task/mount.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ func (bm *bindMounter) FromBundle(ctx context.Context, b *bundle.Bundle) error {
242242
specSrc = path.Join(vmTarget, filepath.Base(m.Source))
243243
}
244244

245+
// Resolve symlinks in the host path because libkrun opens it with
246+
// O_NOFOLLOW, which rejects symlinks (e.g., /etc -> /private/etc on macOS).
247+
hostSrc, err = filepath.EvalSymlinks(hostSrc)
248+
if err != nil {
249+
return fmt.Errorf("failed to resolve symlinks for bind mount source %s: %w", hostSrc, err)
250+
}
251+
245252
transformed := bindMount{
246253
tag: tag,
247254
hostSrc: hostSrc,

0 commit comments

Comments
 (0)