Unable to run GUI on Centos 7

Issues related to applications and software problems
Post Reply
timaz
Posts: 5
Joined: 2013/09/26 19:45:32
Contact:

Unable to run GUI on Centos 7

Post by timaz » 2018/01/18 08:12:21

Hi;

following instructions I found on (https://www.itzgeek.com/how-tos/linux/c ... hel-7.html) I installed Gnome and XFCE desktops on centos 7. but now while I can ssh to centos and run commands, but cannot run GUI. I ran "startx" command but got this message:

Code: Select all

cuser@localhost ~]$ sudo startx
[sudo] password for cuser: 
xauth:  file /root/.serverauth.2756 does not exist

xinit: unable to run server "/usr/bin/X": No such file or directory
Use the -- option, or make sure that /usr/bin is in your path and
that "/usr/bin/X" is a program or a link to the right type of server
for your display.  Possible server names include:
....
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
!
!
!
[cuser@localhost ~]$ ls /usr/bin/X
ls: cannot access /usr/bin/X: No such file or directory
it would be good to mention that I installed Centos7 as a vm on my remote ESXi host. These are some commands I ran according to results that I got on the Internet (I'm completely newbie and actually don't know what these commands mean :roll: ).

Code: Select all

[cuser@localhost ~]$ gnome-shell --version
GNOME Shell 3.22.3
#
[cuser@localhost ~]$ systemctl get-default
graphical.target
#
[cuser@localhost ~]$ runlevel
N 5
#
[cuser@localhost ~]$ ls -l /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 36 Jan 18 04:24 /etc/systemd/system/default.target -> /lib/systemd/system/runlevel5.target
[cuser@localhost ~]$ sudo systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.
#
[cuser@localhost ~]$ systemctl default
[cuser@localhost ~]$ systemctl get-default
graphical.target
[cuser@localhost ~]$ runlevel
N 5

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to run GUI on Centos 7

Post by TrevorH » 2018/01/18 09:42:27

You cannot run startx remotely - it requires a local screen.

Also, don't run sudo startx - that would start X as root and you don't want to do that.
xinit: unable to run server "/usr/bin/X": No such file or directory
Sort of tells you what the issue is right there...

So to find out what you need to install to get that binary available to you, run yum provides '/usr/bin/X' or more generically, yum provides '*/bin/X (for the next time when it doesn't give you the full path of the thing it's looking for). That'll tell you which package ships that binary and then you can yum install it
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply