LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 08-25-2020, 07:42 PM   #1
notooth
Member
 
Registered: Apr 2005
Posts: 192

Rep: Reputation: 15
VNC without SSH tunnel?


Hello,

Can anyone tell me how to make a VNC connection without SSH tunnel?
 
Old 08-25-2020, 07:46 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Ensure that no firewall blocks VNC ports on the VNC server. By default, the Centos firewall blocks the ports.
Run vncserver on the VNC server. It will tell you the port number or display number, e.g. :1.
Run a VNC client like tightvnc on the client. Provide the server's IP address followed by the port number.

EDIT: Here is one of the millions of tutorials that cover the subject: https://wiki.centos.org/HowTos/VNC-Server. It uses iptables to unblock ports, but on Centos 7 and later, firewall-cmd is an easier solution. I think you can use a command like firewall-cmd --add-service vnc or so.

Last edited by berndbausch; 08-25-2020 at 07:50 PM.
 
Old 08-25-2020, 08:09 PM   #3
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
I followed the tutorial and failed to make a connection:

Code:
$ sudo systemctl stop firewalld

$ vncserver

New 'localhost.localdomain:1 (notooth)' desktop is localhost.localdomain:1

Starting applications specified in /home/notooth/.vnc/xstartup
Log file is /home/notooth/.vnc/localhost.localdomain:1.log

$ vncviewer localhost.localdomain:1
...
CConn:       unable connect to socket: Connection refused (111)
 
Old 08-25-2020, 08:17 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Are you running the viewer on a different machine? Try using its ip address instead
 
Old 08-25-2020, 08:19 PM   #5
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
No, I run the server and the viewer on the same machine.
 
Old 08-25-2020, 09:30 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Here is another guide for CentOS 7

https://www.tecmint.com/install-and-...r-in-centos-7/

Since you are running the viewer on the same machine the firewall does not matter since you are using internal networking.

Last edited by michaelk; 08-25-2020 at 09:31 PM.
 
Old 08-25-2020, 10:14 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by notooth View Post
I followed the tutorial and failed to make a connection:

Code:
$ sudo systemctl stop firewalld

$ vncserver

New 'localhost.localdomain:1 (notooth)' desktop is localhost.localdomain:1

Starting applications specified in /home/notooth/.vnc/xstartup
Log file is /home/notooth/.vnc/localhost.localdomain:1.log

$ vncviewer localhost.localdomain:1
...
CConn:       unable connect to socket: Connection refused (111)
Connection refused means that there is no listener. List all listeners with sudo ss -lntp, and check the above log file.
 
Old 08-26-2020, 05:47 AM   #8
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by berndbausch View Post
Connection refused means that there is no listener. List all listeners with sudo ss -lntp, and check the above log file.
I listed all listeners, but I don't know how to check:
Code:
$ sudo ss -lntp
State           Recv-Q          Send-Q                   Local Address:Port                    Peer Address:Port                                                                               
LISTEN          0               128                            0.0.0.0:111                          0.0.0.0:*              users:(("rpcbind",pid=1170,fd=4),("systemd",pid=1,fd=240))          
LISTEN          0               32                       192.168.122.1:53                           0.0.0.0:*              users:(("dnsmasq",pid=1887,fd=6))                                   
LISTEN          0               128                            0.0.0.0:22                           0.0.0.0:*              users:(("sshd",pid=1402,fd=5))                                      
LISTEN          0               5                            127.0.0.1:631                          0.0.0.0:*              users:(("cupsd",pid=1403,fd=10))                                    
LISTEN          0               128                            0.0.0.0:3580                         0.0.0.0:*              users:(("nisvcloc",pid=39619,fd=5))                                 
LISTEN          0               128                            0.0.0.0:5355                         0.0.0.0:*              users:(("systemd-resolve",pid=1607,fd=13))                          
LISTEN          0               128                               [::]:111                             [::]:*              users:(("rpcbind",pid=1170,fd=6),("systemd",pid=1,fd=242))          
LISTEN          0               128                               [::]:22                              [::]:*              users:(("sshd",pid=1402,fd=7))                                      
LISTEN          0               5                                [::1]:631                             [::]:*              users:(("cupsd",pid=1403,fd=9))                                     
LISTEN          0               128                               [::]:5355                            [::]:*              users:(("systemd-resolve",pid=1607,fd=15))
 
Old 08-26-2020, 06:02 AM   #9
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by notooth View Post
I listed all listeners, but I don't know how to check:
Well, none of the listeners here is vncserver, which probably means that vncserver doesn't run at all. Thus the "connection refused" error.

Also, if it were running, it should normally be listening at an address/port combination of 127.0.0.1:5901.

The next step is finding out why it is not running or listening. The best bet for information about this problem is the log file.
 
Old 08-26-2020, 06:10 AM   #10
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
Here is the log file:
Quote:
Xvnc TigerVNC 1.9.0 - built Apr 23 2020 14:52:39
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12003000, The X.Org Foundation


Wed Aug 26 18:06:05 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Internal error: Could not resolve keysym XF86MonBrightnessCycle
> Internal error: Could not resolve keysym XF86RotationLockToggle
Errors from xkbcomp are not fatal to the X server
Killing Xvnc process ID 135195

Wed Aug 26 18:06:09 2020
ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)
 
Old 08-26-2020, 06:48 AM   #11
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
This is beyond my area of competency, but you are a step closer to the solution now. I suggest you try to find information about this error on the internet or create a new question.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the difference between VNC through SSH tunnel and VNC SSL? seraf Linux - Security 2 04-24-2018 11:07 PM
SSH tunnel over SSH tunnel vockleya Linux - Networking 6 01-22-2010 06:25 PM
VNC Over SSH | Linux laptop -> Linux SSH Server -> Windows VNC Server jakestaby Linux - Networking 3 01-28-2009 02:33 PM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 03:16 AM.

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