SUSE-12 SP4服务器连接VNC Server出现黑屏及总线连接拒绝问题
Looking at your error logs and configuration, the core issues are DBus bus connection failures and a misconfigured xstartup script that's causing gnome-session to crash. Let's walk through targeted fixes to resolve this:
1. Fix the .vnc/xstartup Configuration
Your current script has conflicting logic with SESSION_MANAGER and DBUS_SESSION_BUS_ADDRESS (you unset then immediately export empty values, which breaks inter-process communication). Replace it with a simplified, working version based on your preferred desktop:
Option A: For IceWM (Lightweight, Reliable)
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & /usr/bin/icewm-session &
Option B: For GNOME (If You Need the Full Desktop)
#!/bin/sh export XDG_CURRENT_DESKTOP=GNOME export GNOME_DESKTOP_SESSION_ID=this-is-deprecated unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec /usr/bin/gnome-session
After editing, make sure the script is executable:
chmod +x ~/.vnc/xstartup
2. Verify DBus Service is Running
The "Connection refused" errors point to DBus not being available. Restart and check the service:
systemctl restart dbus systemctl status dbus
Ensure it shows "active (running)" before proceeding.
3. Start VNC Server with Explicit Parameters
Avoid ambiguous startup settings by specifying display, resolution, and depth explicitly:
vncserver :1 -geometry 1920x1080 -depth 24
If you want to replace an existing session, kill it first:
vncserver -kill :1
4. Avoid Running VNC as Root (If Possible)
Root user environments often have stricter DBus permissions. Try creating a regular user account, installing VNC dependencies for that user, and starting the server from their session. This avoids many permission-related connection issues.
5. Address llvmpipe Rendering Issues
Your log mentions llvmpipe detected (software rendering), which can cause GNOME to crash on resource-limited systems. If you stick with GNOME, ensure you have proper GPU drivers installed. Alternatively, switch to a lighter desktop like XFCE (install with zypper install xfce4 and update xstartup to launch startxfce4).
Verify the Fix
After applying these changes, connect to your VNC session again. If it still fails, check the latest log at ~/.vnc/<hostname>:1.log for new errors and adjust accordingly.
内容的提问来源于stack exchange,提问作者saeeda

