stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.73k stars 166 forks source link

`gl(10, 10)` returns `null` in WSL2 #242

Closed smokeyhallow closed 1 year ago

smokeyhallow commented 1 year ago

Machine: Windows 10 Environment: WSL2 OS: Ubuntu 22.04

I have installed gl and tried the following:

// run.js

const gl = require("gl")
console.log(gl(10, 10)) // null

// ran it with node like: `node run.js`
smokeyhallow commented 1 year ago

Just figured out that I needed to run this with xvfb-run. Will close the issue, but will post the solution as someone else may find it useful:

This is how to do it:

xvfb-run -s "-ac -screen 0 100x100x24" node run.js