I love Macs and macOS.
And I love Ubuntu MATE Linux.
You might say, I'm polyamorOS. You might, but you probably won't.
Now, I write a fair bit of PHP code. That's because I fancy myself to be a coder who writes browser based apps and no one has stopped me yet. And while I can write PHP code on a Mac, using various tools and apps to set up the web server I'll need to handle the browser app, the database I'll need behind it, and the PHP programming language itself....
Meh, 98% of the time I'm targeting Linux or Raspberry Pis anyway. So I prefer to write the code in the environment I expect it to live within. That means I typically use a free and open source app called VirtualBox to set up virtual Linux workstations and servers to work in.
Now, VirtualBox isn't the best virtual machine software out there, but it's quite free and free is well within my budget. It's also easy to use. I spent an hour trying to get a virtual machine (a VM) to boot in a faster, supposedly better virtual machine manager called QEMU. I have no doubt that QEMU is better and faster. It's also crazy making and so far above and beyond the level that I need, I stopped caring about it entirely.
But I was having a problem. I got this shiny new 2019 iMac with a six core processor and 32 GB of RAM. It's freakin' sweet, I tell you. And I have a VM that I built specifically for web coding work. I popped it on this iMac, and I even upgraded the VM to take advantage of two CPU cores and gave it access to 8 GB of RAM. This VM kicked ass on my 2015 MacBook Pro!! It's gonna fly on my iMac!
Except it didn't. It was the opposite of fast. It was slow.
It was hard running horseshit on a computer that should've made it scream like an F1 car coming out of a turn.
I checked forums, updated all the things, and there was even a macOS update today that was supposed to address problems with virtualisation on the Mac. I gleefully installed it, hoping for the best.
On the VM, I could out-type the screen. I could write a sentence and then wait for it to catch up to me. Dragging the mouse across the width of the screen took seconds. And it never smoothed out, it was always jumpy and lagging. File access was slow. As I said, it was hard running horseshit, even after the update.
Then I found a tidbit on some dark forum someplace. Like it was on the open web, but I kinda felt like I should be looking at this thing through a TOR Browser. I can't even find the damn website now and that's one of the reasons I'm writing about it here. Hopefully this will help someone, because I managed to solve the problem.
See, there was a factor in my problem I didn't even take into account. My monitor, specifically the iMac itself. It's a 5K Retina display. It's gorgeous.
VirtualBox hates it.
When I hooked up my iMac, I moved aside the monitor I used with my MacBook Pro, a 32 inch Samsung HD monitor with a regular HD resolution of 1920 x 1080. After I got an adaptor, I plugged this monitor into my iMac so I could have two gigantic displays!
And you see, it's good that I did that. Because on this forum, someone responded to a person having similar problems as me. They should try moving the VM's display over to a monitor that's not a UHD 5K monstrosity.
I thought to myself, Bullshit. There's no way that's right. But whatever, I had this thought while dragging my VM's display over to the Samsung.
And it fixed everything! It was snappy and smooth again! I had to adjust the display settings on the VM to match the Samsung, but it took seconds. The VM was running normally, perfectly, and holy crap... it was fast! I literally said out loud "Oh! That's what it's supposed to do!"
That's when it dawned on me. I never had a problem with this VM on my MacBook Pro, because every time I worked on that VM - I was always plugged into the Samsung monitor. I deposited a quarter down the back of my pants because I obviously played myself.
Right then. If you happen to be running VirtualBox, on an iMac (or a UHD monitor), and it's moving along like a constipated snail? Hook up a non-UHD monitor. Something like my Samsung HD. Open the VM on that monitor and I bet your world gets ever-so-slightly better.