A high-performance PTY terminal emulator for WebVR. Interact with your computer's CLI applications and files from within a virtual reality environment (Meta Quest, phone VR, etc.).
Traditional VNC or screen-casting solutions for VR often suffer from high bandwidth requirements and latency because they stream grids of pixels. VR-Terminal takes a different approach by streaming a grid of characters, similar to how SSH or local terminals work.
- Low Bandwidth: Only character data and styling metadata are sent over the wire.
- Portability: Designed to work on any device with a modern web browser and WebVR support.
- Native Performance: Uses a real PTY (Pseudo-Terminal) on the host machine for full compatibility with CLI tools.
VR-Terminal provides direct shell access to your host computer via a web browser.
- Localhost Only: By default, you should only run this on
localhost. - Network Exposure: Do NOT make this application accessible from the public internet or an ntrusted network unless you have implemented robust authentication and understand the security implications.
- Root Access: Avoid running the backend as a root user, as any user with access to the web interface will have full control over your system.
- Axum: High-performance web framework.
- Socketioxide: Socket.IO server implementation for real-time grid streaming.
- Portable-PTY: Cross-platform PTY interface.
- VTE: A library-agnostic terminal emulator engine (parser).
- Tokio: Asynchronous runtime for handling multiple concurrent streams.
- React: Component-based UI logic.
- A-Frame: WebVR framework for rendering the virtual environment.
- 2D Canvas Texture: The terminal is rendered to a 2D canvas and mapped as a dynamic texture onto a 3D plane in the VR scene.
- Socket.IO Client: Receives real-time terminal snapshots.
-
Clone the repository:
git clone https://github.com/your-username/VR-Terminal.git cd VR-Terminal -
Build the Frontend:
cd frontend npm install npm run build cd ..
-
Run the Backend:
cargo run --release
The server will start at
http://localhost:8081. -
Access the Terminal: Open
http://localhost:8081in your browser. Click "Enter VR" to switch to the virtual environment.
You can also run the entire stack using Docker Compose:
docker-compose up --buildFor WebVR to work properly on some headsets (like Meta Quest), you may need to serve the application over HTTPS.
-
Generate self-signed certificates:
mkdir -p certs openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes -subj "/CN=localhost" -
Run with TLS enabled:
TLS_ENABLED=true TLS_CERT_PATH=certs/cert.pem TLS_KEY_PATH=certs/key.pem cargo run --release
PORT: The port the server listens on (default:8081).TLS_ENABLED: Set totrueto enable HTTPS (requiresTLS_CERT_PATHandTLS_KEY_PATH).FRONTEND_BUILD_DIR: Path to the frontend build artifacts (default:frontend/build).CORS_ALLOWED_ORIGINS: Comma-separated list of allowed origins.
- G1 Support: Optimized rendering for low-end VR headsets.
- Remote Server Options: Support for connecting to remote SSH targets.
- Keybard mapping as part of the terminal, for folks that use tools like kanata
Apache 2.0