X server does not start in Redhat 9

I tried to run X server in Linux Redhat 9 but it doesn't work. Below the commnad I used and the display of /var/log/Xorg.2.log,

*************** sudo Xorg :2 **************

[appuser@ansibleapptrj01 ~]$ sudo Xorg :2

X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System:  4.18.0-425.10.1.el8_7.x86_64
Current Operating System: Linux ansibleapptrj01 5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 30 07:36:03 EDT 2022 x86_64
Kernel command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/vg00-root ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/vg00-swap rd.lvm.lv=vg00/root rd.lvm.lv=vg00/swap rhgb quiet
Build Date: 06 June 2023  12:00:00AM
Build ID: xorg-x11-server 1.20.11-19.el9
Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.2.log", Time: Tue Apr 30 10:32:02 2024
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.2.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.

***************  cat /var/log/Xorg.2.log  **************

[appuser@ansibleapptrj01 ~]$ cat /var/log/Xorg.2.log
[301175.667]
X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
[301175.667] Build Operating System:  4.18.0-425.10.1.el8_7.x86_64
[301175.667] Current Operating System: Linux ansibleapptrj01 5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 30 07:36:03 EDT 2022 x86_64
[301175.667] Kernel command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/vg00-root ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/vg00-swap rd.lvm.lv=vg00/root rd.lvm.lv=vg00/swap rhgb quiet
[301175.667] Build Date: 06 June 2023  12:00:00AM
[301175.667] Build ID: xorg-x11-server 1.20.11-19.el9
[301175.667] Current version of pixman: 0.40.0
[301175.667]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[301175.668] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[301175.668] (==) Log file: "/var/log/Xorg.2.log", Time: Tue Apr 30 10:32:02 2024
[301175.669] (==) Using config file: "/etc/X11/xorg.conf"
[301175.669] (==) Using config directory: "/etc/X11/xorg.conf.d"
[301175.669] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[301175.669] (==) No Layout section.  Using the first Screen section.
[301175.669] (==) No screen section available. Using defaults.
[301175.669] (**) |-->Screen "Default Screen Section" (0)
[301175.669] (**) |   |-->Monitor "<default monitor>"
[301175.670] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[301175.670] (**) |   |-->Device "Card0"
[301175.670] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[301175.670] (==) Automatically adding devices
[301175.670] (==) Automatically enabling devices
[301175.670] (==) Automatically adding GPU devices
[301175.670] (==) Automatically binding GPU devices
[301175.670] (==) Max clients allowed: 256, resource mask: 0x1fffff
[301175.670] (==) FontPath set to:
        catalogue:/etc/X11/fontpath.d,
        built-ins
[301175.670] (==) ModulePath set to "/usr/lib64/xorg/modules"
[301175.670] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[301175.670] (II) Loader magic: 0x563ed7374d40
[301175.670] (II) Module ABI versions:
[301175.670]    X.Org ANSI C Emulation: 0.4
[301175.670]    X.Org Video Driver: 24.1
[301175.670]    X.Org XInput driver : 24.1
[301175.670]    X.Org Server Extension : 10.0
[301175.671] (--) using VT number 2

[301175.672] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[301175.680] (II) xfree86: Adding drm device (/dev/dri/card0)
[301175.680] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[301175.707] (--) PCI:*(0@0:15:0) 15ad:0405:15ad:0405 rev 0, Mem @ 0xe8000000/134217728, 0xfe000000/8388608, I/O @ 0x00001070/16, BIOS @ 0x????????/131072
[301175.708] (II) LoadModule: "glx"
[301175.708] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[301175.712] (II) Module glx: vendor="X.Org Foundation"
[301175.712]    compiled for 1.20.11, module version = 1.0.0
[301175.712]    ABI class: X.Org Server Extension, version 10.0
[301175.712] (II) LoadModule: "vmwgfx"
[301175.712] (WW) Warning, couldn't open module vmwgfx
[301175.712] (EE) Failed to load module "vmwgfx" (module does not exist, 0)
[301175.712] (EE) No drivers available.
[301175.712] (EE)
Fatal server error:
[301175.712] (EE) no screens found(EE)
[301175.713] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[301175.713] (EE) Please also check the log file at "/var/log/Xorg.2.log" for additional information.
[301175.713] (EE)
[301175.713] (EE) Server terminated with error (1). Closing log file.
[appuser@ansibleapptrj01 ~]$

