Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron: Missing X server or $DISPLAY

I've been running an Electron App on a Pi4, Ubuntu 22.04 Server, and Gnome desktop without issue. Since it runs as a kiosk anyway as a single app, I've been attempting to eliminate Gnome and just launching from the CLI (with X installed). However, I'm getting:

ERROR:ozone_platform_x11.cc(247) Missing X server or $DISPLAY
The platform failed to initialize. Exiting.

I've read about setting "DISPLAY=$HOST_IP:10.0", however I'm not clear where that would be set, or if that's applicable to this situation. I'm pretty new to this part, so any help would be appreciated!

like image 658
Cornelius Qualley Avatar asked Jun 27 '26 09:06

Cornelius Qualley


1 Answers

At Raspberry PI 4, I did:

$ export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

and it ended up as:

$ echo $DISPLAY
192.168.0.1:0.0

But still same problem - Missing X Server

My final solution:

$ export DISPLAY=:0

Then worked fine!

like image 169
Mendes Avatar answered Jul 01 '26 02:07

Mendes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!