diff --git a/desktop_env/providers/vmware/manager.py b/desktop_env/providers/vmware/manager.py index 8f73520..3bb6017 100644 --- a/desktop_env/providers/vmware/manager.py +++ b/desktop_env/providers/vmware/manager.py @@ -29,13 +29,11 @@ UBUNTU_X86_URL = "https://huggingface.co/datasets/xlangai/ubuntu_osworld/resolve WINDOWS_X86_URL = "https://huggingface.co/datasets/xlangai/windows_osworld/resolve/main/Windows-x86.zip" # Determine the platform and CPU architecture to decide the correct VM image to download -if platform.system() == 'Darwin': # macOS - # if os.uname().machine == 'arm64': # Apple Silicon - URL = UBUNTU_ARM_URL -# else: -# url = UBUNTU_X86_URL -elif platform.machine().lower() in ['amd64', 'x86_64']: +# sometimes the system is 'Darwin' but the machine is x86-based.​​ +if platform.machine().lower() in ['amd64', 'x86_64']: URL = UBUNTU_X86_URL +elif platform.system() == 'Darwin': # macOS + URL = UBUNTU_ARM_URL else: raise Exception("Unsupported platform or architecture") @@ -125,12 +123,12 @@ def _install_vm(vm_name, vms_dir, downloaded_file_name, os_type, original_vm_nam # Download the virtual machine image logger.info("Downloading the virtual machine image...") downloaded_size = 0 - + # sometimes the system is 'Darwin' but the machine is x86-based.​​ if os_type == "Ubuntu": - if platform.system() == 'Darwin': - URL = UBUNTU_ARM_URL - elif platform.machine().lower() in ['amd64', 'x86_64']: + if platform.machine().lower() in ['amd64', 'x86_64']: URL = UBUNTU_X86_URL + elif platform.system() == 'Darwin': + URL = UBUNTU_ARM_URL elif os_type == "Windows": if platform.machine().lower() in ['amd64', 'x86_64']: URL = WINDOWS_X86_URL