diff --git a/gns3server/modules/virtualbox/__init__.py b/gns3server/modules/virtualbox/__init__.py index abf64881..dbc0cef2 100644 --- a/gns3server/modules/virtualbox/__init__.py +++ b/gns3server/modules/virtualbox/__init__.py @@ -727,7 +727,7 @@ class VirtualBox(IModule): """ try: - if not user.strip(): + if not user.strip() or sys.platform.startswith("win") or sys.platform.startswith("darwin"): result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=30) else: sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command) diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index bb99172a..bb1affc1 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -553,7 +553,7 @@ class VirtualBoxVM(object): log.debug("Execute vboxmanage command: {}".format(command)) user = self._vbox_user try: - if not user.strip(): + if not user.strip() or sys.platform.startswith("win") or sys.platform.startswith("darwin"): result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=timeout) else: sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)