Search Unity

How to fix editor UI when using unity in VM ?

Discussion in 'Editor & General Support' started by m4ko, Jan 3, 2024.

  1. m4ko

    m4ko

    Joined:
    Feb 8, 2013
    Posts:
    21
    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?
     
  2. m4ko

    m4ko

    Joined:
    Feb 8, 2013
    Posts:
    21
    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)
     
  3. Armynator

    Armynator

    Joined:
    Feb 15, 2013
    Posts:
    67
    Add a dedicated GPU to the VM instead of using software rendering (for Hyper-V this requires a Windows Server edition iirc)
     
    Ryiah and CodeSmile like this.
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,953
    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.
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    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/
     
    Last edited: Jan 3, 2024
  6. m4ko

    m4ko

    Joined:
    Feb 8, 2013
    Posts:
    21
    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.