Search code examples
azuregoopenglvirtual-machinefyne

Adding opengl support on vm(vmware,azure) to run Go Fyne app


I am trying to run a Fyne app on a VM. I have attempted it on VirtualBox and Azure. After running the app, I get the following error:

  Cause:APIUnavailable: WGL: The driver does not appear to support OpenGL
  At: fyne.io/fyne/[email protected]/internal/driver/glfw/driver.go:148

enter image description here

I was able to solve this in VM by enabling 3D acceleration. But I am not able to do the same in Azure.

enter image description here

One option is to select the template which supports GPU. There are special VM series like the N-series VMs which support GPU. But just to run a Fyne app, I don't want to pay for a GPU VM.

Another option is to use the GPU pass-through feature. But I am not able to find any documentation on how to do this.

Is there any other way to solve this?


Solution

    1. Download the opengl32.dll file from here, under "Solution 2: If you're on Windows 7/8"

    2. Go to C:\Windows\System32 and find opengl32.dll, right click and go to properties -> security -> Advanced, a new window will open

    3. Select change, a new window will open. In the Enter the object name to select section, enter the user name (Sanjay) and check names

    • Follow the Blog or Video to change the properties of the dll file

      Note: If properties are not changed you will get the "you require permission from trustedinstaller" error

    1. Now backup the original dll file and replace it with the downloaded one.

    2. Now Simply start the "Fyne" app and it will work