LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2017, 01:45 AM   #1
BhushanPathak
Member
 
Registered: Nov 2013
Location: Pune, India
Distribution: CentOS
Posts: 85

Rep: Reputation: Disabled
VNC not working with CentOS7


Hello,

I have a CentOS 7 minimal installation, on which I wish to install GNOME desktop & start a VNC session.

I followed this post to install GNOME desktop & start a VNC session.

When I try to connect to the machine using vnc viewer, it always times out & gives an error message -

Code:
Timed out waiting for response from the remote computer

Any idea how do I proceed further?

Thanks
Bhushan Pathak
 
Old 06-05-2017, 02:20 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Perhaps you have selinux or iptables enabled on either/both the source and destination systems, and that is interfering with the connection?
 
Old 06-08-2017, 02:01 AM   #3
BhushanPathak
Member
 
Registered: Nov 2013
Location: Pune, India
Distribution: CentOS
Posts: 85

Original Poster
Rep: Reputation: Disabled
I have updated the firewalld service to open the ports for VNC service. Still the issue persists. Is there any log which I can check for errors?
 
Old 06-08-2017, 06:00 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I had similar problem with a Fedora 25 instance.
I put SE Linux in permissive mode to get VNC access.
I will later investigate why SE Linus is interfering with it.

Do
Code:
 setenforce 0
and try again.
 
Old 06-09-2017, 01:34 AM   #5
BhushanPathak
Member
 
Registered: Nov 2013
Location: Pune, India
Distribution: CentOS
Posts: 85

Original Poster
Rep: Reputation: Disabled
Stopped the firewall & disabled selinux, still the issue persists

Code:
[hadoop@master ~]$ getenforce
Disabled
[hadoop@master ~]$ ps -ef | grep vnc
hadoop    1984     1  0 12:00 ?        00:00:00 /usr/bin/Xvnc :4 -desktop master.hadoopcluster.com:4 (hadoop) -auth /home/hadoop/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/hadoop/.vnc/passwd -rfbport 5904 -fp catalogue:/etc/X11/fontpath.d -pn
hadoop    2383     1  0 12:00 ?        00:00:00 /usr/bin/vncconfig -iconic
hadoop    3172  2723  0 12:01 pts/0    00:00:00 grep --color=auto vnc
[hadoop@master ~]$ sudo /bin/systemctl stop firewalld
[hadoop@master ~]$ sudo /bin/systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Fri 2017-06-09 12:02:01 IST; 7s ago
     Docs: man:firewalld(1)
  Process: 621 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 621 (code=exited, status=0/SUCCESS)

Jun 09 12:00:45 master.hadoopcluster.com systemd[1]: Starting firewalld - dynamic firewall daemon...
Jun 09 12:00:47 master.hadoopcluster.com systemd[1]: Started firewalld - dynamic firewall daemon.
Jun 09 12:02:00 master.hadoopcluster.com systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jun 09 12:02:01 master.hadoopcluster.com systemd[1]: Stopped firewalld - dynamic firewall daemon.
[hadoop@master ~]$ sudo systemctl start vncserver@:4.service
[hadoop@master ~]$ sudo systemctl status vncserver@:4.service
● vncserver@:4.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:4.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-06-09 12:00:58 IST; 1min 23s ago
  Process: 1239 ExecStart=/usr/sbin/runuser -l hadoop -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
  Process: 1042 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 1984 (Xvnc)
   CGroup: /system.slice/system-vncserver.slice/vncserver@:4.service
           ‣ 1984 /usr/bin/Xvnc :4 -desktop master.hadoopcluster.com:4 (hadoop) -auth /home/hadoop/.Xauthority -geometry 1024x768 -rfbwait 3...

Jun 09 12:00:54 master.hadoopcluster.com systemd[1]: Starting Remote desktop service (VNC)...
Jun 09 12:00:58 master.hadoopcluster.com systemd[1]: Started Remote desktop service (VNC).
 
Old 06-09-2017, 01:38 AM   #6
BhushanPathak
Member
 
Registered: Nov 2013
Location: Pune, India
Distribution: CentOS
Posts: 85

Original Poster
Rep: Reputation: Disabled
The vnc server service file[/etc/systemd/system/vncserver@:4.service] config is -

Code:
[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 hadoop -c "/usr/bin/vncserver %i"
PIDFile=/home/hadoop/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target


Anything I need to change?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
centos7 Apache/2.4.6 - mod_remoteip Not working athreyavc Linux - Server 5 09-11-2018 05:09 PM
PATH not working properly on centos7 sigint-ninja Linux - Newbie 7 07-11-2016 07:40 PM
javac not working on my centos7 install sigint-ninja Linux - Newbie 2 07-10-2016 12:14 PM
usb speakers not working on centos7 sigint-ninja Linux - Newbie 2 07-09-2016 10:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration