Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A gray VNC desktop usually means TigerVNC started its virtual X server but could not launch a usable desktop session. The fastest fix is to read the display log, verify that the configured session exists in /usr/share/xsessions, remove any obsolete ~/.vnc/xstartup override, and then restart the display. Network or firewall changes will not repair a desktop session that exits immediately.

What a gray VNC screen actually indicates

When a VNC viewer shows a gray background, often with only a mouse pointer, the VNC connection itself is usually working. TigerVNC has created a virtual X display and is accepting input, but the desktop session that should draw panels, windows and menus either never started, started with the wrong name, or exited during startup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That distinction matters. Reconfiguring a viewer, opening another firewall port or exposing VNC directly to the internet cannot make a missing Xfce session appear. Diagnose the session first; deal with transport only after the display starts normally.

  • Session not installed: the configuration requests a desktop whose file is absent from /usr/share/xsessions.
  • Session exits early: the desktop starts and immediately terminates because a command, dependency or environment is unsuitable.
  • Old startup override: a tutorial-created ~/.vnc/xstartup takes precedence over TigerVNC’s packaged startup flow and launches nothing useful.
  • Display conflict: an existing :1 display, stale process or stale PID causes a different failure that can be mistaken for a desktop problem.

A gray screen is therefore a useful clue, not a diagnosis by itself. Treat the viewer as an indication that the X server is reachable, then use the server’s own log to identify which part of the session failed.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Start with the display list and per-display log

Do not begin by changing firewall rules. First find which display is running and inspect the newest log for that display.

  1. List the server’s active displays:
    tigervncserver -list
  2. List the VNC log files:
    ls -lt ~/.vnc/
  3. Open the log for the affected display. On current Ubuntu packaging it may be named like ~/.vnc/$(hostname -f):1.log:
    less ~/.vnc/$(hostname -f):1.log

Use the display number shown by tigervncserver -list rather than assuming it is :1. Search the log for messages such as “unable to start X session,” an early session exit, a missing command, or a display already in use. A clean-looking X server section does not prove that the desktop launched; the session portion of the same log is the important evidence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the log says the display is already in use, identify the existing session before starting another one. You may be looking at an old, partly broken session rather than a fresh launch. Keep a copy of the log while troubleshooting so you can tell whether a later restart actually changed the failure. Compare the timestamp and display number, because opening an older log can make a corrected configuration appear ineffective.

Run these checks as the same user who owns the VNC desktop. A root user’s ~/.vnc directory and configuration are different from those of an ordinary administrative user, and changing one will not repair the other.

Confirm that the configured desktop session exists

TigerVNC’s packaged startup flow selects a desktop by session name. That name must correspond to a desktop file installed on the VPS.

ls /usr/share/xsessions

Typical entries include xfce.desktop and gnome.desktop. The value you configure is the desktop name represented by that file, such as xfce for xfce.desktop. If the directory contains no usable session, selecting a different name in TigerVNC cannot work; install a desktop environment first.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the spelling and capitalization exactly. A configuration that requests xfce will not be repaired by installing a session under another name, and a copied setting from another distribution may refer to a desktop file that Ubuntu does not provide. Do not infer the session name from the desktop’s marketing name; use the actual filename on this VPS and remove the .desktop suffix when the package documentation calls for a session value.

Ubuntu’s TigerVNC documentation also supports an explicit -xstartup option. That option intentionally replaces the normal startup behavior with a script. Avoid adding it while diagnosing a standard packaged desktop unless you deliberately need a custom, minimal window-manager launch.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Remove an obsolete xstartup override

An old guide may have created ~/.vnc/xstartup. Ubuntu gives a user startup file precedence over the system startup script, so that one file can bypass the packaged session selection even after you install the correct desktop packages.

Move the file aside rather than deleting it:

mv ~/.vnc/xstartup ~/.vnc/xstartup.old

Renaming it lets TigerVNC use the packaged startup flow while preserving the old script for reference. If the gray screen disappears, the script was the override. If you genuinely need a custom startup, restore it only after checking every command it runs and confirming that it launches a session that remains active for the lifetime of the VNC display.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A custom script that starts one command and then exits can produce a gray or empty display even though its syntax is valid. Keep a custom script only when you understand that lifecycle and have a specific reason not to use Ubuntu’s packaged session handling. Do not keep multiple similarly named startup files and assume TigerVNC will choose the one you intended; the documented precedence determines which file is effective.

Set the session with the syntax your Ubuntu package expects

Configuration filenames and syntax differ between Ubuntu releases. Jammy-era instructions and Noble-era instructions are not interchangeable by default, so check the tigervncserver and tigervnc.conf manpages installed on the VPS.

Ubuntu 24.04 per-user configuration

Current Ubuntu 24.04 guidance uses the per-user file ~/.vnc/tigervnc.conf. Set the session to a name that matches an installed desktop file:

$session="xfce";

