feat: allow windows virtual mmachine (#73)
This commit is contained in:
@@ -36,6 +36,7 @@ class DesktopEnv(gym.Env):
|
||||
headless: bool = False,
|
||||
require_a11y_tree: bool = True,
|
||||
require_terminal: bool = False,
|
||||
os_type: str = "Ubuntu",
|
||||
):
|
||||
"""
|
||||
Args:
|
||||
@@ -55,12 +56,14 @@ class DesktopEnv(gym.Env):
|
||||
self.region = region
|
||||
self.manager, self.provider = create_vm_manager_and_provider(provider_name, region)
|
||||
|
||||
self.os_type = os_type
|
||||
|
||||
# Initialize environment variables
|
||||
if path_to_vm:
|
||||
self.path_to_vm = os.path.abspath(os.path.expandvars(os.path.expanduser(path_to_vm))) \
|
||||
if provider_name in {"vmware", "virtualbox"} else path_to_vm
|
||||
else:
|
||||
self.path_to_vm = self.manager.get_vm_path(region)
|
||||
self.path_to_vm = self.manager.get_vm_path(self.os_type, region)
|
||||
|
||||
self.snapshot_name = snapshot_name
|
||||
self.cache_dir_base: str = cache_dir
|
||||
@@ -86,7 +89,7 @@ class DesktopEnv(gym.Env):
|
||||
|
||||
def _start_emulator(self):
|
||||
# Power on the virtual machine
|
||||
self.provider.start_emulator(self.path_to_vm, self.headless)
|
||||
self.provider.start_emulator(self.path_to_vm, self.headless, self.os_type)
|
||||
|
||||
# Get the ip from the virtual machine, and setup the controller
|
||||
self.vm_ip = self.provider.get_ip_address(self.path_to_vm)
|
||||
|
||||
Reference in New Issue
Block a user