I try to setup Remote administration with x0vncserver but I get an error message in local.
When I start x0vncserver in the remote, I get “failed to bind socket: Address already in use (98)”
x0vncserver -passwordfile ~/.vnc/passwd -display :0
Invalid MIT-MAGIC-COOKIE-1 key
Sun Dec 13 11:13:31 2020
Geometry: Desktop geometry is set to 1280x800+0+0
XDesktop: Using evdev codemap
XDesktop: XTest extension present - version 2.2
XDesktop: RANDR extension not present
XDesktop: Will not be able to handle session resize
Main: failed to bind socket: Address already in use (98)
sudo ss -tulpn | grep :5900
tcp LISTEN 0 5 0.0.0.0:5900 0.0.0.0:* users:(("X",pid=1319,fd=18))
tcp LISTEN 0 5 ::]:5900 ::]:* users:(("X",pid=1319,fd=19))
ls /proc | less
....
root 1319 1.5 2.5 576592 88604 tty7 Ssl+ 09:06 1:01 /usr/bin/X :0 -seat seat0 -auth /run/lightdm/root/:
....
On another computer running fine x0vncserver this last command return
First, a general observation… x0vncserver is generally not recommended (of the 3 main ways to deploy vnc) because it does not perform as well as the others. You might deploy x0vncserver only if you are just more familiar with setting it up over the others.
If you want to look at what is recommended, the openSUSE documentation describes how to set up xvnc which is generally recommended
Note that it’s recommended to install and start vncserver using YaST so that you are set up with a standard and expected working configuration that anyone who might help you should be familiar with. Again though, it would mean you aren’t running x0vncserver.
Although the error only refers to a socket error,
An Internet search returns only network socket issues, so it’s a good assumption that something else is already running using the same network socket(network address including port assignment).
Are you sure you’re not also running a web server on the machine which might create a conflict connecting using the web client?
How are you starting up your x0vncserver?
The references I generally use regarding x0vncserver are
AFAIK, x0vncserver is the only way to not create a new display but use the display created by the user in the remote computer.
If there is another way (it should be very recent) please let me know.
I can’t see any web server. Do you have a command line to check for sure? I never setup that.
I set the password with
No guarantees, but sometimes a bad entry in “.Xauthority” can cause similar problems. If you suspect that, the remove “.Xauthority” then immediately logout and login again. That causes “.Xauthority” to be regenerated.
If I want to remove “.Xauthority”, I usually logout from the graphic session and them remove it from a command line login. That’s safer.
Typically, “failed to bind socket: Address already in use” means that the server is already running, though it could also be caused by programming errors.
Since that is happening on the remote server, it might be harder to investigate.
# handle TCP port 6000
. /etc/sysconfig/displaymanager
if test "$DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN" != "yes" ; then
args="$args -nolisten tcp"
fi
....
exec X $dspnum -auth $auth $args
else
exec X $dspnum $args
fi
In the on working computer, then answer of test is not “yes”
> cat /etc/sysconfig/displaymanager
## Path: Desktop/Display manager
## Type: string(Xorg)
## Default: "Xorg"
#
DISPLAYMANAGER_XSERVER="Xorg"
## Path: Desktop/Display manager
## Description: settings to generate a proper displaymanager config
## Type: string(kdm,xdm,gdm,wdm,entrance,console,lightdm,sddm)
## Default: ""
#
# Here you can set the default Display manager (kdm/xdm/gdm/wdm/entrance/console).
# all changes in this file require a restart of the displaymanager
#
DISPLAYMANAGER="lightdm"
## Path: Desktop/Display manager
## Description: settings to generate a proper displaymanager config
## Type: yesno
## Default: no
#
# Allow remote access (XDMCP) to your display manager (xdm/kdm/gdm). Please note
# that a modified kdm or xdm configuration, e.g. by KDE control center
# will not be changed. For gdm, values will be updated after change.
# XDMCP service should run only on trusted networks and you have to disable
# firewall for interfaces, where you want to provide this service.
#
DISPLAYMANAGER_REMOTE_ACCESS="no"
## Type: yesno
## Default: no
#
# Allow remote access of the user root to your display manager. Note
# that root can never login if DISPLAYMANAGER_SHUTDOWN is "auto" and
# System/Security/Permissions/PERMISSION_SECURITY is "paranoid"
#
DISPLAYMANAGER_ROOT_LOGIN_REMOTE="no"
## Type: yesno
## Default: yes
#
# Let the displaymanager start a local Xserver.
# Set to "no" for remote-access only.
# Set to "no" on architectures without any Xserver (e.g. s390/s390x).
#
DISPLAYMANAGER_STARTS_XSERVER="yes"
## Type: yesno
## Default: no
#
# TCP port 6000 of Xserver. When set to "no" (default) Xserver is
# started with "-nolisten tcp". Only set this to "yes" if you really
# need to. Remote X service should run only on trusted networks and
# you have to disable firewall for interfaces, where you want to
# provide this service. Use ssh X11 port forwarding whenever possible.
#
**DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="no"
**
## Type: string
## Default:
#
# Define the user whom should get logged in without request. If string
# is empty, display standard login dialog.
#
DISPLAYMANAGER_AUTOLOGIN="xx"
## Type: yesno
## Default: no
#
# Allow all users to login without password, but ask for the user, if
# DISPLAYMANAGER_AUTOLOGIN is empty.
#
DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no"
## Type: yesno
## Default: no
#
# Display a combobox for Active Directory domains.
#
DISPLAYMANAGER_AD_INTEGRATION="no"
## Type: list(root,all,none,auto)
## Default: auto
#
# Determine who will be able to shutdown or reboot the system in kdm. Valid
# values are: "root" (only root can shutdown), "all" (everybody can shutdown),
# "none" (nobody can shutdown from displaymanager), "auto" (follow
# System/Security/Permissions/PERMISSION_SECURITY to decide: "easy local" is
# equal to "all", everything else is equal to "root"). gdm respects the
# PolicyKit settings for ConsoleKit. Shutdown configuration can be done via
# the polkit-default-privs mechanism.
#
DISPLAYMANAGER_SHUTDOWN="auto"
DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="no"
I can’t understand, “-nolisten tcp” should be added to the command.
I don’t want to reinstall now,
I need help!!!
> x0vncserver -passwordfile ~/.vnc/passwd -display :0
...
XDesktop: Will not be able to handle session resize
Main: failed to bind socket: Address already in use (98)
Slightly off topic to your efforts to get x0vncserver working (I’ll respond to that in a separate post after reviewing your guide and everything posted here so far), the following are answers to this post about setting up “normal” xvnc instead of x0vncserver
When you set up xvnc, you can set up support for two types of connections… “one time” connections which do not support sharing the Desktop of the interactively logged in User and “persistent connections” which does. If you installed the VNC using the YaST module, you’ll also have a nice graphical tool where you can set up the necessary options for either type of connections, see the screenshot of the following section of the openSUSE documentation. I wouldn’t say this info is “very recent” but it is authoritative, current and has always worked.
~> x0vncserver -passwordfile ~/.vnc/passwd -display localhost:0
x0vncserver: unable to open display "localhost:0"
As I wrote previously, I have 2 remote computers, one working with x0vncserver the other not working with x0vncserver.
I’ll try to replace x0vncserver by “xvnc” on the working one.
What I did:
In the remote computer
Menu>Yast>Network services>Remote administration(vnc)
Select:
Allow remote admin with session management
Open port in firewall
Next
Restart
In the local computer
Menu>Internet>Remote desktop viewer
Connect, Protocol:VNC, host:remote 192.168.1.116, Connect
Error message: "Connection to host 192.168.1.116 was closed
Other try:
Connect, Protocol:VNC, host:remote 192.168.1.116:5901, Connect
A bip happen in the remote
Error message: "Connection to host 192.168.1.116 was closed
I closed the viewer
From local:
Menu>Internet>Tiger vnc viewer
VNC server: 192.168.1.116:5901, Connect
A bip happen in the remote
Error message: “Could not acquire name on session bus. Close”
From CLI
> vncviewer 192.168.1.116:5901
TigerVNC Viewer 64-bit v1.9.0
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.
Sat Dec 19 08:54:08 2020
DecodeManager: Detected 8 CPU core(s)
DecodeManager: Creating 4 decoder thread(s)
CConn: connected to host 192.168.1.116 port 5901
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
CConnection: Choosing security type VeNCrypt(19)
CVeNCrypt: Choosing security type TLSNone (257)
Sat Dec 19 08:54:10 2020
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
As this issue is time consuming, could you be very accurate in the process.
Are all needed packages installed by default? If not, what is/are the exact package name(s) I have to install? There is no package named “xvnc”
Hi tsu2,
After long time to test different ways to get it working, I am afraid your above assertion is not true. AFAIK, the GUI run vncserver. In the man pages of vncserver, one can read:
vncserver can be run with no options at all. In this case it will choose the first available display number (usually :1), start Xvnc with that display number, and start the default window manager in the Xvnc session. You can also specify the display number, in which case vncserver will attempt to start Xvnc with that display number and exit if the display number is not available
It will never use the existing/running local user display and there is no option for that. You can try this if your runnung display is :0
> x0vncserver -passwordfile ~/.vnc/passwd -display :0
No protocol specified
Sun Dec 27 07:03:42 2020
Geometry: Desktop geometry is set to 1280x800+0+0
XDesktop: Using evdev codemap
XDesktop: XTest extension present - version 2.2
XDesktop: RANDR extension not present
XDesktop: Will not be able to handle session resize
Main: **failed to bind socket: Address already in use (98)**
> sudo ss -tulpn | grep :5900
[sudo] password for root:
tcp LISTEN 0 5 0.0.0.0:5900 0.0.0.0:* users:(("X",pid=1416,fd=18))
tcp LISTEN 0 5 ::]:5900 ::]:* users:(("X",pid=1416,fd=19))
> sudo lsof -i -P -n | grep LISTEN
.....
X 1416 root 18u IPv4 30171 0t0 TCP *:5900 (LISTEN)
X 1416 root 19u IPv6 30172 0t0 TCP *:5900 (LISTEN)
> ps aux | grep 1416
root 1416 0.6 1.8 487328 63228 tty7 Ssl+ 07:02 0:28 **/usr/bin/X :0** -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
Why X is listening? On my working computer, X is not listening when x0vncserver is not running. When I start x0vncserver, x0vncserver is listening at :5900
How to debug?
Many thanks