vboxme / Portable-VirtualBox

Portable-VirtualBox is a free and open source software tool that lets you run any operating system from a usb stick without separate installation.
Other
832 stars 234 forks source link

Virtualbox Main Process starts as admin #43

Open TSlivede opened 8 years ago

TSlivede commented 8 years ago

Hi everyone and thanks for Portable-VirtualBox!

I know, vbox-portable needs admin rights for installing drivers and services, but I think it would be better if Virtualbox Main Process stated as non-admin.

VirtualBox.exe running as admin causes some Problems:

The problem could be solved, by replacing RunWait calls on lines 738,740,743,753,755 and 758 in 'Portable-VirtualBox.au3' with calls like: _ShellExecuteWithReducedPrivileges('cmd',"cmd /c set VBOX_USER_HOME="& $UserHome &"& .\"& $arch &"\VirtualBox.exe",@ScriptDir,'',@SW_HIDE,True)

(using '_ShellExecuteWithReducedPrivileges.au3' from https://sites.google.com/site/ascend4ntscode/shellexecutewithreducedprivileges)

Sadly, _ShellExecuteWithReducedPrivileges doesn't wait, therefor I temporarily solved the problem in my local installation by inserting a Sleep call before ProcessWaitClose ("VirtualBox.exe").

As this solution isn't very clean and I don't want to patch vbox-portable everytime I download it, I do now post this as an Issue.

PS: sorry for my bad english :-)