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(qemu): add setup detection and boot marker file creation

[email protected]2b0da424c996
diff --git a/libs/qemu/src/entry.sh b/libs/qemu/src/entry.sh
index ef7ecc87d7..4fc74a1c2c 100644
--- a/libs/qemu/src/entry.sh
+++ b/libs/qemu/src/entry.sh
@@ -3,12 +3,17 @@
# Fix for Azure ML Job not using the correct root path
cd /
+# Create windows.boot file if it doesn't exist (required for proper boot)
+if [ -d "/storage" -a ! -f "/storage/windows.boot" ]; then
+ echo "Creating windows.boot file in /storage..."
+ touch /storage/windows.boot
+fi
+
# Start the VM in the background
echo "Starting Windows VM..."
/usr/bin/tini -s /run/entry.sh &
echo "Live stream accessible at localhost:8006"
-# Wait for the VM to start up and CUA computer-server to be ready
echo "Waiting for Windows to boot and CUA computer-server to start..."
while true; do
# Send a GET request to check if server is ready
@@ -33,6 +38,9 @@ socat TCP-LISTEN:5000,fork,reuseaddr TCP:20.20.20.21:5000 &
echo "Computer server accessible at localhost:5000"
-# Keep container alive
-echo "Container running. Press Ctrl+C to stop."
-tail -f /dev/null
+# Detect initial setup by presence of /custom.iso (setup ISO mount)
+if [ ! -f "/custom.iso" ]; then
+ # Keep container alive
+ echo "Container running. Press Ctrl+C to stop."
+ tail -f /dev/null
+fi