Tips to setup a local gVisor dev environment ?

9 views
Skip to first unread message

h...@itrooz.fr

unread,
Apr 11, 2026, 7:26:01 AM (9 days ago) Apr 11
to gviso...@googlegroups.com
Hello ! Could someone here help me setup a gVisor development environment ?

Commands like `make copy TARGETS=runsc DESTINATION=bin/` work, but I'm having trouble enabling intellisense on my IDE (VSCode), mainly because of errors like `gvisor.dev/gvisor/pkg/sentry/socket/netstack/events_go_proto` being not found, or `primitive.Int32` not implementing CopyIn.

I understand that these errors are about dynamically generated code, but I can't find a way to generate it in the right place.

I've noticed a section about GOPATH in the contributing docs, but it seems like a deprecated Go feature (https://go.dev/wiki/GOPATH#deprecating-and-removing-gopath-development-mode), and I haven't been able to make it work (it generates a gopath.zip instead of gopath/, and unzipping this folder manually still doesn't make my IDE happy, I believe this is because the official Go extension switches du Go modules when go.mod exists)

I have also tried the devcontainer, which yields the same errors.

What IDE/configuration is the gVisor team using, if any ?

Thanks in advance,
iTrooz

Etienne Perot

unread,
Apr 13, 2026, 9:01:05 PM (7 days ago) Apr 13
to h...@itrooz.fr, gviso...@googlegroups.com
Hi there. gVisor is centered around the Bazel build system, which is useful for automated code generation of certain gVisor functions, e.g. auto-generated save-restore Go code on most structs.

If your IDE shows up errors due to this, one way to work around this is to use the `go` branch of the repository, which contains an automatically-exported view of the repository in a more conventional Go project layout, useful for tools that need to operate with this format (e.g. go module imports). You may want to try to switch to that branch and see if this becomes easier to work with. Note however that PRs must be made against the `master` branch, so while this may help with development, you'd need the extra task of porting your changes over to `master` and make them work with the Bazel build system before upstreaming.

We should probably write some AGENTS.md file explaining this build process to ensure automated coding tools understand this complexity.

> What IDE/configuration is the gVisor team using, if any ?

Within Google, most gVisor contributors use a Bazel-aware editor based on VSCode. It still isn't aware of things like Go's conditional build tags (like, say, this one) so it still produces similar errors to those you're seeing on some modules. Nothing is perfect :)

HTH,
- Etienne

--
You received this message because you are subscribed to the Google Groups "gVisor Development [Public]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gvisor-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gvisor-dev/wktXYnvzt_l7X6MP-JZh-JblZM4gA3jRSIGjZra1Wfu2ivc_TMEO3wdjy2srvktu6RJjNN_LDllR_iewpDm3A5N6_RzCpBjZY7no9YakcZM%3D%40itrooz.fr.
Reply all
Reply to author
Forward
0 new messages