Better HN
topnewbestaskshowjobs
Log inSign up

eperot

7 karma · joined Aug 2, 2022 (4y ago) · 16 submissions

Submissions

comment 2w ago · link · parent

The way gVisor uses KVM isn't really the way a hypervisor does, though. There's no Linux guest kernel, the Sentry is both the VMM and the guest kernel and flips itself between the two modes. vCPUs are bound dynamically. No device emulation layer. Saying "it uses KVM" is technically accurate (when using the KVM platform), but extrapolating from that that it looks like a hypervisor/VM would also be incorrect. :)

comment 1mo ago · link · parent

Thanks for using gVisor! Love to see it used in the wild for hobby projects.

comment 1mo ago · link · parent

Try running `dmesg` in your Cloud Run instance and see for yourself if that's actually the case :)

comment 1mo ago · link · parent

gVisor does support NVIDIA GPUs and some Vulkan ioctls are supported. If you want to run games in it and find incompatibilities, patches welcome :) Agents are great at completing gVisor's nvproxy ioctls nowadays.

I've personally run Unreal Tournament 2004 at 40fps on my laptop, with pure software-rendered OpenGL a few years ago (GPU support wasn't there at the time).

5.

GVisor is being donated to CNCF(gvisor.dev ↗)

7 points · by eperot · 1mo ago · discuss

comment 4mo ago · link · parent

gVisor is open-source, and `cuda-checkpoint` is freely available.

gVisor's `runsc checkpoint` subcommand supports a `--save-restore-exec-argv` which lets you specify a program to execute before gVisor starts taking the process snapshot.

You can fill in the blanks from there.

comment 4mo ago · link · parent

Wrong headline order, right? Should read "Reduce GPU Cold Starts with gVisor Snapshotting".

comment 4mo ago · link · parent

Ah, I see the distinction. In my case, I was using the PulseAudio client+server with a network sink running in-sandbox, producing a set of audio samples that are then replayed by a PulseAudio client in the out-of-sandbox Rust application receiving these samples. Exposing the socket directly to the sandbox is dangerous, e.g. it would let the sandbox record the host's microphone directly.

My goal was for the sandbox to only have access to a single dumb playback sink and no other access by default, and to gate any further access (e.g. microphone access) in something the out-of-sandbox software can catch and ask the user about before it is granted to the sandbox.

comment 5mo ago · link · parent

That's the approach I initially took, but experienced some combination of noticeable stuttering and latency regardless of which buffering strategy I tried... Had to switch to a shared memory ring buffer, along with some adaptive playback speed shenanigans (sometimes imperceptibly speeding up playback when falling behind production of audio samples, sometimes imperceptibly slowing down when there's less than a few milliseconds' worth of samples left in the ringbuffer), in order to achieve actually-gapless playback.

comment 5mo ago · link · parent

Thanks. We're working on rootless network setup to make `runsc do --rootless` work with networking enabled when `passt` is installed right now. See issue #13337 (yes that's a cool issue number) which should unblock this.

The tty issue is known, should be fixed soon too, though contributions welcome as it sounds like it should be simple fix and we love more contributions :)

FWIW, X11 apps work well, I have a personal hacky project in which I've been running Librewolf in gVisor, with the window being reflected as a native Wayland window. It uses `Xvfb -fbdir` aimed at a bound tmpfs mount to get a shared memory region containing the window's pixel data which can be read directly from out of the sandbox, has Pulseaudio audio passthrough, and a socket server passing through mouse/keyboard events to make the window interactive. Works smoothly even for YouTube playback, and I successfully played a game of Unreal Tournament 2004 at 24fps in it, with no noticeable mouse/keyboard latency :) We're basically making baby steps to get there less hackily.

Thanks for the feedback!

comment 5mo ago · link · parent

Any reason why you wouldn't use gVisor's bwrap interface yet? We're working on it precisely to make DIY sandboxing on Linux as easy as possible in order to get Linux-sandboxing-at-home to mature beyond the current syscall-filter-and-namespaces duct tape stage, so I'm curious to know what you'd like to see.

comment 7mo ago · link · parent

An overkill fully-local multi-agent setup with gVisor sandboxing. Hope some folks here can appreciate the Evangelion vibes :)

13.

Magi: Multi-Agent GVisor Isolation(gvisor.dev ↗)

7 points · by eperot · 7mo ago · 1 comment

comment 2y ago · link · parent

I have been [working on one](https://github.com/EtiennePerot/safe-code-execution)! The library is in [src/safecode/sandbox.py](https://github.com/EtiennePerot/safe-code-execution/blob/mas...).