Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(lume): SSH port detection not working in lume ls (#835)

Francesco Bonaccicfca0d03df1c
diff --git a/docs/content/docs/lume/guide/getting-started/quickstart.mdx b/docs/content/docs/lume/guide/getting-started/quickstart.mdx
index fa3686ed48..c3d7f52637 100644
--- a/docs/content/docs/lume/guide/getting-started/quickstart.mdx
+++ b/docs/content/docs/lume/guide/getting-started/quickstart.mdx
@@ -151,9 +151,12 @@ lume run my-vm
# Headless (for automation, CI/CD)
lume run my-vm --no-display
+
+# Run in background (doesn't block terminal)
+lume run my-vm > /dev/null 2>&1 &
```
-When running headless, connect via SSH (if enabled) or VNC client.
+When running headless or in background, connect via SSH (if enabled) or VNC client. Use `lume ls` to see running VMs and their connection details.
## Common operations
diff --git a/libs/lume/src/Utils/NetworkUtils.swift b/libs/lume/src/Utils/NetworkUtils.swift
index 2f8d063c84..e8f2dd5a79 100644
--- a/libs/lume/src/Utils/NetworkUtils.swift
+++ b/libs/lume/src/Utils/NetworkUtils.swift
@@ -32,7 +32,9 @@ enum NetworkUtils {
static func isPortOpen(ipAddress: String, port: UInt16, timeout: TimeInterval = 2) -> Bool {
let process = Process()
process.executableURL = URL(fileURLWithPath: "/usr/bin/nc")
- process.arguments = ["-z", "-G", "\(Int(timeout))", ipAddress, "\(port)"]
+ // Use -w (timeout) instead of -G (connection timeout) as -G doesn't work
+ // reliably with VM networking on macOS
+ process.arguments = ["-z", "-w", "\(Int(timeout))", ipAddress, "\(port)"]
let pipe = Pipe()
process.standardOutput = pipe