Virtualbox VM laggy, VM clock speed stays idle

Discussions related to using VirtualBox on Windows hosts.
Post Reply
lv13
Posts: 3
Joined: 13. Nov 2019, 12:21

Virtualbox VM laggy, VM clock speed stays idle

Post by lv13 »

hi,

Im trying to get a windows 10 vm to run smoothly on my windows 10 host (laptop). But whatever i try it stays laggy in comparison to the host. after setting up the high performance power plan my host is running at 4+ GHZ but my VM never seems to go above 1.99 GHZ which i believe is the cause of the laggy UI.

here is what i tried so far:
  • Added high performance energy power plan the host and enabled it using: cmd prompt : powercfg -duplicatescheme 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
  • set VM battery setting to "BEST PERFORMANCE"
  • selected correct amount of cores for the vm (4) in my case
  • vt-x enabled
  • selected 2d and 3d acceleration and set video memory to max (256 mb)
  • set the vdi to be treated as SSD
  • (guest additions is installed)
I cut the bottom part of the log because file size was 130kb and max allowed file size to upload is 128. If that part is needed i will drop it if requested!

if someone can help me it would be very much appreciated!
clock difference host vs vm when idling
clock difference host vs vm when idling
host vs vm.png (56.92 KiB) Viewed 2329 times
Attachments
vbox.log
vm log
(122.87 KiB) Downloaded 9 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by mpack »

VBox.log wrote: 00:00:02.486349 NumCPUs <integer> = 0x0000000000000004 (4)
...
00:00:03.793442 CPUM: Physical host cores: 4
You'll never get smooth performance if you allocate 100% of the available cores to the VM, leaving the host with 0%. The idea is to share idle resources, not cause one party to hog them all.

FAQ: Cores vs Threads.
lv13
Posts: 3
Joined: 13. Nov 2019, 12:21

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by lv13 »

Thank you very much! it seems to be a lot more responsive.
I probably misunderstanded something i read early on, saying that you have to select half of the cores shown for the VM.
it probably meant half of the physical cores to be more specific.

again thanks!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by mpack »

"Physical cores" is redundant. The whole point of the word "core" is that it refers to actual silicon, so it's always physical. That phrase would fall into the same category as "software program" or "timber wood".
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by socratis »

lv13 wrote:saying that you have to select half of the cores shown for the VM
To be honest, I think that the GUI needs to change their tune there, or we need to change our tune here; we need to coordinate. We (at the forums) have been suggesting half the cores (not threads), but the VirtualBox developers seem to think that it's OK to have all the cores (not threads) assigned to the guest, still in green...

Here's a comment from fellow user 'arQon'. I don't want to quote the whole thing here again, even though I saved it for future use... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by mpack »

I don't really see anything new in that post. We're all aware that sometimes performance will be worse if you don't overcommit cores (e.g. trying to run Win10 on one core, with a relatively idle host) - but those users aren't the ones reporting performance problems after doing so. I'm happy with the advice that balance is nearly always the best option.
lv13
Posts: 3
Joined: 13. Nov 2019, 12:21

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by lv13 »

thank you for the extra information!

i do have 1 more question which i hope you can clarify for me (i cant find any clear info on this)
I`m trying to get max performance for the vm as i will be working in it all the time.

Setting my available cores for the vm from 4/8 to 2/8 solved the lagging and general responsiveness issue i had.
My host with high performance setting (laptop) is running consistantly at 4+GHZ but my VM always stays at 1.99 GHZ.
So as soon as i run something slighlty demanding it is at 99% usage. it works fine but is this limiting my VM?
if so, how can i get my vm to get higher clock speed?
host vs vm cpu
host vs vm cpu
host+vm cpu.png (55.52 KiB) Viewed 2275 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by mpack »

lv13 wrote: Setting my available cores for the vm from 4/8 to 2/8 solved the lagging and general responsiveness issue i had.
I guess you didn't read the FAQ link I gave you. Your host has 4 cores, not 8. The latter refers to the number of threads, which isn't relevant to this discussion. So you originally assigned 4/4 cores to the VM, leaving none for the host. 2/4 is a more balanced approach, allowing both host and VM to work without impacting each other much.
lv13 wrote: My host with high performance setting (laptop) is running consistantly at 4+GHZ but my VM always stays at 1.99 GHZ.
Where are you seeing that second number? Are you referring to a properties dialog inside the VM? Do remember that your VM's hardware is simulated, so I'd wouldn't necessarily have any faith in any clock frequency it reports. That is probably some kind of base frequency, reported by some legacy API. The VM has no control over CPU frequency (no single host app can adjust CPU frequency just for itself), the host OS manages all that, so the VM can't be running at any speed except the one the host decides.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by scottgus1 »

mpack wrote:the VM can't be running at any speed except the one the host decides.
@Lv13: Here on the forum it's been said many times that internal timers in a guest OS don't work reliably. The best way to test a guest's performance is by timing a repeatable process with a separate stopwatch.

Get a billion-digits-of-pi program, or something else that can be CPU-bound, and run the same program in the host after a fresh reboot, and the guest. Time the results with the stopwatch, see what slowdown you get. (Video encoding might not be reliable as a test, as the host encoder might use the host's video card, which the guest cannot do, and skew the results.)
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox VM laggy, VM clock speed stays idle

Post by fth0 »

lv13 wrote:I`m trying to get max performance for the vm as i will be working in it all the time.
Without going into detail: Any kind of hardware virtualization, be it a type-1 or type-2 hypervisor, will be noticeably slower than a bare-metal approach. If performance is your primary concern, why do you want to use a VM at all?
Post Reply