1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-30 20:28:08 +00:00

Run VirtualBox as another user (Linux only)

This commit is contained in:
Dmitry Shmygov 2014-12-08 02:03:06 +03:00
parent 82c19e870e
commit 7df7221436
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)