install GNOME desktop via SSH

General support questions
Post Reply
DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

install GNOME desktop via SSH

Post by DavEar » 2020/03/17 15:15:41

Hello everyone, because my absoloute first approch to CentOs, i just activate a remote server with CentOs basic on.
Via Putty ( sorry i'm from MS ) I installed and activated XRDP ( if i call via Remote Desktop CentOs answer )
I Installed GNOME Desktop and X Windows but when I run StartX I get an error ( Log error attached ) .
Because I would use this server to run some VM for Web and DB remoting, I Need to see desktop, infact I installed VirtualBox but I cant execute because tere is not a desktop.
Anybody could help me? Does is not possible to install desktop via SSH?
Thanks advance

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install GNOME desktop via SSH

Post by TrevorH » 2020/03/17 16:41:04

You use xrdp for connecting to an existing running desktop on the server.

I suspect you want to install and configure tignervnc-server which will will you your own desktop on the server not hook into a physical one that already exists.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH

Post by DavEar » 2020/03/18 09:01:01

thankyou for you reply, the problem seem that there isnt any desktop running on machine, how dont know how to start a dekstop session on it

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH

Post by DavEar » 2020/03/18 09:22:12

...and a question...does VNC is like XRDP? both are using for sharing desktop, right?

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH - ERROR

Post by DavEar » 2020/03/18 10:02:30

In the mean while I try installing VNC Server but I Cant get IT ! Here the result ---Please HELP ME


[root@admin------- ~]# systemctl daemon-reload
[root@admin------- ~]# systemctl start vncserver@:3.service
Job for vncserver@:3.service failed because the control process exited with error code. See "systemctl status vncserver@:3.service" and "journalctl -xe" for details.
[root@admin------- ~]# systemctl status vncserver@:3.service
● vncserver@:3.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:3.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-03-18 10:59:24 CET; 41s ago
Process: 188755 ExecStart=/usr/sbin/runuser -l admin------- -c /usr/bin/vncserver %i (code=exited, status=1/FAILURE)
Process: 188751 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Mar 18 10:59:23 admin-------.localhost systemd[1]: Starting Remote desktop service (VNC)...
Mar 18 10:59:24 admin-------.localhost systemd[1]: vncserver@:3.service: control process exited, code=exited status=1
Mar 18 10:59:24 admin-------.localhost systemd[1]: Failed to start Remote desktop service (VNC).
Mar 18 10:59:24 admin-------.localhost systemd[1]: Unit vncserver@:3.service entered failed state.
Mar 18 10:59:24 admin-------.localhost systemd[1]: vncserver@:3.service failed.
[root@admin------- ~]#

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install GNOME desktop via SSH

Post by TrevorH » 2020/03/18 15:37:03

There are a number of steps you need to do, one is to copy the systemd unit file to /etc/systemd/system and amend it to put in the relevant user etc details. The other is that as that user you must set a vnc password using vncpasswd.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH

Post by DavEar » 2020/03/18 18:58:41

Many thanks for reply, but as i sayed Im a newbie to CentOs and i dont know how to
copy the systemd unit file to /etc/systemd/system

and amend it to put in the relevant user etc details


sorry, but its important to me to starting to use and jnow this SO

thanks again

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install GNOME desktop via SSH

Post by TrevorH » 2020/03/18 21:41:10

Loaded: loaded (/etc/systemd/system/vncserver@:3.service; disabled; vendor preset: disabled)
Well that shows you already did part of it. You copied the example file. Did you change it to include your username and the path to your home directory in there? Did you runvncpasswd as that user to set the password?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH

Post by DavEar » 2020/03/19 09:21:37

Thanks for you support..
Yes I ( hope ) chnaged te file:

[root@aadmin------- ~]# vi /etc/systemd/system/vncserver@:3.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Replace <USER> with the actual user name and edit vncserver
# parameters appropriately
# (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l aadmin------- -c "/usr/bin/vncserver %i"
PIDFile=/home/aadmin-------/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target
~
~
~
~


and yes vnc server is running
[aadmin-------@aadmin------- ~]$ su -
Password:
Last login: Wed Mar 18 10:42:35 CET 2020 on pts/0
Last failed login: Thu Mar 19 10:06:31 CET 2020 from 165.22.60.7 on ssh:notty
There were 1716 failed login attempts since the last successful login.
[root@aadmin------- ~]# vi /etc/systemd/system/vncserver@:3.service
[root@aadmin------- ~]# vncserver

New 'aadmin-------.localhost:2 (root)' desktop is aadmin-------.localhost:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/aadmin-------.localhost:2.log

[root@aadmin------- ~]# tail -f /root/.vnc/aadmin-------.localhost:2.log


Thu Mar 19 10:12:24 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5902
vncext: created VNC server for screen 0

Thu Mar 19 10:12:28 2020
ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)

DavEar
Posts: 7
Joined: 2020/03/17 15:03:42

Re: install GNOME desktop via SSH

Post by DavEar » 2020/03/19 09:23:25

...BUT if I Ask for VNCSERVER is running :
[root@aadmin------- ~]# systemctl status vncserver
Unit vncserver.service could not be found.
[root@aadmin------- ~]# systemctl status vncserver@:3.service
● vncserver@:3.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:3.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-03-18 10:59:24 CET; 23h ago
Process: 188755 ExecStart=/usr/sbin/runuser -l aadmin------- -c /usr/bin/vncserver %i (code=exited, status=1/FAILURE)
Process: 188751 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Mar 18 10:59:23 aadmin-------.localhost systemd[1]: Starting Remote desktop service (VNC)...
Mar 18 10:59:24 aadmin-------.localhost systemd[1]: vncserver@:3.service: control process exited, code=exited status=1
Mar 18 10:59:24 aadmin-------.localhost systemd[1]: Failed to start Remote desktop service (VNC).
Mar 18 10:59:24 aadmin-------.localhost systemd[1]: Unit vncserver@:3.service entered failed state.
Mar 18 10:59:24 aadmin-------.localhost systemd[1]: vncserver@:3.service failed.
[root@aadmin------- ~]#

Post Reply

Return to “CentOS 7 - General Support”