How to Install Xsrv on OpenSUSE

Xsrv is a lightweight X server for Windows that is designed to work seamlessly with Windows Subsystem for Linux (WSL). In this tutorial, we will guide you on how to install Xsrv on OpenSUSE latest.

Prerequisites

Install Xsrv on OpenSUSE latest

  1. Launch the terminal on your OpenSUSE system.
  2. Update the package repository index by running the following command:

sudo zypper update

  1. Install Xsrv package by running the following command:

sudo zypper install xorg-x11-server-Xorg

  1. Verify the successful installation of Xsrv by running the following command:

sudo systemctl status display-manager

If Xsrv service is running then you have successfully installed Xsrv on OpenSUSE. You can now use it to run graphical applications from your WSL environment.

Configure Xsrv for WSL

Before you can use Xsrv to run graphical applications from WSL, you need to configure it to allow incoming connections from the WSL environment.

  1. Open the file /etc/wsl.conf using your favorite text editor by running the following command:

sudo nano /etc/wsl.conf

  1. Add the following lines to the file:
[interop]
appendWindowsPath=true
  1. Save the changes by pressing "Ctrl + X", then "Y", and finally "ENTER".

  2. Next, you need to enable the Windows Defender Firewall rule for the Xsrv server. To do this, run the following command in a PowerShell prompt on Windows:

New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -Program "%SystemRoot%\System32\wsl.exe" -Action Allow

Launch Xsrv from WSL

  1. Launch the WSL terminal and type the following command to start Xsrv:

export DISPLAY=:0

  1. Run a graphical application, for example, Xclock, to test the connection by running the following command:

xclock

If everything is set up properly, you should see the Xclock application window appear on the OpenSUSE desktop.

Congratulations! You have successfully installed Xsrv on OpenSUSE and configured it to work with WSL. You can now use it to run graphical applications from your WSL environment.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!