The dollar sign and semicolon are part of this configuration form. If Xfce is installed as xfce.desktop, xfce is the matching value. A typographical change such as omitting the dollar sign or semicolon can make the setting invalid for this configuration format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Packaged configuration using ~/.vnc/config

The same packaged flow also accepts a plain setting in ~/.vnc/config:

session=xfce

Do not place both forms in different files and then guess which one won. Use the form documented by the package on your VPS, and remove or rename an obsolete conflicting file if the manpage indicates a different precedence. The goal is one clear, per-user session setting that matches one installed desktop file.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Why copying an older tutorial can fail

Older tutorials often assume a different startup script, configuration path or option syntax. A file can be read successfully yet still select no valid desktop, while an old xstartup can override the setting altogether. The local manpages are the authoritative reference for the release actually installed; use the examples above as the current Ubuntu 24.04 form, not as a universal rule for every Ubuntu image.

When comparing instructions, first identify the Ubuntu release and the installed TigerVNC package, then check where that package expects per-user settings. A command copied from a different release can create files that look plausible but are ignored, or it can activate the older startup path that caused the gray screen in the first place.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install a desktop environment when the VPS has none

A minimal Ubuntu VPS may have an SSH shell and no graphical desktop. If the log shows that no X session can start because a desktop is absent, install a session before changing TigerVNC settings. The current Ubuntu 24.04 walkthrough uses Xfce, its supplementary tools and the standalone TigerVNC server package:

sudo apt update
sudo apt install xfce4 xfce4-goodies tigervnc-standalone-server

After installation, run ls /usr/share/xsessions again and confirm that the expected desktop file is present. Then configure xfce using the syntax appropriate to your package and restart the display.

Xfce is commonly selected on VPS instances because it is relatively resource-efficient. GNOME can work when its session is installed and compatible with the TigerVNC setup; it is not a substitute for installing the session or matching its name. Choose the desktop that exists on the machine and fits its available resources rather than changing the viewer.

Installing packages alone does not select the session automatically. Recheck the session file and the per-user TigerVNC setting after apt install, because the gray display can persist until the old VNC display is stopped and started with the corrected configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Restart the affected display cleanly

Once the session name and startup precedence are correct, stop the affected display and start it again. For a display numbered :1, a typical clean stop is:

tigervncserver -kill :1

Check the list first if you are unsure which display is active. If :1 is stale or occupied by another process, either terminate that specific session after verifying it is safe to do so, or start a separate display such as :2. Display :1 normally corresponds to TCP port 5901; display :2 normally corresponds to port 5902.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Start the server using the command and options documented by the installed package, then run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
tigervncserver -list

Read the newly created per-display log before reconnecting repeatedly. A clean restart should produce a log without an early desktop-session exit. If the same error returns, use the new log rather than relying on what the viewer displayed during the previous session.

Do not kill every VNC process indiscriminately on a multi-user VPS. The display number identifies a session, and another administrator or service may be using a different display. Stop only the affected display after checking the list, then verify that the replacement display appears in the list and has a new log.

Use SSH tunneling when VNC listens on loopback

Ubuntu 24.04 setup guidance keeps TigerVNC bound to loopback and forwards the connection through SSH. This is a transport choice, separate from the gray-screen problem.

For display :1, create a local tunnel such as:

ssh -L 5901:localhost:5901 user@your-vps-address

Leave that SSH connection open and point the VNC viewer at the local end, commonly localhost::5901. If you use display :2, forward port 5902 and connect to localhost::5902.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A direct connection to the VPS address can fail while the tunnel works when TigerVNC is intentionally listening only on loopback. That result indicates listening-mode or firewall configuration, not a failed desktop session. Do not expose the VNC port publicly merely to work around a gray desktop; first make the local session start correctly, then choose the transport policy you actually need.

The display number must remain consistent across the server, SSH command and viewer. Forwarding 5901 while the active session is :2 connects to the wrong endpoint and can create confusing connection errors even though the desktop itself is healthy.

Match the symptom to the remedy

What you observe Most likely cause Next action
Gray background and pointer; log reports an early session exit The selected desktop failed to launch Verify the session file, remove stale xstartup, correct the per-user session setting, then restart.
Log says the requested session cannot be found The configured name has no matching file in /usr/share/xsessions List that directory and configure an installed desktop, or install Xfce.
Log references an old startup script or commands that are no longer installed ~/.vnc/xstartup overrides the packaged startup flow Move it to ~/.vnc/xstartup.old and retry.
Display :1 is already in use An existing or stale VNC session occupies the display Inspect tigervncserver -list, stop the correct session, or use :2.
Viewer cannot connect directly, but SSH forwarding works TigerVNC is listening on loopback by design Use the SSH tunnel or deliberately configure listening and firewall rules.
The viewer connects but shows only a blank gray field after installing Xfce The running display still uses the old session or startup override Confirm the session file, move the stale override, kill the old display and start a fresh one.
A new display works but the original :1 does not The original display has a stale process, PID or configuration state Keep the working display temporarily, inspect the old display’s log, and cleanly stop the stale session before reusing :1.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Packaged session or custom startup script?

