Intellij IDEA in VM

When working for the customer, I’ve found out that the best way is to setup a dedicated VM. That way, it’s easy to install anything that the customer uses, without polluting your main OS. The question is, how does IDEA perform in a VM?

The experiments were done in January 2024, on IDEA 2023.3.4 running on x86-64 Ubuntu 23.10 in Wayland mode as the Guest OS, with VM GPU acceleration enabled. The situation may change in the future, so please take this with a grain of salt. Also Wayland support for IDEA may change the performance completely since at the moment IDEA runs under Xwayland which may affect performance.

Rating system:

  • perfect: works exactly the same as on the host OS - the typing speed is perfect, the autocompletion windows appear immediately, and overall feels like native. Perfectly usable for professional work.
  • excellent: very minor hiccups here and there, but otherwise very usable: typing speed is perfect, the autocompletion windows do not appear as fast as on native, but pretty damn fast nevertheless. Perfectly usable for professional work, with no annoyances.
  • good: minor hiccups here and there, but otherwise quite usable: typing speed is perfect, but the autocompletion windows may appear slightly slower. Usable for professional work, but the hiccups feel slightly annoying.
  • mediocre: the IDE appear visibly laggish. Unusable for professional work.
  • bad: unusable for any sensible work.

Windows

VirtualBox 7.0.14 offered unexpectedly bad performance. Ubuntu took long to install, suggesting some kind of performance issues on the disk side. Even with 3D acceleration enabled and guest additions installed, the performance was “mediocre” and IDEA suffered from rendering issues.

Hyper-V was not tested since it doesn’t offer any GPU acceleration.

VMWare Player 17 offered good-to-excellent performance out-of-the-box, with no guest additions needed to be installed since it works with SPICE driver. The performance was good-to-excellent but definitely not perfect. Tested on AMD+Radeon, perhaps Intel onboard would offer better performance.

Linux Ubuntu 23.10 Host

VirtualBox: untested.

virt-manager+KVM works out-of-the-box and SPICE drivers offer excellent 3D performance. But here’s the catch: on AMD+Radeon the performance is sometimes “excellent”, often “good” but sometimes the IDEA starts performing sluggish, the CPU skyrockets after every character typed and the performance descends to “mediocre”.

Intel drivers offer “excellent” experience - the performance was a bit slower than native, but nothing impeding professional work.

MacBook Intel

UTM on old MacBook Air 2015 x86-64: UTM only offers GPU acceleration for Ubuntu 24.04 guests (because of some mesa patches which are only included in Ubuntu 24.04+). To fix IDEA, edit idea64.vmoptions, comment out -Dsun.java2d.metal=true and enable -Dsun.java2d.opengl=true. Unfortunately, IDEA is very slow in this mode, making it unusable for any sensible work.

However, the testing machine is very old and visibly slow: maybe the Apple Silicon might be able to compensate. But then again, the inefficiencies of not having proper 3D acceleration will drain the battery and extort strain on the system. I’d definitely prefer Parallels until Java starts working with GPU-accelerated drivers.

MacBook Apple Silicon

Ubuntu offers ARM builds which should work well on Apple Silicon-based hypervisor. Unfortunately there’s no IDEA snap for arm64 distro, so you’ll either have to install it via flatpak or download+unzip (since JetBrains ToolBox does not support Linux+ARM).

UTM: Ubuntu 24.04 works quite well, including the GPU performance. It’s not as smooth as with Parallels, but still highly usable. To make IDEA work in UTM, edit the idea64.vmoptions file, comment out -Dsun.java2d.metal=true and enable -Dsun.java2d.opengl=true. Unfortunately, IDEA is very slow in this mode, making it unusable for any sensible work.

EDIT: IDEA now supports wayland and is buttery-smooth under UTM, hurray!

Parallels: Parallels will automatically download and install Ubuntu 22.04 for you, and will also install parallels tools into the VM. The GUI itself and IDEA runs incredibly smooth; it runs even better than natively on my AMD notebook, suggesting that AMD’s GPU drivers in Linux suck. I rate the experience “excellent”. The only issue are vastly different keybindings for Mac and for Ubuntu, but I guess there’s nothing we can do about it.

Written on February 29, 2024