Bad performance Kali on Macbook Pro i9 Mojave

Discussions related to using VirtualBox on Mac OS X hosts.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

Hi,

I have a Kali VM that has performance issues on my new Macbook Pro. When playing a youtube video or having multiple browser windows open, the VM lags so much it takes many seconds to respond mouse clicks. I have tried different configurations without any luck. The windows are also moving slowly when dragging, and web pages are slow when scrolling. It also seems like the VirtualBox application are very CPU intensive. I have tried to download the free trial of VMWare, and the VM runs completely fine there!

Among things I have tried:

- Use host I/O cache (as to "AIOMgr: Host limits number of active IO requests to 16. Expect a performance impact.")
- Enable/disable 3D Acceleration
- Had 256 MB Video Ram
- Enable/disable nested paging
- Increase/decrease allocated resources

Please see logs in the attachment.
Attachments
Kali-Linux-2019.1-vbox-amd64-2019-05-13-18-01-29.log.zip
(30.26 KiB) Downloaded 47 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by mpack »

I'm afraid that the log you posted seems pretty useless: it shows a VM that ran for a total of 36 seconds, which hardly seems like enough time to open several YouTube browser windows. So evidently the log you've provided does not demonstrate the problem you discussed. It still contains the "expect a performance impact" line.

It does at least allow me to check your VM settings, which look fine to me.
00:00:14.027120 VMMDev: Guest Additions information report: Version 6.0.6 r129722 '6.0.6_Debian'
Fork GAs, it may have an impact. Purge completely, then install the real GAs.

I notice that you have not installed the extension pack. Is this a deliberate choice? It means that you're restricted to USB 1.1 for example. It shouldn't affect graphics though.

If I was you I'd look at the process list for guest and host, try to work out what activity is taking all the CPU time: it has to be going somewhere, it doesn't just disappear.

I notice that your log shows OpenGL 2.1 on the host (3D acceleration in the guest is implemented in a platform-independent way using OpenGL on the host). That's pretty ancient by OpenGL terms, though I'm not sure if it's actually a problem.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

Hi, thanks for the reply.

Sorry for the logs, I thought it was ment to be clean start and stop, here are some more with actual usage.

The GAs are actually pre-installed in the specialized VirtualBox image downloaded from Offensive Security. I did try to install the GAs on the first image I tried without preinstalled ones, with same performance issues.

I did not install the extension pack as it shouldn't have any performance impacts, and I was just running the fresh image for performance related purposes.

In the host, VirtualBox uses 200+ % CPU. In the guest, it actually seems like only 30-40 % of the CPU is utilized. Right now the VM is pretty unreachable when the youtube video is playing, but it is better when the video is on pause. Still not as good as expected, and seen in VMWare.

Edit: Regarding OpenGL it has been depricated by Apple, which has replaced it with Metal.
Attachments
Kali-Linux-2019.1-vbox-amd64-2019-05-13-21-16-20.log.zip
(30.39 KiB) Downloaded 31 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by mpack »

envelope wrote: Sorry for the logs, I thought it was ment to be clean start and stop, here are some more with actual usage.
Ideally the log is the smallest size needed to demonstrate the problem. Thanks for trying however.
envelope wrote: Edit: Regarding OpenGL it has been depricated by Apple, which has replaced it with Metal.
I don't believe that Metal has cross platform support, therefore it is not useful to a cross platform project. On PC platforms there is Direct3D, also not cross platform, but that doesn't mean that OpenGL ceased to exist there.
envelope wrote: In the host, VirtualBox uses 200+ % CPU. In the guest, it actually seems like only 30-40 % of the CPU is utilized. Right now the VM is pretty unreachable when the youtube video is playing, but it is better when the video is on pause. Still not as good as expected, and seen in VMWare.
I'm going to say that the guest is doing software rendering. You need to find out why and fix it.

Speaking of which: your new log still shows non-official GAs being used. I hope I didn't give the impression that getting rid of these was optional. Only official code is supported here.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

Okay, so removed the unofficial guest additions.

Are now installing from the mounted CD as per instructions.

Among the threads I have read on the forum, it seems like many macOS users have seen similar problems without any real solution the past years. [baseURL]/viewtopic.php?f=8&t=52804&start=15

I believie it is in everyones interest to find a general solution to this, maybe it could lead to a nice howto. Do you mind adding some information to "m going to say that the guest is doing software rendering. You need to find out why and fix it."?
Attachments
Kali-Linux-2019.1-vbox-amd64-2019-05-14-11-47-27.log.zip
(32.89 KiB) Downloaded 26 times
Last edited by envelope on 14. May 2019, 11:49, edited 1 time in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by mpack »

envelope wrote: Among the threads I have read on the forum, it seems like many macOS users have seen similar problems without any real solution the past years. [baseURL]/viewtopic.php?f=8&t=52804&start=15

I believie it is in everyones interest to find a general solution to this...
Well, on that last point not everyone uses OS X, in fact only about 2% of the market does, last I looked.

Yes I agree, it seems that some users of OS X hosts see this problem, with certain guests.

I'm not sure what kind of elaboration you expect on my guess that you are using software rendering. It's a guess, I offer it as something for you to investigate. I'm not a Debian or Kali user, but I'm sure I've seen mention of warning messages or tools you can use to detect software rendered graphics.

p.s. Why did you install 5.2.0 GAs? Why not the GAs that came bundled with your 6.0.6 host install?
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

Edited the post now, as i didn't clean before installing and sending the logs..

New logs are updated with 6.0.6.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

I have looked into the software rendering, and do not get the same warnings as others regarding this. The fix for the error message is to install the original GAs.

What is very annoying is that the free trial VMWare Fusion VM works excellent, even over my expectations. Shouldn't it then be a setting diff between VMWare and VBox that makes the big difference? Or is it major differences between the OS X support?
Darius123
Posts: 45
Joined: 3. Aug 2016, 21:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win 7 Pro, MacOS, Linux*
Location: UK

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by Darius123 »

The same issues with plain Debian and VirtualBox. From my experience none of the virtualisation software is perfect and depending on tasks required you have to choose one which fits the bill. To play youtube videos on macOS host and Linux client forget VBox. Indeed VMware is much better solution here. But there are things that VMware can't do and VBox does e.g. accessing raw disk which I use to access SD cards on my mac. There is no perfect choice. I ended up using both depending on what is needed.
Darius123
Posts: 45
Joined: 3. Aug 2016, 21:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win 7 Pro, MacOS, Linux*
Location: UK

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by Darius123 »

BTW in the latest VBox 6.0.8 my Debian client's web browser behaves much better when I chose VMVSGA as graphics controller - not as good as VMware but usable. VBoxSVGA and VBoxVGA are painfully slower. Of course YMMV depending on your hardware.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

Thanks for the tips!

Unfortunately my VM wont even boot with VMVSGA, it hangs after some seconds.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

So I just tried to hook up another monitor with lower resolution. The performance is much better there! With the VMs scale factor on 200% the graphics are extremely scaled compared to the internal macbook screen. The performance instantly decreases when moving the VirtualBox window from the external to the internal screen, as the VirtualBox window also scales according to the screen. Using scale factor 300% does not help on the inernal retina sceen either.

Does anyone have any suggestions on why this is happening?

I believe these lines are where I first move the window to the internal screen (from the initial startup on the external), then moving it back to the external:
00:01:24.105189 OpenGL: Set 3D content scale factor to (30000, 30000), multiplier 10000 (rc=VINF_SUCCESS)
00:01:24.106022 OpenGL: Set OpenGL scale policy on HiDPI displays (fUnscaledHiDPI=1)
00:01:26.443545 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 1280x724 if necessary
00:01:26.455769 VMMDev: SetVideoModeHint: Got a video mode hint (1280x724x32)@(0x0),(1;0) at 0
00:01:26.472009 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:01:26.482734 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00000001802b1000 w=640 h=378 bpp=32 cbLine=0x1400 flags=0x1 origin=0,0
00:01:26.486447 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00000001802b1000 w=1280 h=724 bpp=32 cbLine=0x1400 flags=0x1 origin=0,0
00:01:27.619303 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:01:54.916654 OpenGL: Set 3D content scale factor to (30000, 30000), multiplier 10000 (rc=VINF_SUCCESS)
00:01:54.916718 OpenGL: Set OpenGL scale policy on HiDPI displays (fUnscaledHiDPI=1)

00:02:22.981756 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 640x378 if necessary
00:02:22.993206 VMMDev: SetVideoModeHint: Got a video mode hint (640x378x32)@(0x0),(1;0) at 0
00:02:23.013630 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:02:23.014839 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00000001802b1000 w=1280 h=724 bpp=0 cbLine=0x1400 flags=0x5 origin=0,0
00:02:23.014979 GUI: UIFrameBufferPrivate::performResize: Size=1280x724, Using fallback buffer since no source bitmap is provided
00:02:23.017885 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000180128000 w=640 h=378 bpp=0 cbLine=0xA00 flags=0x5 origin=0,0
00:02:23.018063 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=0000000180128000 w=640 h=378 bpp=32 cbLine=0xA00 flags=0x1 origin=0,0
00:02:23.289245 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:02:23.291378 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 640x378 if necessary
00:02:23.291845 GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen 0 as 640x378 if necessary
The performance is still good with full screen and 100% scale factor on the external screen..
Last edited by socratis on 5. Jun 2019, 17:53, edited 1 time in total.
Reason: Enclosed the information in [quote][pre] tags for better readability
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

So I downloaded software to change the actual resolution on the retina internal screen, and run VBox with 1440x900. This makes the performance great.

Its a pity that a resolution change on the screen is needed, and VBox don't really support high resolution screens. The scaling in VBox doens't really work either, as it seems like it just works as a zooming functionality. It might be my guest system that is incompatible with high resolution (Ubuntu), so I can't say 100% that it is lack of support from VBox.

But as it took me some weeks to find this solution, the general solution for macOS performance issues that I've seen on this forum should be to download software to reduce the native resoultion!
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: Bad performance Kali on Macbook Pro i9 Mojave

Post by socratis »

envelope wrote:So I downloaded software to change the actual resolution on the retina internal screen, and run VBox with 1440x900
What was wrong with your System Preferences » Display » Resolution? I don't get it. And what is this 3rd party software that you refer to, does it have a name?
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.
envelope
Posts: 14
Joined: 13. May 2019, 17:57

Re: Bad performance Kali on Macbook Pro i9 Mojave

Post by envelope »

I'm no Retina expert, but the dummy explanation I can come up with is that "Scaling" in System Preferences » Display » Resolution does not actually change the resolution like it can be done by 3rd party software. I guess it is some techy TLDR, ref: https://www.reddit.com/r/apple/comments ... rk_on_mac/

I bought QuickRes which allows to explicitly set the resolution to whatever my needs, like 1440x900. This sets the actual resolution, which then give VBox much better conditions. There are some freeware out there which do pretty much the same.
Post Reply