VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Discussions related to using VirtualBox on Mac OS X hosts.
Locked
JohnZhang
Posts: 4
Joined: 24. Nov 2018, 06:30

VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by JohnZhang »

(mod edit: the solution to this long topic seems to be here: viewtopic.php?f=8&t=90446&start=75#p470879 from "63BottlesOfBeer": run the VirtualboxVM.app in low resolution)

Hi all, I have been using VirtualBox for one of my class project that requires Ubuntu. Recently I switched from a MacBook Pro late 2013 to a new MBP 2018, and I setup virtualbox with same settings on the new computer. However, what went perfectly fine on the old computer now becomes very sluggish on the new mac.

I do not use VM for anything graphical rendering related, the vm is slow in basic moving around windows and typing (in terminal, Eclipse, anywhere) By sluggish I mean slow response of mouse moving, keyboard typing, worst is identify one keyboard input or mouse click as many repeated ones.

Here is the information for running VM on both machines:

1. This is very slow on typing and all interactions
VM: Version 5.2.22 r126460 (Qt5.6.3), no Guest Additions in guest
Host: macOS Mojave on 10.14.1 (64) on MacBook Pro (15-inch, 2018), 2.6 GHz Intel Core i7, 32 GB 2400 MHz DDR4, Intel UHD Graphics 630 1536 MB (with Radeon Pro 560X 4096 MB)
Guest: Ubuntu 18.04.1 LTS (64), Assigned 8192 MB Base Memory + 64 MB Video Memory, 2 core.

2. In comparison, This runs fine (older computer):
VM: Version 5.2.22 r126460 (Qt5.6.3), no Guest Additions in guest
Host: macOS Mojave on 10.14.1 (64) on MacBook Pro (Retina, 15-inch, Late 2013), 2.6GHz Intel Core i7, 16 GB 1600 MHz DDR3, Intel Iris Pro 1536 MB (with NVIDIA GeForce GT 750M 2048 MB)
Guest: Ubuntu 18.04.1 LTS (64), Assigned 8192 MB Base Memory + 64 MB Video Memory, 2 core. (Same VM provided by my instructor)

I think the reason should point to how the newer model deal with rendering related to screen size.

3. I tried increasing or decreasing memory, VRAM, and processor, from default settings, the situation did not get better, but when I tried a exterior display (using DuetDisplay to extend to an iPad Air 2) the response of typing and moving mouse becomes fast.

4. Then I tried using it in window mode (small window, 1/4 size of screen), the performance got even better, almost the same as it is on my old mac)

I think it is an issue with VBox having to "move too many pixels around" as mentioned in several posts I found, but essentially the two models have similar resolution and ppi (2880x1800, 220 ppi). Thus I think it should be a capability issue of VBox regarding to newer models of Macs.

I could use small screen but my sights are not very good and I would really prefer a full-screen display with larger text to make my eyes a bit more comfortable...

The logs are in the attachment, I numbered them according to the orders in my post.

Hopefully there could be some solutions some day! If it really is a bug, I hope devs could solve it some day as well!

Thank you very much to reading the post and looking for solutions! Wish you all a great day!
Attachments
4LogsTogether.zip
(111.99 KiB) Downloaded 368 times
Last edited by scottgus1 on 3. Jan 2021, 16:31, edited 4 times in total.
Reason: added apparent solution link
JiF_Brodeur
Posts: 81
Joined: 19. Sep 2017, 03:37

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by JiF_Brodeur »

Hi, I had a similar issue and disabling #D acceleration solved the performance problem.
Have a nice day
Jean-Frs
JohnZhang
Posts: 4
Joined: 24. Nov 2018, 06:30

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by JohnZhang »

JiF_Brodeur wrote:Hi, I had a similar issue and disabling #D acceleration solved the performance problem.
Have a nice day
Jean-Frs
Hi JiF_Brodeur,
Thank you for the suggestion!
I have done similar tests but none works. By default 3D and 2D acceleration are both turned off, and I did not turn them on. Some suggested turning them on or off, but after testing, it did not solve the problem, unfortunately.

Also, in the beginning turning on "Use Unscaled HiDPI Output" solved the problem, but then I figured out what it did is just making the window smaller (while increasing clarity), and it is rescaling window size that eased the problem. With that turned on in a larger window still brings problems back.

Thank you all again for further suggestions and attentions on the issue!
brycesteiner
Posts: 97
Joined: 7. Nov 2008, 16:04
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, Windows

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by brycesteiner »

