From 347238e17e1bdbed6e05aadc6ecebbcacbcc950c Mon Sep 17 00:00:00 2001 From: Kaixin Li Date: Mon, 16 Jun 2025 02:40:40 +0800 Subject: [PATCH] Get VM IP again when getting screenshot fails (#215) In rare cases, the IP of the VM changes after it launches. We can get the IP every time we retry to ensure the correct connection. --- desktop_env/providers/vmware/manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_env/providers/vmware/manager.py b/desktop_env/providers/vmware/manager.py index 78e11d3..f3384fd 100644 --- a/desktop_env/providers/vmware/manager.py +++ b/desktop_env/providers/vmware/manager.py @@ -256,6 +256,8 @@ def _install_vm(vm_name, vms_dir, downloaded_file_name, os_type, original_vm_nam # Try downloading the screenshot until successful while not download_screenshot(vm_ip): + # Try to get the IP again in case it has changed + vm_ip = get_vm_ip(vm_path) logger.info("Check whether the virtual machine is ready...") logger.info("Virtual machine is ready. Start to make a snapshot on the virtual machine. It would take a while...")