@vicente , Welcome.

Some background info please - help set the scene for the team
What h/ware is this running on, how much memory ?
Is this a VM , if yes, what is the parent OS .... (please provide all relevant details, tks)

Is this a new issue ?
Ares there any X servers already running

Have you read through the logs - looks like no display(s) found ?

How many displays do you have .....

have you reviewed the X config files being used ....

[301175.669] (==) Using config file: "/etc/X11/xorg.conf"
[301175.669] (==) Using system config directory "/usr/share/X11/xorg.conf.d"

Thank you for your attention. Below I list as much information as possible so that you can help me in this issue.

Is this a new issue ?
In fact I trying to run a Python app that uses Tkinter and I get this error-> _tkinter.TclError: no display name and no $DISPLAY environment variable
Below all the display

[appuser@ansibleapptrj01 ~]$ /bin/python /home/appuser/CORE/app/mobvoice/valida_atividade/main.py
Tables created successfully.
DISPLAY: None
['/home/appuser/CORE/app/mobvoice/valida_atividade', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/home/appuser/.local/lib/python3.9/site-packages', '/usr/local/lib64/python3.9/site-packages', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
 sys.path:  ['/home/appuser/CORE/app/mobvoice/valida_atividade', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/home/appuser/.local/lib/python3.9/site-packages', '/usr/local/lib64/python3.9/site-packages', '/usr/local/lib/python3.9/site-packages', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
3.9.18 (main, Sep  7 2023, 00:00:00)
[GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]
/bin/python
Traceback (most recent call last):
  File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 305, in <module>
    run_gui()
  File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 99, in run_gui
    root = tk.Tk()
  File "/usr/lib64/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
[appuser@ansibleapptrj01 ~]$

Are there any X servers already running

[appuser@ansibleapptrj01 ~]$ systemctl status display-manager.service
ā— gdm.service - GNOME Display Manager
     Loaded: loaded (/usr/lib/systemd/system/gdm.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-04-29 22:07:39 -03; 18h ago
   Main PID: 135085 (gdm)
      Tasks: 3 (limit: 100128)
     Memory: 2.8M
        CPU: 161ms
     CGroup: /system.slice/gdm.service
             └─135085 /usr/sbin/gdm
[appuser@ansibleapptrj01 ~]$

[appuser@ansibleapptrj01 ~]$ ps aux | grep Xorg
appuser   168429  0.0  0.0 221664  2168 pts/3    S+   16:12   0:00 grep --color=auto Xorg

Have you read through the logs - looks like no display(s) found ?

[321838.943] (==) Log file: "/var/log/Xorg.2.log", Time: Tue Apr 30 16:16:26 2024
[321838.944] (==) Using config file: "/etc/X11/xorg.conf"
[321838.944] (==) Using config directory: "/etc/X11/xorg.conf.d"
[321838.944] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[321838.944] (==) No Layout section.  Using the first Screen section.
[321838.944] (==) No screen section available. Using defaults.
[321838.944] (**) |-->Screen "Default Screen Section" (0)
[321838.944] (**) |   |-->Monitor "<default monitor>"
[321838.945] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[321838.945] (**) |   |-->Device "Card0"
[321838.945] (==) No monitor specified for screen "Default Screen Section".

How many displays do you have .....

[appuser@ansibleapptrj01 ~]$ sudo lshw -C display
  *-display
       description: VGA compatible controller
       product: SVGA II Adapter
       vendor: VMware
       physical id: f
       bus info: pci@0000:00:0f.0
       logical name: /dev/fb0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=vmwgfx latency=64 resolution=1672,1254
       resources: irq:16 ioport:1070(size=16) memory:e8000000-efffffff memory:fe000000-fe7fffff memory:c0000-dffff
[appuser@ansibleapptrj01 ~]$

have you reviewed the X config files being used ....
Here is the configuration

[appuser@ansibleapptrj01 ~]$ cat /etc/X11/xorg.conf
Section "Device"
    Identifier "Card0"
    Driver "vmwgfx"
EndSection

Section "Monitor"
    Identifier "VGA1"
    Modeline "1024x768_60.00" 63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync
    Option "PreferredMode" "1024x768_60.00"  # Corrected PreferredMode option
EndSection 


lspci -> list all PCI devices, including my GPU.

[appuser@ansibleapptrj01 ~]$ lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)
02:01.0 SATA controller: VMware SATA AHCI controller
03:00.0 Serial Attached SCSI controller: VMware PVSCSI SCSI Controller (rev 02)
0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)

@vicente ,

Copying and pasting config/log files as responses to questions is not answering them !.
Why not state to begin with that you are running some ?user written code - and show that !
Lack of sharing information when you are in possession of it is not helpful.

I have NOT scanned the files you posted since I asked !

However, try exporting the DISPLAY variable before executing whatever app it is you are running and see what happens
something like

export DISPLAY=':1'  # or 2 or ....

#then try starting your app

Sorry, I didn't answer the question directly because I don't know, I'm a beginner in Linux.

It's generating the same error:

File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 305, in <module>
    run_gui()
  File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 99, in run_gui
    root = tk.Tk()
  File "/usr/lib64/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
**_tkinter.TclError: couldn't connect to display ":1"**



File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 305, in <module>
    run_gui()
  File "/home/appuser/CORE/app/mobvoice/valida_atividade/main.py", line 99, in run_gui
    root = tk.Tk()
  File "/usr/lib64/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
**_tkinter.TclError: couldn't connect to display ":2"**

@vicente , show the commands being executed, show the tk program source code ( as I have demonstrated later on in this thread)

What OS are you running ? KDE / GNOME ? ......
Is there already an X server running ? - (if you have a gui then that's likely to be YES)

show the output from the following:

echo $DISPLAY

pfind X

here's a trivial example of tk displaying a window - and issues if DISPLAY variable not set or incorrectly set, it shouldn't be more complex than this .... (unless you're not giving salient details ....)

echo $DISPLAY
:1

cat vicente.py 
import sys
import subprocess
import tkinter as tk

root = tk.Tk()

def hit2Quit():
    root.destroy()

root.title("Environment settings")

textbox = tk.Text(root, height=20, width=80)
textbox.pack()
    
hitMe=tk.Button(root,text='Press Me', command=hit2Quit);
hitMe.pack()

textbox.insert(tk.END, subprocess.check_output(['env'], universal_newlines=True))

root.mainloop()

python3 vicente.py 

#
# now see what happens when incorrectly set
#
DISPLAY=':2'                             # i don't have a second display

python3 vicente.py 
Traceback (most recent call last):
  File "vicente.py", line 5, in <module>
    root = tk.Tk()
  File "/usr/lib/python3.8/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":2"

Here's a screenshot of the first running of the test program:
Screenshot from 2024-05-01 01-04-15

@vicente , as the most likely cause is that X is not running you should reach out to your sysadmin as root/sudo privs are typically required to start
if systemd is used, check if the display-manager service is installed/running

i get the following

systemctl status display-manager.service
ā— lightdm.service - Light Display Manager
     Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
     Active: active (running) since Wed 2024-04-17 08:02:29 BST; 1 weeks 6 days ago
       Docs: man:lightdm(1)
   Main PID: 1218 (lightdm)
      Tasks: 5 (limit: 125529)
     Memory: 252.3M
     CGroup: /system.slice/lightdm.service
             ā”œā”€1218 /usr/sbin/lightdm
             └─3260 /usr/lib/xorg/Xorg -core :1 -seat seat0 -auth /var/run/lightdm/root/:1 -nolisten tcp vt9 -novtswitch

Apr 17 08:03:20 Z800 lightdm[1627]: pam_unix(lightdm:session): session opened for user hunkemoller by (uid=0)
....
What OS are you running ? KDE / GNOME ? ......
GNOME 
Here the evidence:
[appuser@ansibleapptrj01 ~]$ systemctl cat display-manager.service
# /usr/lib/systemd/system/gdm.service
[Unit]
Description=GNOME Display Manager

Is there already an X server running ? - (if you have a gui then that's likely to be YES)
No, there is no an X server running.



show the output from the following:

echo $DISPLAY
[appuser@ansibleapptrj01 ~]$ echo $DISPLAY
:0


pfind X
[appuser@ansibleapptrj01 ~]$ pfind X
bash: pfind: command not found...


Here my Python app that uses tkinter.
import tkinter as tk
from tkinter import * 
from tkinter import scrolledtext
from tkinter import ttk
from tkinter import messagebox
import threading

from app.sbc_network_element import SbcNetworkElement
from app.ssh_client import SSH
.....

def run_gui():
    global running, root, variable_mappings, text_box, text_box_ch
    root = tk.Tk()
    def set_menu(root, choices):
        menubar = Menu(root)
        root.config(menu=menubar)
        root.title('Valida Atividade')
        root.geometry("1100x600")

        def _set_choices(menu, choices):
            for label, command in choices.items():
                if isinstance(command, dict):
                    submenu = Menu(menu)
                    menu.add_cascade(label=label, menu=submenu)
                    _set_choices(submenu, command)
                elif label == '-' and command == '-':
                    menu.add_separator()
                else:
                    menu.add_command(label=label, command=command)

        _set_choices(menubar, choices)
    
    set_menu(root, {
        'Valida Atividade': {
            'Quit': root.quit
        }
    })
    
       # Create a scrolled text widget for displaying the content
    text_box = scrolledtext.ScrolledText(root, wrap=tk.WORD)
    text_box.pack(fill=tk.BOTH, expand=True)
    text_box.focus_set()  # Give initial focus to the text box

    # Create a hidden Text widget for saving data
    text_box_ch = tk.Text(root)
    text_box_ch.pack_forget()  # Hide it initially
       
    root.after(1000, check_task_status)
    root.mainloop()

if __name__ == "__main__":
    run_gui()

@vicente , ok, so you need to get an X server running -

Please, run and show the output of
systemctl status display-manager.service
not
systemctl cat display-manager.service

if this is your own machine, you'll need to start the display manager, if a company machine you should speak with sysadmin to have thee service started

something along the following:
sudo systemctl start display-manager.service

or , to have the service start when the host is booted
sudo systemctl enable display-manager.service

when you log in to this machine is it via a gui or a text window ?
are you logging on from some other host - like using PUTTY .... ?

Good morning.  I thank you very much for your help. I really need this Python app with Tkinter Gui works. 
Here what you want.

Please, run and show the output of
systemctl status display-manager.service

[appuser@ansibleapptrj01 ~]$ systemctl status display-manager.service
ā— gdm.service - GNOME Display Manager
     Loaded: loaded (/usr/lib/systemd/system/gdm.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-04-30 19:46:12 -03; 14h ago
   Main PID: 175076 (gdm)
      Tasks: 3 (limit: 100128)
     Memory: 2.9M
        CPU: 154ms
     CGroup: /system.slice/gdm.service
             └─175076 /usr/sbin/gdm
[appuser@ansibleapptrj01 ~]$


when you log in to this machine is it via a gui or a text window ?
Text window

are you logging on from some other host - like using PUTTY .... ?
access via ssh -X appuser@IP, using PowerShell or xshell

The topology I am using is as such.  
                                                                                                                                          
Local window machine-> access via ssh -X appuser@IP, using PowerShell or xshell -> Remote Linux Redhat 9 server 
The remote Linux is located in a VM in an company virtal enviroment 

@vicente , all of this should have been provided right at the start of this exchange a lot of time and effort would likely have been saved :man_shrugging: , anyways ....

I am not familiar with 'window machine' (I presume you mean Microsoft Windows of some flavour or other - I am not a MS Windows user nor have access to a host running it).

if using xshell (I am not familiar with this app sry), make sure X11 forwarding has been enabled - you will need to find out how to enable that within xshell options.
If that is done, try logging in and starting the python app
(no need to set DISPLAY as the xshell config takes care of that).
NB: You will need X11 server running on the remote box.

come back when you've tried.

PS: - do you have any colleagues already doing similar ? if so, reach out to them , always good to share challenges with teammates.

NB: You will need X11 server running on the remote box.

That's the reason I started with this topic "X server does not start in Redhat 9". No teammate is able to start X11 server. That's why I asking for help. 
 

What happens when you try either of the below

something along the following:
sudo systemctl restart display-manager.service

or , to have the service start when the host is booted
sudo systemctl enable display-manager.service

To see status
systemctl is-active display-manager.service

When I try "sudo systemctl enable display-manager.service", the system give no response as following:

[appuser@ansibleapptrj01 ~]$ sudo systemctl restart display-manager.service
[appuser@ansibleapptrj01 ~]$

And when I try to enable I get an error as below:

[appuser@ansibleapptrj01 ~]$ sudo systemctl enable display-manager.service
Failed to enable unit: Refusing to operate on alias name or linked unit file: display-manager.service
[appuser@ansibleapptrj01 ~]$

When I try to see status:

[appuser@ansibleapptrj01 ~]$ systemctl is-active display-manager.service
active
[appuser@ansibleapptrj01 ~]$

You only need to do one if then tbh.

Have you logged in using xshell/SSH ?
What did you set X11 forwarding to in xshell ?

And if you try your app ? (or the test app gave)

@vicente, just a bit of nit-picking...
Please make sure that you use the markdown code tags ONLY for the code/data samples - don't use them for the entire posts - it makes it hard to read and distinguish the code/data from your comments.
I've modified your latest post as an example.

@vicente - any progress ?

Hi @vicente ,

the display manager is already enabled, so re-enabling it produces the error

Failed to enable unit: Refusing to operate on alias name or linked unit file: display-manager.service

It looks like the dm doesn't start the X server, it doesn't appear in the dm's status:

[appuser@ansibleapptrj01 ~]$ systemctl status display-manager
ā— gdm.service - GNOME Display Manager
...
      CGroup: /system.slice/gdm.service
              └─175076 /usr/sbin/gdm

It should look like this (sddm on my system):

$ systemctl status display-manager
ā— sddm.service - Simple Desktop Display Manager
...
      CGroup: /system.slice/sddm.service
              ā”œā”€3780 /usr/bin/sddm
              └─4061 /usr/lib/xorg/Xorg -nolisten tcp -auth /var/run/sddm/{ae29babc-ee5c-4ffd-8879-c7bb13910f5e} -background none -noreset -displayfd 17 -seat seat0 vt7

And the unit file is more or less empty:

[appuser@ansibleapptrj01 ~]$ systemctl cat display-manager
# /usr/lib/systemd/system/gdm.service
[Unit]
Description=GNOME Display Manager

Have you already tried reinstalling the dm or the gui? I'm not familiar with Redhat, maybe this could work:

$ yum groupinstall "Server with GUI"
$ systemctl set-default graphical.target
$ reboot