I had the exact same thing with a new MacBook Pro and Mojave. I can't pinpoint if the problem is Virtualbox or Mojave or the new hardware, but certainly there is a performance hit. I would have major pauses between clicks to see any response - a minute or more. Keys would repeated 5-10 times even though it was let up.
I went to my other computer (2011 27" iMac 32GB, High Sierra) and the speed was fine and both were running the same virtualbox.
I tried out Parallels and all I can say is it was night and day different. The speed was perfectly smooth on both macs.
I suspect that it has to do with Mojave losing support for the older graphics acceleration on the new Macs, and gaining support for Metal 2, and then Virtualbox not supporting the new Metal 2 but supporting the older OpenGL/CL. It's just a guess.
Virtualbox used to work so well that I could use it to play 3d video games on OSX 10.8.5 and VB 4.3.26 (which work great together) after that things changed between the OS and VB. I've been with Virtualbox for many years and love it but it has become unusable for me, unfortunately.
I changed everything a 100 times just like you did, disabling, enabling, etc. nothing seemed to matter.
I read that Fusion also had to have a major upgrade to make the new hardware useable, so maybe it's just a matter of a re-write to include the newer system calls.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by mpack »

Slow log wrote: 00:00:19.117769 VMMDev: Guest Additions information report: Version 5.2.8 r120774 '5.2.8_KernelUbuntu'
That is not the VirtualBox Guest Additions. That's the GAs from some third party fork. If they were the VirtualBox GAs they'd still be considerably out of date. Since the GAs were not installed we can't be sure about the true effect of enabling 3D acceleration (2D acceleration only applies to Windows guests).

Incidentally, there's no need to include several different versions of the log, it just wastes server space. I didn't bother looking at any log except the one from the relevant scenario.
JohnZhang
Posts: 4
Joined: 24. Nov 2018, 06:30

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by JohnZhang »

Thanks mpack for the replies.

So could you suggest me what further steps should I use to test the problem out regarding to the 3D acceleration? I would really appreciate it if you could give me some suggestions.

Also, all four logs are relevant to the scenario imo, maybe except the log from the other device. The other four all have not good performances, just the smaller the screen size the (a little) better the performance is.

By the way I still don't think that 3D is the issue since enabling and disabling it did not make (at least not the most significant) difference on either device. The old device is still smooth, the new is still not.

I would really appreciate it if you could give me further suggestions! Although it ultimately just is impacting my course's instance, I would like to extensively figure out whether it is actually the problem of that VM or maybe some setting errors in the VBox!

I will try downloading a ubuntu 18.04.1 to see if it works!
Thanks all and have a good day!
Last edited by socratis on 28. Nov 2018, 09:15, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
socratis
Site Moderator
Posts: 27330
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 runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by socratis »

You need to install the Guest Additions (GAs) that come with VirtualBox, not the ones that come with the default Ubuntu installation.

With the VM window having the focus, go to the menu "Devices" » "Insert Guest Additions CD image". If the autorun isn't triggered in your VM and you're prompted to install the GAs, then navigate to the CD and run "VBoxLinuxAdditions.run".

For more info, see ch. 4.2.2 of the User Manual.
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: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by mpack »

And remember to purge the fork GAs first. It's a separate package so it may not be replaced when you install VirtualBox GAs, and having two GAs running won't be doing anything good.
JohnZhang
Posts: 4
Joined: 24. Nov 2018, 06:30

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by JohnZhang »

Thanks for the suggestions guys! Sorry that I haven't been following up there are some deadlines coming recently. I will test according to socratis and mpack sometimes next week and post the results for further help! Hopefully it will turn out to be fine!

btw I kind of agree with @brycesteiner 's idea... It seems that turning on and off things does not help yet... We'll see after installing a clean up-to-date guest system. Thank you all!
martinis
Posts: 1
Joined: 14. Dec 2018, 23:56

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by martinis »

I've experienced very slow screen updates in Virtual Box (OS X/MacOS host and Win 7 client) since upgrading to VB 5. This happened for both an existing and new installation of Win 7.

If showing a video in Win 7 or even a website with animation, the client becomes mostly unresponsive. If I'm lucky I might be able to close the app (or website tab) and after a while (20-60 seconds or more) the app or tab closes. Sometimes it's so unresponsive that I have to reset the client.

This happens with or without the guest additions. Changing memory, client screen size etc. etc. have not had any effect.

However, the problem does NOT happen when I'm using an external monitor. It only seems to happen when I'm using the Mac screen and I don't have an external monitor connected.
lsls
Posts: 10
Joined: 15. Dec 2018, 18:52

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by lsls »

I'm pretty much in the same boat with both of my MBP models (2016 and 2017). I've tried with and without guest additions (I've tried the official ones, with the ones shipped with Ubuntu and also with the ones shipped in the latest Linux kernel), I've tried different Linux distributions (Ubuntu 18.04, 18.10, Debian Stretch), I've tried with and without 3D acceleration, I've tried different combination of CPU, memory, video memory to make sure I'm not starving the host, I've tried with Unscaled HiDPI, I've tried switching around the scaling modes... In all cases, the performance is absolutely terrible. Just interacting with the VM immediately pegs the host CPU to 150%, windows lag behind the cursor, opening Firefox reminds me of the time when you could sometimes see the little strip going down down the screen and update it, sometimes it just freezes completely for a few seconds... Just browsing the regular sites is a horror show, watching a YouTube video is impossible. By the look of things, I'm hitting #11606: Poor graphics performance on retina display with VirtualBox 4.2.x, #16436: Lagging and long pauses in all guests on recent MacOS hosts, or maybe #18108: Very poor performance on iMac 2017 5K. Virtualbox (the manager) also crashes every single time a VM is shut down (#17842: VirtualBox crashes while shutting down guest VM).

I thought it might be simply because the host HW cannot keep up but then I installed Parallels Lite from the App Store (the free version) and it runs beautifully. I can even play HD videos on YouTube without any issues, it feels almost native. So it's definitely not in the HW but a bug in VB. The downside is of course that the Lite version is lacking a lot of features that VB has and that's why I would like to use it instead.

In one of the tickets you say it's difficult to reproduce - I do not know how to NOT reproduce it on any of mine own HW, and on a brand new MBP 2018 provided by my employer to a colleague of mine (and tried by the colleague - it's not something I specifically do wrong).
Last edited by socratis on 15. Dec 2018, 22:55, edited 1 time in total.
Reason: Added missing URL.
lsls
Posts: 10
Joined: 15. Dec 2018, 18:52

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by lsls »

I was quite excited to read the changelog for VB 6.0 mentioning improved HiDPI and scaling support, so I installed it and played a little. When I install the new guest additions, enable 3D acceleration and set graphics controller to VMSVGA, the performance is slightly better. It's still miles away from the performance of Parallels but at least now the cursor is not lagging anymore - good stuff! Hopefully the developers have identified the problem and the situation will improve in future versions. Oh, and the bug (ticket 17842) causing VB to crash every time a VM is shut down has survived the UI changes! Even the cause is the same according to the stack trace.
socratis
Site Moderator
Posts: 27330
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 runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by socratis »

lsls wrote:Oh, and the bug (ticket 17842) causing VB to crash every time a VM is shut down has survived the UI changes! Even the cause is the same according to the stack trace.
Please open a new thread, with an appropriate title if you want to discuss this and help to resolve it...
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.
disaacs
Posts: 1
Joined: 11. Jan 2019, 23:09

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by disaacs »

martinis wrote:I've experienced very slow screen updates in Virtual Box (OS X/MacOS host and Win 7 client) since upgrading to VB 5. This happened for both an existing and new installation of Win 7.

If showing a video in Win 7 or even a website with animation, the client becomes mostly unresponsive. If I'm lucky I might be able to close the app (or website tab) and after a while (20-60 seconds or more) the app or tab closes. Sometimes it's so unresponsive that I have to reset the client.

This happens with or without the guest additions. Changing memory, client screen size etc. etc. have not had any effect.

However, the problem does NOT happen when I'm using an external monitor. It only seems to happen when I'm using the Mac screen and I don't have an external monitor connected.
I've had the same behaviour, with Ubuntu and Lubuntu clients and OSX host. Huge lagging issues when using the Macbook's screen, but everything is fine when on an external monitor. I can have the image on my external monitor, working fine, and then drag it over to the Macbook screen and see it immediately bog down. I can then drag it back, and it's all OK again.

Installing guest additions has made no difference. Setting 3D acceleration has made no difference.
londonbairn
Posts: 1
Joined: 28. Jan 2019, 21:51

Re: VirtualBox runs slow on MacBook Pro 2018 (screen refreshes slow)

Post by londonbairn »

I have the same problem. It's unfortunately unusable for me so I have gone back to 5.2
Locked