# Julia VegaLite and ElectronDisplay - controlling sandboxing?

**URL:** <https://discourse.julialang.org/t/julia-vegalite-and-electrondisplay-controlling-sandboxing/103649>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [September 8, 2023, 7:55am UTC](https://discourse.julialang.org/t/julia-vegalite-and-electrondisplay-controlling-sandboxing/103649 "2023-09-08T07:55:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatmatrix](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Post date:** [September 8, 2023, 7:55am UTC](https://discourse.julialang.org/t/julia-vegalite-and-electrondisplay-controlling-sandboxing/103649/1 "2023-09-08T07:55:59Z")

</div>

I’m using Julia 1.9.3 on WSL2 Ubuntu Linux, working through the REPL (actually through Emacs Julia-Snail, but the plotting commands are sent to the REPL). So wanted to try out `ElectronDisplay` for `VegaLite`.

```julia
using DataFrames
using VegaLite, VegaDatasets
using ElectronDisplay

dataset("cars") |>
    @vlplot(
        :point,
        x=:Horsepower,
        y=:Miles_per_Gallon,
        color=:Origin,
        width=400,
        height=400
    )

```

I get

> FATAL:gpu\_data\_manager\_impl\_private.cc(439)] GPU process isn’t usable. Goodbye.

I think this is not Julia-specific, but I’ve read that using a `--no-sandbox` option is often the solution to this problem. Is there a way to control such an option with Julia?

Alternatively, I could view the figures in a browser. The plotting command above (without `using Electron Display`) generates the html file in `/tmp/` - what command or environment variable is VegaLite/Julia looking for to automatically open this file - I imagine I can set it in my .bashrc?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [September 11, 2023, 4:20pm UTC](https://discourse.julialang.org/t/julia-vegalite-and-electrondisplay-controlling-sandboxing/103649/2 "2023-09-11T16:20:16Z")

</div>

I’m not sure whether ElectronDisplay can work when run on WSL… The electron process would be running inside the WSL virtual machine, and would then need the ability to display a UI etc. Maybe that could work with the relatively new gWSL or whatever that is… Have you tried to run other GUI programs in WSL and whether that works? That might be a good first start.

> [@hatmatrix](#):
>
> Is there a way to control such an option with Julia?

We could certainly add that. [https://github.com/davidanthoff/Electron.jl/blob/master/src/Electron.jl#L133](https://github.com/davidanthoff/Electron.jl/blob/master/src/Electron.jl#L133) provides the ability to add additional command line args, but we would have to modify ElectronDisplay.jl to actually use/expose that.

> [@hatmatrix](#):
>
> what command or environment variable is VegaLite/Julia looking for to automatically open this file

That logic is [here](https://github.com/queryverse/Vega.jl/blob/0bad2ccf6b763c6a7468554bdeb688d45a443538/src/rendering/render.jl#L119), so I think on WSL that would essentially depend on what `xdg-open` does.

---

<div class="post-metadata">

**Author:** ![hatmatrix](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Post date:** [September 12, 2023, 12:36am UTC](https://discourse.julialang.org/t/julia-vegalite-and-electrondisplay-controlling-sandboxing/103649/3 "2023-09-12T00:36:43Z")

</div>

Thanks for the answer. It seems like running an electron app on WSL2 is possible with installation of additional libraries (using X11 for the GUI - I’m using X410 but gWSL might be better), but I could not get it to work so I leave that for another day.

However, I can now view the output figures in the browser by specifying an appropriate program for `xdg-open`. Thanks for pointing me to that. On an Ubuntu Linux instance, the following worked for me and now the plot pops up in the Windows default browser.

```julia
$ sudo apt install wslu 
$ xdg-mime default wslview.desktop text/html

```
