# Computer use with Desktop - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/sandbox-integrations-desktop

# Computer use with Desktop

Novita Desktop is a secure virtual desktop framework specifically engineered for developing Computer Use Agents. This solution provides a comprehensive, isolated desktop environment that enables AI agents to securely interact with desktop applications through controlled virtualization.
This document will provide detailed instructions on how to run this on Novita Agent sandbox service.

###

[​](#1-get-novita-api-key)

1. Get Novita API Key

###

[​](#2-environment-configuration)

2. Environment Configuration

Before you start using the service, you need to configure the necessary environment variables:

Bash

```
export NOVITA_API_KEY=
```

###

[​](#3-sdk-installation)

3. SDK Installation

Select the appropriate installation method corresponding to your development environment and programming language:

JavaScript & TypeScript

Python

```
npm i novita_sandbox
```

###

[​](#4-implementation-examples)

4. Implementation Examples

####

[​](#get-virtual-desktop-stream-vnc-url)

Get Virtual Desktop Stream VNC URL

The following implementation demonstrates the instantiation of a virtual desktop environment and the retrieval of VNC access endpoints for remote desktop interaction:

JavaScript & TypeScript

Python

```
// demo.ts implementation
import { Sandbox } from 'novita-sandbox/desktop'

async function main() {
// Initialize virtual desktop sandbox instance
const desktop = await Sandbox.create()

// Activate desktop streaming service
await desktop.stream.start()

// Retrieve interactive VNC endpoint URL
const url = desktop.stream.getUrl()
console.log(url)

// Expected output format:
// Browser-accessible URL for interactive virtual desktop session. Suitable for application integration.
// https://6080-ik0n7lc3j0dvqd4jxy6g7.us-phx-1.sandbox.novita.ai/vnc.html?autoconnect=true&resize=scale

// Retrieve read-only VNC endpoint URL (interaction disabled)
const urlDisabledInteraction = desktop.stream.getUrl({ viewOnly: true })
console.log(urlDisabledInteraction)
// Expected output format:
// Browser-accessible URL for view-only virtual desktop session (non-interactive mode). Suitable for monitoring applications.
// https://6080-ik0n7lc3j0dvqd4jxy6g7.us-phx-1.sandbox.novita.ai/vnc.html?autoconnect=true&view_only=true&resize=scale

// Keep the program running
console.log("Desktop stream started, press Ctrl+C to stop the program...")
const interval = setInterval(() => {}, 1000)

// Register interrupt signal handlers for resource cleanup
let isCleaning = false
const cleanup = async () => {
if (isCleaning) return
isCleaning = true

console.log("\nProgram interrupted, cleaning up resources...")
clearInterval(interval)
try {
await desktop.stream.stop() // Terminate streaming service
await desktop.kill() // Deallocate sandbox instance
} catch (err) {
console.error("Error cleaning up resources:", err)
}
process.exit(0)
}

process.on('SIGINT', cleanup)
process.on('SIGTERM', cleanup)
}

main().catch(console.error)
```

Running example:
![Run Example](https://mintcdn.com/novitaai/lT4Ftco9V6UT3djo/guides/images/sbx-desktop-run-tsx.png?fit=max&auto=format&n=lT4Ftco9V6UT3djo&q=85&s=0351181b28c69d3dd471d304ce225db5)
Access virtual desktop stream VNC URL:
![Desktop Streaming](https://mintcdn.com/novitaai/lT4Ftco9V6UT3djo/guides/images/sbx-desktop-streaming.png?fit=max&auto=format&n=lT4Ftco9V6UT3djo&q=85&s=76a28cfd818b227d7e4f47aa60345188)

Last modified on June 10, 2026
