A grey screen on VNCServer port 1 typically indicates that the Xvnc process cannot authenticate with the X server or fails to initialize the display environment properly. This issue often stems from incorrect authorization files, missing display variables, or conflicts between the display manager and the VNC service. By verifying the
~/.Xauthority permissions and ensuring the correct
DISPLAY variable is set in the startup script, you can restore full graphical functionality.
Understanding the Grey Screen Symptom
When a VNC client connects to a Linux system via TightVNC or similar software and receives a grey screen instead of a desktop, it means the connection was established at the network level, but the graphical session failed to render. Unlike a black screen which might indicate no display server is running, a grey screen suggests the X server is active but cannot draw content due to authentication errors or missing resources. This is particularly common when the VNC server attempts to attach to an existing X session (like :0) rather than creating its own virtual display.
The underlying cause is usually related to how Xorg handles security. Modern versions of Xorg use MIT-MAGIC-COOKIE-1 for local authentication. If the VNC server does not have access to the correct cookie file stored in the user's home directory, it will connect but be denied drawing privileges, resulting in the blank interface. This behavior is distinct from issues seen in other display protocols like Wayland, where compositor crashes might lead to different failure modes as discussed in
SDDM on Wayland Crashes in Test Mode.
Verifying Display Variables and Startup Scripts
The most immediate step is to inspect the startup script used by your VNC server. In Ubuntu systems using TightVNC, this is often located at
~/.vnc/xstartup. If this file is missing or contains only comments, the server may default to a minimal shell or fail to launch a window manager. You must ensure the script explicitly sets the
DISPLAY variable and launches a desktop environment.
For a standard Ubuntu setup, the
xstartup file should contain commands to source the system-wide profile and start a desktop environment like GNOME or XFCE. For example:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
Ensure the file is executable by running
chmod +x ~/.vnc/xstartup. Without execute permissions, the VNC daemon will silently fail to load the desktop components, leading to the grey screen. Additionally, check if the VNC server is configured to listen on the correct display number. Port 1 often corresponds to display
:1, so verify that the
vncserver command was invoked with
-geometry and
-depth parameters that match your client's capabilities.
Checking Xauthority Permissions
Authentication failures are the primary culprit for grey screens. The X server relies on the
.Xauthority file in the user's home directory to grant access to the display. If this file has incorrect ownership or permissions, the VNC server cannot read the magic cookie required for authentication.
Run the following commands to reset permissions:
sudo chown $USER:$USER ~/.Xauthority
sudo chmod 600 ~/.Xauthority
If the file is corrupted or missing, deleting it allows the system to regenerate a fresh one upon the next login. Note that modifying these files requires care; improper changes can lock you out of the local console. This approach differs significantly from network interface configurations, where authentication is handled by PAM modules as detailed in
How do allow Linux PAM Authentication for non-local users, but here we are dealing with local X11 socket security.
Resolving Auth File Conflicts
In some cases, the VNC server tries to use the auth file associated with the main display (
:0) instead of generating its own. This can happen if the
vncserver command is run without specifying a unique display ID or if the configuration forces attachment to the primary session. To resolve this, you can stop any running VNC instances and restart them with explicit display numbers.
Use
vncserver -kill :1 to terminate the current instance, then start a new one with
vncserver :1. This forces the creation of a new virtual display and a corresponding
.Xauthority entry for that specific session. If you continue to experience issues, consider reviewing how Xorg handles authentication tokens, especially in older Ubuntu versions where legacy auth methods were more prevalent, as seen in discussions about
Ubuntu 20.04: Eliminating '-auth' in Xorg process list.
Testing with a Minimal Window Manager
To isolate whether the issue lies with your full desktop environment or the VNC infrastructure itself, try launching a lightweight window manager like
openbox or
fluxbox. Modify your
xstartup to launch only this minimal WM. If the grey screen disappears and you see a basic desktop, the problem is likely resource-heavy or incompatible packages in your full DE. This diagnostic step helps determine if the issue is systemic or application-specific.
Frequently Asked Questions
Why does my VNC show a grey screen instead of connecting?
A grey screen indicates that the network connection succeeded but the graphical rendering failed due to authentication errors or missing window managers. It is rarely a network blockage but rather an X11 permission issue preventing the VNC server from drawing to the display.
How do I fix Xauthority permission errors for VNC?
You can fix this by ensuring the
.Xauthority file is owned by the user and has mode 600 permissions. Use
chown and
chmod commands to correct ownership, or delete the file to force regeneration on the next login.
Can I use VNC on the same display as my local monitor?
Yes, but it requires careful configuration to avoid locking the local session. Attaching to display
:0 shares the session, which can cause input conflicts. Creating a separate virtual display like
:1 is safer and prevents interference with the physical monitor.
What is the difference between a black screen and a grey screen in VNC?
A black screen usually means the X server is not running or the VNC client cannot establish a connection to the display server. A grey screen implies the server is running but cannot render graphics due to auth failures or missing desktop environments.
Does Wayland support VNC directly?
Standard VNC protocols are designed for X11 and do not work natively with Wayland compositors. You may need to use a Wayland-compatible remote desktop solution or switch to Xorg if VNC compatibility is critical for your workflow.