GLMakie on vscode remote backend

Does anybody know if it’s possible to use GLMakie with vscode remote backend? CairoMaike works.

When I try, I get this:

Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/user/.julia/compiled/v1.12/GLMakie/jl_6wz446".
┌ Warning:     OpenGL/GLFW wasn't loaded correctly or couldn't be initialized.
│     This likely means, you're on a headless server without having OpenGL support setup correctly.
│     Have a look at the troubleshooting section in the readme:
│     https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/vdrwE/src/gl_backend.jl:4
ERROR: LoadError: InitError: Exception[GLFW.GLFWError(65550, "X11: The DISPLAY environment variable is missing"), ErrorException("glfwInit failed")]

If you want to do rendering on the remote machine, you’d need this setup for software rendering:

But if you want to do rendering on your local machine then I think you might be able to do some kind of X forwarding? Not sure if that can be done through VSCode. WGLMakie is also an option there.

So right now when I try to install GLMakie on remote via vscode on local, I get that error I copy pasted. Are you saying that if I install those things on remove, this install should succeed?

If you install:

sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils

and start Julia with:

DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project

installation will succeed. But that is only half of the story, you also want to see the plots. You could try X11 forwarding. Not sure how to do that.

You could also try using WGLMakie, which should work in the plotpane.
Best forward 9384, then you shouldn’t need to do anything else.