Page 1 of 1

Set Priority for VirtualBoxVM.exe

Posted: 3. Sep 2021, 15:57
by Dan P
Hi... I am attempting to set a higher priority in Windows 10 for my running Virtual Box Linux guest. I noticed that in Task Manager, the same program - VirtualBoxVM.exe is used multiple (3) times. Whenever I try to elevate the priority on this / these .exe programs, only the first one seems to work. I'm using Windows sysinternals, Process Explorer to do this. I ran this normally, and in an Administrator prompt. That did not make a difference.

I also wrote a 64bit C++ program which uses Win32 API SetPriorityClass, as in SetPriorityClass(hProcess, ABOVE_NORMAL_PRIORITY_CLASS) to try to automate this. As when I used Process Explorer, the first VirtualBoxVM.exe 's priority would elevate successfully... but not the other two.

My user is Administrator level in my Windows 10 pc... and I can with Process Explorer click on any other running task and set the priority higher, and reset it back to normal - no problem.... That is, except for the programs that really need to be elevated - the ones mentioned here for the Virtual Box Linux guest.

Trying a different approach... I right-mouse-clicked on the VirtualBoxVM.exe tasks to Take Ownership using my Windows logon id... As before, only the first VirtualBoxVM.exe task allows me to. When I try to take ownership on the subsequent two, they fail. Then I suspected that there may be a problem in Process Explorer with setting the priority - because all three tasks are under the same name(?) But then again that's probably not the cause, as there are many other tasks in Process Explorer that have duplicate names, such as svchost.exe, or a browser tab task Those are able to have their running priority adjusted no problem.

Thank You for any help you can provide.

ETA: Using VirtualBox version 6.1.26 r145957 (Qt5.6.2) copyright 2021 Oracle Corporation and/or its affiliates.

Re: Set Priority for VirtualBoxVM.exe

Posted: 3. Sep 2021, 21:54
by fth0
You've just discovered that the VirtualBox Hardening code works, and it can even protect the VirtualBoxVM process from yourself. ;)

Re: Set Priority for VirtualBoxVM.exe

Posted: 3. Sep 2021, 22:08
by Dan P
Thank You for your reply. I found the Diagnosing VirtualBox Hardening Issues thread. Apparently there are no issues(?) In looking for them by doing a search on the VBoxHardening.log file, I found this file, with today's date:

Code: Select all

 Directory of D:\UtilUso\VirtBox\ORACLE_VM_FILES\Ubuntu_20.04\Logs

09/03/2021  07:41 AM                 0 VBoxHardening.log
               1 File(s)              0 bytes

Re: Set Priority for VirtualBoxVM.exe

Posted: 3. Sep 2021, 22:39
by Dan P
Can the VirtualBox - the three VirtualBoxVM.exe program priorities be elevated by others... fromTask Manager or via a different program? Is this just a problem that I have?

Re: Set Priority for VirtualBoxVM.exe

Posted: 3. Sep 2021, 23:57
by fth0
No, it should be the same for everybody.

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 00:12
by fth0
You could try VBoxManage modifyvm "VM name" --vm-process-priority (see 8.8.1. General Settings).

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 01:29
by Dan P
Thanks for your help fth0.

This is what I tried - in an Administrator level - MS Cmd Prompt box:

Code: Select all

D:\UtilUso\VirtBox>vboxmanage list  vms
"Win10" {794606d9-0f22-4cd6-8260-788096e39c48}
"PopOs_Lnx" {402b6928-3229-45bf-99f1-9ce83ead5264}
"PopOs_Lnx_Devel" {d159183e-7094-4df4-96d5-10d49006c10f}
"Ubuntu_20.04" {86bd86ae-846c-416e-9724-472ed5dae3ab}

D:\UtilUso\VirtBox>VBoxManage modifyvm "Ubuntu_20.04" --vm-process-priority high
There was no "command was successful" or "command failed" mesage

When I restarted the Virtual Machine... nothing changed.. All three VirtualBoxVM.exe programs started on '8' / Normal priority level. The first VirtualBoxVM.exe is adjustable via Process Explorer... but that's it.

Any other suggestions are welcome.

. . .

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 01:55
by Dan P
Thinking that somehow, may be the Oracle VM VirtualBox Manager main app was locking me out of a file or a privilege... I closed that app and the VirtualBox Ubuntu app both.... Then retried in an Administrator level MS Cmd prompt box:

Code: Select all

VBoxManage modifyvm "Ubuntu_20.04" --vm-process-priority high
It didn't matter. I got the same results as last time.

Don't read this the wrong way... because the first VirtualBoxVM.exe being changeable in way of Priority - at least showed me that I was probably going in the right direction.... but why would one VirtualBoxVM.exe in Process Explorer be allowed to have its priority changed by the user, but the other two 'No'? Overall, this seems like a problem. Or maybe it's just me(?)

Thanks.

. . .

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 12:36
by fth0
The VirtualBoxVM process is shielded by the VirtualBox Hardening code, and neither any Malware nor you or me can change its process priority while it's running.

The --vm-process-priority setting is not supposed to change the base priority of the VirtualBoxVM process, but to select a priority scheme for its threads. It's targeted to virtualization professionals who know how to handle the 42ish threads of the VirtualBoxVM process.

Did you also try to start the VirtualBoxVM process with a higher priority right from the beginning, something like start "" /High "VirtualBoxVM --startvm ..."?

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 16:41
by Dan P
Thank you for the suggs.

Unfortunately... no. The
start "" /High VirtualBoxVM --startvm "Ubuntu_20.04"

command did not help. In Process Explorer, the first VirtualBoxVM.exe started in High / 13 priority, and the other two still start in 8 / Normal. What was interesting.. is that I could not adjust any of the priorities at that point. Another interesting thing is that I was able to start up the VirtualBox VM machine using that command syntax, without starting the main VirtualBox Manager program first. So that's good to know.. in case it's ever needed to start like that.

. . .

Re: Set Priority for VirtualBoxVM.exe

Posted: 4. Sep 2021, 17:32
by fth0
I also tried it myself today. While I could not influence the process priority (just like you), applying priority schemes worked nonetheless. You'd have to understand the fine details, to not break the rest of the host OS and/or VirtualBoxVM. Depending on what you want to achieve, you could also reduce priorities of other processes ...

Re: Set Priority for VirtualBoxVM.exe

Posted: 14. Sep 2021, 16:11
by eebssk1
You can set the process priority for VBoxSVC.exe and Virtualbox.exe. Thelaunched VBox instance will follow the priority.

Re: Set Priority for VirtualBoxVM.exe

Posted: 14. Sep 2021, 21:57
by fth0
eebssk1 wrote:Thelaunched VBox instance will follow the priority.
Not in my attempts. Can you give some more details or prove it?

Re: Set Priority for VirtualBoxVM.exe

Posted: 30. Jul 2023, 21:50
by eebssk1
fth0 wrote: 14. Sep 2021, 21:57
eebssk1 wrote:Thelaunched VBox instance will follow the priority.
Not in my attempts. Can you give some more details or prove it?
Sorry I didn't mention.This method does work on Windows.

Re: Set Priority for VirtualBoxVM.exe

Posted: 31. Jul 2023, 10:01
by mpack
eebssk1 wrote: 30. Jul 2023, 21:50 Sorry I didn't mention.This method does work on Windows.
:?: Now you have me puzzled! This is the Windows Hosts forum and you suggested launching specific "exe" files. It would be assumed that your suggestion was something that should work on Windows. Did you join a discussion in the wrong forum? Did you mean to say "does not work"?