Software & AppsOperating SystemLinux

How To Fix Grey Screen with Ubuntu 20.04 and tightVNC

Ubuntu 9

In this article, we will be discussing a common issue faced by many Ubuntu 20.04 users while using tightVNC, which is the appearance of a grey screen. We will walk you through a step-by-step guide on how to fix this issue.

Quick Answer

To fix the grey screen issue with Ubuntu 20.04 and tightVNC, you need to edit the xstartup file, remove the def line, set executable permissions, add necessary lines, and restart the VNC server. This should resolve the issue and allow you to see the desktop instead of a grey screen.

Understanding the Problem

When you connect to Ubuntu 20.04 using tightVNC, you may encounter a blank grey screen instead of your desktop. This issue usually arises due to a misconfiguration in the xstartup file, which is responsible for starting the X server and launching the desktop environment.

Prerequisites

Before we begin, make sure you have the following:

  • Ubuntu 20.04 installed on your machine
  • tightVNC installed and configured correctly
  • Access to the terminal and necessary permissions to execute commands

Step-by-Step Guide to Fix the Grey Screen Issue

Step 1: Open the xstartup File

The xstartup file is located in the ~/.vnc directory. To open and edit this file, use the following command:

nano ~/.vnc/xstartup

In this command, nano is a command-line text editor, and ~/.vnc/xstartup is the path to the xstartup file.

Step 2: Edit the xstartup File

In the xstartup file, locate the line that says def on line 2. This line often causes a “not found” error message, leading to the grey screen issue. Remove this line.

Step 3: Set File Permissions

Ensure that the xstartup file has executable permissions. This can be done by running the following command:

chmod +x ~/.vnc/xstartup

In this command, chmod is used to change file access permissions, +x adds execute permissions, and ~/.vnc/xstartup is the file to which the permissions are being applied.

Step 4: Add Necessary Lines

Add the following lines to the xstartup file before the startxfce4 line:

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc

These lines are necessary to unset some variables and execute the xinitrc file, which starts the X Window System.

Step 5: Save Changes and Exit

After making the changes, save the file and exit the editor.

Step 6: Restart the VNC Server

Finally, restart the VNC server. First, stop the server using the following command:

vncserver -kill :1

In this command, vncserver -kill :1 stops the VNC server running on display number 1.

Then, start the server again with the following command:

vncserver -geometry 1920x1080 -depth 24

In this command, vncserver starts the VNC server, -geometry 1920x1080 sets the screen resolution, and -depth 24 sets the color depth.

Step 7: Connect to the Ubuntu Machine

Now, try connecting to the Ubuntu machine using the VNC viewer. You should be able to see the default Gnome desktop instead of the grey screen.

Additional Resources

If you still encounter issues, consider referring to the following resources:

This thread provides insights into resolving the “no VNC extension” error message.

We hope this guide helps you resolve the grey screen issue when using tightVNC with Ubuntu 20.04. Remember to adapt these instructions to your specific setup and configuration.

Why am I seeing a grey screen when using tightVNC with Ubuntu 20.04?

The grey screen issue usually occurs due to a misconfiguration in the xstartup file, which is responsible for starting the X server and launching the desktop environment.

How can I fix the grey screen issue?

To fix the grey screen issue, you need to edit the xstartup file, remove the def line, set executable permissions for the file, add necessary lines before the startxfce4 line, save the changes, and restart the VNC server.

Where is the `xstartup` file located?

The xstartup file is located in the ~/.vnc directory.

What command can I use to open and edit the `xstartup` file?

You can use the nano command-line text editor to open and edit the xstartup file. The command is nano ~/.vnc/xstartup.

How can I set executable permissions for the `xstartup` file?

You can use the chmod command to set executable permissions for the xstartup file. The command is chmod +x ~/.vnc/xstartup.

What lines should I add to the `xstartup` file?

Before the startxfce4 line, add the following lines:

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /etc/X11/xinit/xinitrc
How do I restart the VNC server?

To restart the VNC server, first stop the server using the command vncserver -kill :1, and then start the server again with the command vncserver -geometry 1920x1080 -depth 24.

What screen resolution and color depth should I set when starting the VNC server?

You can set the screen resolution to 1920x1080 and the color depth to 24 when starting the VNC server.

What should I do if I still encounter issues?

If you still encounter issues, you can refer to the additional resources provided in the article, such as the Ask Ubuntu thread on the "no VNC extension" error message.

Leave a Comment

Your email address will not be published. Required fields are marked *