Flatpak octave does not recognize GUI

I have installed Octave-7.1.0 using
$ flatpak install flathub org.octave.Octave

I tried to execute octave by
$ flatpak run org.octave.Octave

GUI is not usable :

octave: X11 DISPLAY environment variable not set
octave: disabling GUI features

$echo $DISPLAY
192.168.4:0

DISPLAY setting seems not to be detected octave installed via Flatpak.

I investigated the error on the Google but I cannot find solutions.

My system

  • OS: Ubuntu 20.04 on WSL2 (win 10) with GWSL for GUI
  • Octave version: e.g. Version 6.7.0
  • Installation method: ** Flatpak**

Corrction

  • Octave version 6.7.0 => 7.1.0

That does not look like a valid IP number. Perhaps it should be 192.168.0.4?

That does not look like a valid IP number. Perhaps it should be 192.168.0.4?

I made a mistake in the operating keyboard.

$echo $DISPLAY
192.168.0.4:0

Can you start any other X11 program? like xterm?

Try:

flatpak run --nosocket=fallback-x11 --socket=x11  org.octave.Octave

Can you start any other X11 program? like xterm?
Yes. xterm, gedit, gnuplot(x11, wxt and qt terminals), evince, octave-5.2.0 with GUI (installed by sudo apt install octave)

I tried

flatpak run --nosocket=fallback-x11 --socket=x11  org.octave.Octave

But

$ flatpak run --nosocket=fallback-x11 --socket=x11  org.octave.Octave
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features

I am pretty certain the problem is not with octave but with flatpak environment.
You can try to add "–env=DISPLAY=‘192.168.0.4:0’

flatpak run --nosocket=fallback-x11 --socket=x11  --env=DISPLAY="192.168.0.4:0" org.octave.Octave

<<< Can you start any other X11 program? like xterm?
Yes. xterm, gedit, gnuplot(x11, wxt and qt terminals), evince, octave-5.2.0 with GUI (installed by sudo apt install octave)

I meant some other flatpak app.
What about:

 flatpak run org.gnome.gedit

Ah! Sorry.

$ flatpak run org.gnome.gedit

(gedit:2): Gtk-WARNING **: 22:32:23.309: cannot open display:
flatpak run --nosocket=fallback-x11 --socket=x11  --env=DISPLAY="192.168.0.4:0" org.gnome.gedit

--nosocket=fallback-x11 --socket=x11  --env=DISPLAY="192.168.0.4:0" org.octave.Octave

does recognize DISPLAY

Sorry I made mistake in the reply.

flatpak run --nosocket=fallback-x11 --socket=x11  --env=DISPLAY="192.168.0.4:0" org.octave.Octave

does not recognize the DISPLAY environmental variable
(FlatPak gedit also does not recognize the DISPLAY)

It might be related to:

Thanks for the pointer!!

octave cli

 flatpak run --share=network --command=bash org.octave.Octave -c "DISPLAY=$DISPLAY octave "

octave GUI

 flatpak run --share=network --command=bash org.octave.Octave -c "DISPLAY=$DISPLAY octave --gui"