How to fix editor UI when using unity in VM ?

Hi guys,

Unity is the only application which seems to get a stroke whenever you try to use it in a VM.

When you start it - everything seems to be fine. But when you do things like opening preferences or simply resizing the game view for example - unity gets stuck and doesnt re-render. Then it gets unresponsive.

Somtimes you also get to see a loading bar which reads
“Sceneview.Repaint - Waiting for Unity Code in UnityEditor.CoreModule.dll to finish executing”
for a couple of seconds.

Its super annoying that you can only work with Unity in a VM when you dont resize any windows.

Any ideas?

Steps to reproduce:

  • Install Windows 11
  • Install Unity
  • Use Unity
  • Everything is fine
  • Install Hyper-V with a Win11 VM
  • Install Unity on that VM
  • Start Unity on VM
  • Resize gameview/inspector/etc
  • → Unity gets a stroke, hangs, and very reliably hangs completely (no crashing - just complete rendering stop and unresponsive)

Add a dedicated GPU to the VM instead of using software rendering (for Hyper-V this requires a Windows Server edition iirc)

2 Likes

Most likely this is a VM setup issue, not so much Unity, as Armynator points out.

VMs work fine for everyday application. But when it comes to realtime rendering … not so much.
You may actually be better off installing Linux on a freeware VM that supports Linux (VMWare Player). Besides the initial setup that has some quirks on Linux Unity ran very well on that setup for me.

Yes, you need a server SKU. For a VM workflow you’d be better off with Linux as your host OS as it’s fairly simple to pass a GPU through to the guest OS. You do need hardware with support for IOMMU but most hardware supports it these days.

https://mathiashueber.com/windows-virtual-machine-gpu-passthrough-ubuntu/

Well switching OSes is not an option.

The stupid thing is: It completely WORKS! But if you resize the panels … it may or may not freeze completely. Because everything else - including playing the game in play mode - works flawlessly - only resizing windows/panels crashes it - this must be a bug. Or “unintended bahaviour for a niche way to use it”. Or however you may call it.