Overview
SmolVM.browser() and SmolVM.desktop() return a sandbox object that is ready to use. Read its URLs to connect tools, use its lifecycle methods to stop it, and use browser helpers when the sandbox runs Chromium.
The same object works as a context manager, so the sandbox stops when the with block exits.
URLs and identifiers
Stable browser or desktop sandbox ID.
ID of the underlying SmolVM sandbox.
Browser automation URL for Playwright or another Chrome DevTools Protocol client. Available in browser mode.
Alias for
cdp_url.Web URL you can open in your own browser to watch or interact with the screen. Available for visible browser and desktop modes.
VNC URL for desktop viewers and computer-use agents. VNC means Virtual Network Computing, a standard way to view and control a remote screen. Available for visible browser and desktop modes.
Local folder where collected logs, downloads, recordings, and other session artifacts are stored.
Current lifecycle state for the sandbox, such as
created, starting, ready, stopping, or error.Lifecycle methods
stop
delete
stop(). Use it when you want the same naming style as regular SmolVM sandboxes.
close
open_viewer
viewer_url in your default browser and returns whether the local browser accepted the request.
Browser helpers
These helpers are available when the object came fromSmolVM.browser().
connect_playwright
cdp_url.
Install Playwright locally before calling this method:
pip install playwright.screenshot
Local file path for the screenshot.
Capture the full page when possible.
push_file
pull_file
collect_artifacts
artifacts_dir. Returns the archive path when artifacts are available.
logs
Example
display_sandbox.py
Related
- Browser and desktop sandboxes - Start browser and desktop modes
- Browser and desktop options - Configure viewport, resources, profiles, and recording