Approach Best use Trade-off
Packaged session selection A normal Xfce or GNOME desktop on Ubuntu Easier to maintain because Ubuntu’s startup integration and desktop files remain in control.
Custom xstartup or -xstartup A deliberate minimal window-manager launch or a specialized environment You must maintain the script, its commands and its exit behavior; an obsolete script can cause a gray screen.

Use the packaged path while repairing a standard Ubuntu VPS. Switch to a custom script only after you can explain why the packaged session does not meet your requirement. A custom path also makes future package changes your responsibility: commands removed from the image, a renamed desktop executable or a script that exits too soon can recreate the same symptom.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

What not to change first

  • Do not start with the firewall: a successful VNC handshake followed by a gray desktop points to the session, not the port.
  • Do not expose VNC publicly as a test: loopback plus SSH forwarding is the documented transport choice for the current setup.
  • Do not stack configuration files: conflicting per-user settings and an old xstartup make it unclear which startup path is active.
  • Do not assume every gray screen is identical: an early desktop exit, missing session file and occupied display require different repairs.
  • Do not repeatedly reconnect to an unchanged display: stop it, start it with the corrected settings and inspect the new log.

End-to-end repair checklist

  1. Run tigervncserver -list and identify the affected display.
  2. Open the newest matching file under ~/.vnc/ and look for session-start errors, missing commands, early exits or display conflicts.
  3. Run ls /usr/share/xsessions and note the exact desktop names installed.
  4. Move an old user startup file out of the way with mv ~/.vnc/xstartup ~/.vnc/xstartup.old, unless you intentionally maintain that script.
  5. Set the matching session in the configuration form documented by the installed package: for current Ubuntu 24.04, use $session="xfce"; in ~/.vnc/tigervnc.conf or the accepted session=xfce form in ~/.vnc/config.
  6. If no desktop session is installed, install xfce4, xfce4-goodies and tigervnc-standalone-server, then verify the new desktop file.
  7. Stop the affected display, start it again, and read the new log before changing network settings.
  8. If the server is on loopback, connect through an SSH tunnel using the port that matches the display number.

If the display remains gray after this sequence, the next useful evidence is the newest per-display log and the exact list of files in /usr/share/xsessions. Those two pieces distinguish a failed desktop launch from a transport or display-number problem without introducing unrelated changes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Why is my Ubuntu VPS VNC screen gray with only a mouse cursor?

TigerVNC usually started the virtual X server, but the desktop session failed, exited early or was never selected. Check the newest per-display log, match the configured session to a file in /usr/share/xsessions, and remove an obsolete ~/.vnc/xstartup override.

How do I make XFCE start in VNC on Ubuntu 24.04?

Install xfce4, xfce4-goodies and tigervnc-standalone-server if needed. Confirm xfce.desktop exists, then set $session="xfce"; in ~/.vnc/tigervnc.conf, or use the documented session=xfce form in ~/.vnc/config. Move aside any old ~/.vnc/xstartup and restart the display.

Should I delete my VNC xstartup file?

Move it to ~/.vnc/xstartup.old first. Ubuntu gives that user file precedence over the packaged startup script, so renaming it is a safe diagnostic that preserves the old script. Keep a custom script only when you intentionally maintain its commands and session lifetime.

What if :1 is already in use?

Run tigervncserver -list and identify the existing display. Stop the correct session with tigervncserver -kill :1 if it is stale and safe to terminate, or use display :2. Display :1 normally maps to port 5901 and :2 to 5902.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does VNC work through SSH but not when I connect directly?

The server is likely listening on loopback, which is a transport setting. Keep the SSH tunnel open and connect the viewer to the local endpoint, such as localhost::5901 for display :1. A tunnel working does not indicate a desktop-session failure.

Can changing the firewall fix a gray VNC desktop?

No. If the viewer reaches a gray X display, the connection has already succeeded. Read the session log and correct the desktop installation, session name, startup precedence or display conflict first. Change firewall or listening rules only after the desktop starts normally.

Is GNOME supported instead of Xfce?

GNOME can work when its session is installed and compatible with the TigerVNC setup. Configure the exact session represented by the installed file in /usr/share/xsessions. Xfce is commonly chosen on VPS instances for resource efficiency, but the installed and compatible session is the deciding factor.

Which configuration file should I use: tigervnc.conf or config?

Use the syntax documented by the TigerVNC package installed on that Ubuntu release. Current Ubuntu 24.04 guidance uses ~/.vnc/tigervnc.conf with $session="xfce";; the packaged flow also accepts session=xfce in ~/.vnc/config. Avoid conflicting files and verify the local manpages.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Bottom Line

A gray Ubuntu VNC screen normally means the virtual X server is alive but its desktop session is not. Identify the display, read its newest log, match the session name to /usr/share/xsessions, move aside stale ~/.vnc/xstartup, install Xfce if no desktop exists, and restart cleanly. Once the session works, use the matching SSH tunnel and port for a loopback-bound server.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.