diff --git a/gns3server/controller/gns3vm/hyperv_gns3_vm.py b/gns3server/controller/gns3vm/hyperv_gns3_vm.py index b6c7a1d7..a869cf7d 100644 --- a/gns3server/controller/gns3vm/hyperv_gns3_vm.py +++ b/gns3server/controller/gns3vm/hyperv_gns3_vm.py @@ -226,8 +226,7 @@ class HyperVGNS3VM(BaseGNS3VM): raise GNS3VMError("Could not find Hyper-V VM {}".format(self.vmname)) if not self._is_running(): - - log.info("Update GNS3 VM settings") + log.info("Update GNS3 VM settings (CPU and RAM)") # set the number of vCPUs and amount of RAM self._set_vcpus_ram(self.vcpus, self.ram) diff --git a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py index f4efc494..c4fc1414 100644 --- a/gns3server/controller/gns3vm/virtualbox_gns3_vm.py +++ b/gns3server/controller/gns3vm/virtualbox_gns3_vm.py @@ -214,8 +214,10 @@ class VirtualBoxGNS3VM(BaseGNS3VM): log.info('"{}" state is {}'.format(self._vmname, vm_state)) if vm_state == "poweroff": + log.info("Update GNS3 VM settings (CPU, RAM and Hardware Virtualization)") await self.set_vcpus(self.vcpus) await self.set_ram(self.ram) + await self.enable_nested_hw_virt() if vm_state in ("poweroff", "saved"): # start the VM if it is not running @@ -339,6 +341,14 @@ class VirtualBoxGNS3VM(BaseGNS3VM): await self._execute("modifyvm", [self._vmname, "--memory", str(ram)], timeout=3) log.info("GNS3 VM RAM amount set to {}".format(ram)) + async def enable_nested_hw_virt(self): + """ + Enable nested hardware virtualization for the GNS3 VM. + """ + + await self._execute("modifyvm", [self._vmname, "--nested-hw-virt", "on"], timeout=3) + log.info("Nested hardware virtualization enabled") + async def set_hostonly_network(self, adapter_number, hostonly_network_name): """ Set a VirtualBox host-only network on a network adapter for the GNS3 VM. diff --git a/gns3server/controller/gns3vm/vmware_gns3_vm.py b/gns3server/controller/gns3vm/vmware_gns3_vm.py index fe257812..f061ff0a 100644 --- a/gns3server/controller/gns3vm/vmware_gns3_vm.py +++ b/gns3server/controller/gns3vm/vmware_gns3_vm.py @@ -147,7 +147,7 @@ class VMwareGNS3VM(BaseGNS3VM): except VMwareError as e: raise GNS3VMError("Could not list VMware VMs: {}".format(str(e))) if not running: - log.info("Update GNS3 VM settings") + log.info("Update GNS3 VM settings (CPU, RAM and Hardware Virtualization)") # set the number of vCPUs and amount of RAM await self._set_vcpus_ram(self.vcpus, self.ram) await self._set_extra_options()