Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

解決 vnc4server 啟動時 xauth bad display name 錯誤

編輯:Linux 教學

錯誤現象

# vnc4server
xauth: (stdin):1: bad display name "LSPPC-Lenny:1" in "add" command
New 'LSPPC-Lenny:1 (root)' desktop is LSPPC-Lenny:1
...

雖可正常進入桌面,但錯誤訊息干擾。

根本原因

主機名稱 LSPPC-Lenny 未在 /etc/hosts 中正確對應至 127.0.0.1,導致 xauth 無法解析顯示名稱。

解決方法

  1. 編輯 /etc/hosts,確保包含:
    127.0.0.1 LSPPC-Lenny
  2. 或使用圖形工具(如 Webmin)→「網路設定」→「主機位址」→新增主機名對應 127.0.0.1。
  3. 儲存後重新啟動 vnc4server,錯誤即消失。

驗證

# cat /etc/hosts
127.0.0.1   localhost LSPPC-Lenny
...

只要本機主機名正確解析至回環位址,xauth 即可正常處理 display name。

Copyright © Windows教程網 All Rights Reserved