DEV Community

Cover image for One should know this before trying macOS in a virtual machine
Michael Groncki
Michael Groncki

Posted on • Edited on

2

One should know this before trying macOS in a virtual machine

Working with virtual machines is part of my daily bread and butter.

Since I have a MacBook Pro (16") again after a long time, I wanted to use macOS in a virtual machine (VM).

The installation is quick. After starting the VM, I first opened the Safari browser and felt a not-so-pleasant surprised after opening several tabs. In the animated GIF below, you can see that the tab titles are illegible and flicker.

Fig. 1: Open additional tabs in Safari

Fig. 1: Open additional tabs in Safari

I had a déja vu when I opened Visual Studio Code after installing it to edit a text. The inserted text is only partially or not displayed at all. If you move the mouse pointer over the taskbar of the editor, the icons simply disappear.

Fig. 2: Open a text file in VSC

Fig. 2: Open a text file in VSC

As it stands, there is a problem with the graphical resolution or the representation. After briefly researching the topic on the net, it became clear that hardware acceleration is not supported in a virtual machine with macOS.

Parallels support confirms this: "Parallels Desktop does not support 2D or 3D acceleration in OS X/macOS guest operating systems (installed inside the virtual machine) because Apple does not provide an API for creating a video driver with 2D/3D acceleration support."

Until now, I was very satisfied with Parallels (I had always used VMware in the past, even on previous Macs). But as it turns out, this is the same with VMware. As Parallels support has said, it's not up to the product, but to Apple that doesn't release the necessary information.

One solution is to turn off the use of hardware acceleration per app, provided the app offers this option. It is possible with Visual Studio Code. Here you can turn off the use of hardware acceleration in the settings.

Using the "Command Palette" and "Preferences -> Configure Runtime Arguments," you open the file "argv.json" and can then activate the switch for hardware acceleration or turn it off.

// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelyhood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
// Use software rendering instead of hardware accelerated rendering.
// This can help in cases where you see rendering issues in VS Code.
"disable-hardware-acceleration": true,
// Enabled by default by VS Code to resolve color issues in the renderer
// See https://github.com/Microsoft/vscode/issues/51791 for details
"disable-color-correct-rendering": true
}
view raw argv.js hosted with ❤ by GitHub

After a restart, Visual Studio Code will work as expected.

Fig. 3: Open a text file in VSC hardware acceleration switched off

Fig. 3: Open a text file in VSC hardware acceleration switched off

Unfortunately, I couldn't find a way to turn off the use of hardware acceleration for the Apple Safari browser. However, for example, the browser of Google offers such a setting, accessible via "Settings -> Advanced -> System."

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay