Software⏱️ 3 min read📅 2026-06-15

How to Fix: CentOS 7 Minimal Installation on Hyper-V: X11 forwarding using Xming and PuTTy error, xhost: unable to open display ":0.0"

Fix X11 forwarding error on CentOS 7 Minimal Hyper-V VM with Xming and PuTTy.

Quick Answer: Check the display settings in Hyper-V VM and ensure that the X display location is correct, try setting DISPLAY=:0.0 in the terminal before running xhost +

The error 'Can't open display: :0.0' occurs when X11 forwarding is enabled but the display cannot be opened due to a missing or incorrect display configuration. This issue affects users who are trying to access graphical applications on their CentOS 7 Minimal Installation virtual machine using Hyper-V and PuTTy.

This problem can be frustrating because it prevents users from accessing graphical applications, which may be essential for their work or daily tasks. In this troubleshooting guide, we will walk through the steps to resolve this issue by identifying the root cause and applying the correct fix.

💡 Why You Are Getting This Error

  • The primary reason for this error is that the display configuration is not properly set up on the CentOS 7 Minimal Installation virtual machine. When X11 forwarding is enabled, the display must be configured correctly to allow applications to access it.
  • An alternative cause is that there may be a conflict between the Xorg server and the display manager (e.g., GDM) on the virtual machine.

🚀 How to Resolve This Issue

Configuring the Display with xauth

  1. Step 1: Run the command `xauth -f /root/.Xauthority` to generate an authentication file. This will create a file named `.Xauthority` in the root user's home directory, which contains the display configuration.
  2. Step 2: Copy the contents of the display configuration section from the Xorg server configuration file (`/etc/X11/xorg.conf`) and paste it into the `.Xauthority` file. The format should be `author @hostname :0.0`, where 'author' is your username and 'hostname' is the hostname of the virtual machine.
  3. Step 3: Restart the Xorg server by running the command `systemctl restart xorg`. This will apply the changes to the display configuration.

Configuring the Display with PuTTy

  1. Step 1: Open PuTTy and select 'X11 forwarding' in the settings. Ensure that the X display location is set to ':0.0'.

✨ Wrapping Up

To resolve the 'Can't open display: :0.0' error, you can try configuring the display with xauth or by adjusting the PuTTy settings for X11 forwarding. If neither method works, check for conflicts between the Xorg server and the display manager on your virtual machine.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions