From f1f34722ee18f9010047458f09451d5b0c07377e Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 28 Oct 2024 09:22:08 +0000 Subject: [PATCH] feat(tun): mention in 'operation not permitted' error the user should specify --device /dev/net/tun --- internal/tun/create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/tun/create.go b/internal/tun/create.go index 1fe07a357..5c5c5242a 100644 --- a/internal/tun/create.go +++ b/internal/tun/create.go @@ -34,6 +34,9 @@ func (t *Tun) Create(path string) (err error) { fd, err := unix.Open(path, 0, 0) if err != nil { + if err.Error() == "operation not permitted" { + err = fmt.Errorf("%w (did you specify --device /dev/net/tun to your container command?)", err) + } return fmt.Errorf("unix opening TUN device file: %w", err) }