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
- A running instance of OpenSUSE latest.
- An active internet connection.
Install Xsrv on OpenSUSE latest
- Launch the terminal on your OpenSUSE system.
- Update the package repository index by running the following command:
sudo zypper update
- Install Xsrv package by running the following command:
sudo zypper install xorg-x11-server-Xorg
- 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.
- Open the file /etc/wsl.conf using your favorite text editor by running the following command:
sudo nano /etc/wsl.conf
- Add the following lines to the file:
[interop]
appendWindowsPath=true
Save the changes by pressing "Ctrl + X", then "Y", and finally "ENTER".
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
- Launch the WSL terminal and type the following command to start Xsrv:
export DISPLAY=:0
- 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.