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:
parent
82c19e870e
commit
7df7221436
@ -727,7 +727,7 @@ class VirtualBox(IModule):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
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)
|
result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=30)
|
||||||
else:
|
else:
|
||||||
sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)
|
sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)
|
||||||
|
@ -553,7 +553,7 @@ class VirtualBoxVM(object):
|
|||||||
log.debug("Execute vboxmanage command: {}".format(command))
|
log.debug("Execute vboxmanage command: {}".format(command))
|
||||||
user = self._vbox_user
|
user = self._vbox_user
|
||||||
try:
|
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)
|
result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=timeout)
|
||||||
else:
|
else:
|
||||||
sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)
|
sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)
|
||||||
|
Loading…
Reference in New Issue
Block a user