首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法启动vncserver: bind:无法分配请求的地址(99)

无法启动vncserver: bind:无法分配请求的地址(99)
EN

Unix & Linux用户
提问于 2018-01-21 15:01:45
回答 3查看 2.1K关注 0票数 0

我在我的覆盆子Pi中使用vnc over ssh。它已经运行了一段时间,但是在跟踪这些指示之后,在运行Raspbian的Raspberry上设置了openvpn。我发现我无法再访问Raspberry Pi上的VNC服务器。

ssh上转发D4是有效的,但是很明显,vnc server无法访问它的端口,因此甚至没有启动。

代码语言:javascript
复制
$ sudo systemctl status vncserver-x11-serviced -l

● vncserver-x11-serviced.service - VNC Server in Service Mode daemon
   Loaded: loaded (/usr/lib/systemd/system/vncserver-x11-serviced.service; enabled)
   Active: active (running) since Sun 2018-01-21 14:25:11 GMT; 1s ago
Main PID: 8896 (vncserver-x11-s)
   CGroup: /system.slice/vncserver-x11-serviced.service
       ├─8896 /usr/bin/vncserver-x11-serviced -fg
       ├─8898 /usr/bin/vncserver-x11-core -service
       └─8913 /usr/bin/vncagent service 14

Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: ConsoleDisplay: Found running X server (pid=1001)

那个港口上似乎没有任何东西在运行。这是lsof的输出:

代码语言:javascript
复制
$ sudo lsof -i tcp

COMMAND    PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
cupsd      752       root   10u  IPv4  13511      0t0  TCP localhost:ipp (LISTEN)
cups-brow  756       root    5u  IPv4 313573      0t0  TCP localhost:48450->localhost:ipp (CLOSE_WAIT)
dnsmasq    914    dnsmasq    5u  IPv4  11726      0t0  TCP *:domain (LISTEN)
dnsmasq    914    dnsmasq    7u  IPv6  11728      0t0  TCP *:domain (LISTEN)
sshd       976       root    3u  IPv4  11842      0t0  TCP *:2718 (LISTEN)
tor        998 debian-tor    4u  IPv4  12125      0t0  TCP 192.168.254.159:49042->ks3352401.kimsufi.com:8090 (ESTABLISHED)
tor        998 debian-tor    7u  IPv4  14489      0t0  TCP localhost:9050 (LISTEN)
tor        998 debian-tor   11u  IPv4  15915      0t0  TCP 172.94.70.220:47186->166.70.170.234:https (ESTABLISHED)
sshd      5550       root    3u  IPv4 315897      0t0  TCP 192.168.254.159:2718->192.168.254.47:64500 (ESTABLISHED)
sshd      6322      morey    3u  IPv4 315897      0t0  TCP 192.168.254.159:2718->192.168.254.47:64500 (ESTABLISHED)
sshd      6322      morey   10u  IPv4 319584      0t0  TCP localhost:6010 (LISTEN)

以下是一些可能有用的其他信息:

代码语言:javascript
复制
$ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

$ vncserver --help
VNC(R) Server 6.1.1 (r28093) ARMv6 (May 19 2017 12:59:35)

这可能与对iptables的更改或在/etc/sysctl.conf中禁用ip6有关,但我不知道如何排除它。任何想法都将不胜感激。

EN

回答 3

Unix & Linux用户

发布于 2018-01-22 14:47:31

代码语言:javascript
复制
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)

::1是IPv6与127.0.0.1的等价物。因此,如果您禁用了IPv6,那么是的,听::1变得不可能了。

你有两个选择:

  • 首先,在我看来,推荐的是重新启用IPv6。在现代世界中,没有真正的理由禁用IPv6 (事实上,几年后,如果没有IPv6,您可能无法访问互联网),而且它可能会引起比这个更多的问题。
  • 配置vncserver-x11,使其不再试图侦听::1或任何其他IPv6地址(::将是最有可能的其他候选地址)。

vncserver-x11-serviced似乎是特定于RealVNC的,我找不到任何说明如何为其配置侦听地址的文档,因此您可能需要自己找出最后一点。

票数 1
EN

Unix & Linux用户

发布于 2018-01-22 14:59:21

代码语言:javascript
复制
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not accepting connections: failed to listen on at least one address.
Jan 21 14:25:11 raspberrypi vncserver-x11[8898]: TcpListenerManager: not listening on [::1]::5900: bind: Cannot assign requested address (99)

侦听地址无效。端口应该用一个:与地址分开,而不是在IPv6地址中用作缩略语的双::

无论您在何处配置了[::1]::5900,都要更改为[::1]:5900

票数 0
EN

Unix & Linux用户

发布于 2020-07-18 12:57:12

我禁用了ipv6,使用-IpListenAddresses=0.0.0.0修复了RealVnc的相同问题。

确保从参数中删除-localhost

以下是参数详细信息

IpListenAddresses -逗号分隔的IP地址列表,用于侦听TCP/UDP连接,或空以侦听所有可用的IP地址。注意,如果localhost参数设置为True,则忽略此参数。(default=)

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/418646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档