Overview
The VS Code sandbox image includes:- code-server (VS Code Web) pre-installed
- Non-root user (
vscode) for security - Workspace directory at
/workspace - Full VS Code extension support
Building the Image
Build the VS Code sandbox image from the Dockerfile:Pull Pre-built Image
Alternatively, pull the pre-built image:Setup OpenSandbox Server
Start the local OpenSandbox server:Complete Example
This example creates a sandbox with code-server running and provides browser access:Example Output
The script will start code-server and output the accessible URL:Screenshots
Terminal Access
Full VS Code Interface
Features
Full VS Code Experience
- Complete VS Code interface in the browser
- Extension support
- Integrated terminal
- File explorer and editor
- Git integration
- Debugging support
Remote Development
- Access your development environment from anywhere
- No local installation required
- Consistent environment across devices
- Shareable development environments
Customization
- Install VS Code extensions
- Configure settings and themes
- Add language servers and tools
- Mount custom workspaces
Configuration Options
code-server Arguments
| Argument | Description |
|---|---|
--bind-addr | Address and port to bind to |
--auth | Authentication method (none, password) |
--disable-telemetry | Disable telemetry |
/workspace | Initial workspace directory |
Environment Variables
| Variable | Default | Description |
|---|---|---|
SANDBOX_DOMAIN | localhost:8080 | OpenSandbox server address |
SANDBOX_API_KEY | - | API key for authentication |
SANDBOX_IMAGE | opensandbox/vscode:latest | Docker image to use |
PYTHON_VERSION | 3.11 | Python version in sandbox |
CODE_PORT | 8443 | Port for code-server |
Use Cases
Cloud Development
- Provide browser-based IDEs to users
- Enable development without local setup
- Support for teaching and training
- Temporary development environments
AI-Assisted Development
- Give AI agents access to a full development environment
- Enable code editing and execution
- Test code in isolated environments
- Automate development workflows
Code Review and Collaboration
- Share development environments with team members
- Review code in a live environment
- Pair programming over the web
- Demo features in progress
Security Considerations
- Authentication: Example disables auth for simplicity. Enable
--auth passwordfor production. - Network Isolation: Sandbox provides network isolation from host.
- User Permissions: Runs as non-root
vscodeuser. - Temporary Environments: Sandboxes can be destroyed after use.