![linux - Is there a way to programmatically set DISPLAY when executable is run as sudo instead of failing? - Unix & Linux Stack Exchange linux - Is there a way to programmatically set DISPLAY when executable is run as sudo instead of failing? - Unix & Linux Stack Exchange](https://i.stack.imgur.com/aHzYR.png)
linux - Is there a way to programmatically set DISPLAY when executable is run as sudo instead of failing? - Unix & Linux Stack Exchange
![How to open gparted in fedora 25 (wayland): Gtk-WARNING **: cannot open display: :0 – Anna F J Smith Morris How to open gparted in fedora 25 (wayland): Gtk-WARNING **: cannot open display: :0 – Anna F J Smith Morris](https://www.gingerling.co.uk/wp-content/uploads/2017/01/232323232-fp83232-uqcshlukaxroqdfv3-877-nu32-9-3-44-WSNRCG3-7-633329nu0mrj-e1485203233114.jpg)
How to open gparted in fedora 25 (wayland): Gtk-WARNING **: cannot open display: :0 – Anna F J Smith Morris
![ubuntu - Running graphical Linux desktop applications from WSL 2 – "Error E233: cannot open display" - Stack Overflow ubuntu - Running graphical Linux desktop applications from WSL 2 – "Error E233: cannot open display" - Stack Overflow](https://i.stack.imgur.com/wt7IT.png)
ubuntu - Running graphical Linux desktop applications from WSL 2 – "Error E233: cannot open display" - Stack Overflow
![Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:) · Issue #522 · microsoft/wslg · GitHub Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:) · Issue #522 · microsoft/wslg · GitHub](https://user-images.githubusercontent.com/38701397/137767905-728f94f7-2bec-414c-8cf5-8c14d3a0e4b9.jpg)
Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:) · Issue #522 · microsoft/wslg · GitHub
![Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:) · Issue #522 · microsoft/wslg · GitHub Unable to init server: Could not connect: Connection refused (gedit:1859): Gtk-WARNING : cannot open display:) · Issue #522 · microsoft/wslg · GitHub](https://user-images.githubusercontent.com/38701397/137783263-5cdae7fd-4053-4982-8e4b-5a6ccfcd0336.png)