Running VNC on Ubuntu Desktop Without a Connected Monitor

Introduction

Running a Virtual Network Computing (VNC) server on an Ubuntu Desktop machine without a connected monitor can be challenging. By default, many modern systems disable the graphical user interface (GUI) when no monitor is detected. This results in a blank screen or an unresponsive VNC session when attempting to connect remotely.

To solve this issue, a dummy video driver can be used to emulate a connected monitor. This allows the graphical environment to start as if a physical display were attached. This guide walks you through the process of installing and configuring Ubuntu to support VNC connections without requiring a physical monitor.

Why Use a Dummy Video Driver?

Several scenarios may require running Ubuntu with a GUI remotely without a physical monitor:

  • Headless Servers with GUI Needs: If you are managing a remote machine that requires a GUI for specific applications.
  • VNC or Remote Desktop Access: When using VNC or RDP services to access a machine that does not have a display attached.
  • Workstations Used for Development or Automation: Developers who work remotely but need a GUI for development tools and testing.
  • Preventing Low-Resolution Issues: Some remote desktop software defaults to low resolutions when no monitor is detected. Using a dummy driver ensures higher resolutions are available.

Installing the Dummy Video Package

To enable a virtual display, you need to install the xserver-xorg-video-dummy package, which provides a fake video driver:

sudo apt-get update
sudo apt-get install xserver-xorg-video-dummy        

Configuring Xorg to Use the Dummy Driver

Next, you must create or modify the Xorg configuration file to specify the dummy driver and define a preferred resolution.

Create or Edit the Xorg Configuration File

  1. Open the Xorg configuration file for editing:

sudo vi /usr/share/X11/xorg.conf.d/xorg.conf        

  1. If the file already exists, consider renaming it as a backup:

sudo mv /usr/share/X11/xorg.conf.d/xorg.conf /usr/share/X11/xorg.conf.d/xorg.conf.bak        

  1. Add the following configuration to the file:

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1920x1080"
    EndSubSection
EndSection        

This configuration specifies:

  • The use of the dummy video driver.
  • A virtual monitor with standard refresh rates.
  • A default screen resolution of 1920x1080 (this can be modified as per your needs).

  1. Save and exit the file.

Reboot and Test

Once the configuration file is set up, reboot the system to apply the changes:

sudo reboot        

After rebooting, attempt to connect to the machine using a VNC client. If configured correctly, the system should boot with a GUI accessible via VNC, even without a physical monitor connected.

Additional Considerations

  • Multiple Resolutions: If you need multiple resolutions, you can add them under the Modes section.
  • Virtual Display via XRandR: For dynamic resolution changes, you can use xrandr after logging in via SSH or VNC.
  • X11 vs Wayland: Ensure you are using X11 as the display server, as Wayland may not support dummy video devices properly.

Conclusion

Setting up an Ubuntu Desktop machine to run VNC without a connected monitor requires configuring a dummy video driver. By following the steps outlined above, you can enable remote graphical access with your preferred resolution, ensuring a seamless experience even when no physical display is attached. This setup is particularly useful for headless workstations, remote development, and GUI-based server applications.


To view or add a comment, sign in

More articles by Govind Yadav

Insights from the community

Others also viewed

Explore topics