Linux X Windows Display

siliconever
8 min readOct 7, 2021

Download here

In order to run Linux GUI applications on Bash On Ubuntu on Windows, you must: Install a X server for Windows; Configure bash to tell GUIs to use the local X server; Install VcXsrv. In order to run graphical Linux applications, you’ll need an X server. VcXsrv is the only fully open source and up-do-date native X server for windows.

  • Download Xming X Server for Windows for free. X Window System Server for Windows. Xming is the leading X Window System Server for Microsoft Windows 8/7/Vista/XP (+ server 2012/2008/2003). It is fully featured, small and fast, simple to install and because it is standalone native Microsoft Windows, easily made portable (not needing a machine.
  • Bash on WSL is intended for running command-line programs that developers might need, but it’s possible to run graphical Linux desktop programs on Windows using the Bash shell. To be more precise, you’ll be able to display graphical programs running in WSL on a Windows 10 desktop by using an X server which runs on Windows 10.

Active1 year, 7 months ago

When I run some programs over SSH, such as firefox &, I get an error

I would like to open many displays, still showing the stdout of each program.

Initial Question: How can I specify the display to get a many-displayed program?

Pablo Santa Cruz gives me the following code as a solution. I do not understand it.

What are yourmachine and yourdomain.com in the command?

Yuan Wen

68311 gold badge1111 silver badges3232 bronze badges

Léo Léopold Hertz 준영Léo Léopold Hertz 준영

50.4k140140 gold badges392392 silver badges615615 bronze badges

11 Answers

The way that X works is the same as the way any network program works. You have a server of some description (in this case, the X display server) which runs on a specific machine, and you have X clients (like firefox) that try to connect to that server to get their information displayed.

Often (on ‘home’ machines), the client and server run on the same box and there’s only one server, but X is powerful enough that this doesn’t need to happen. It was built with the server/client separation built in from the start.

This allows you to do such wondrous things such as log on to your box (in text mode) halfway around the planet, tell it that the display server is the box you’re currently on and, voila, the windows suddenly start appearing locally.

In order for a client to interact with a user, it needs to know how to find the server. There are a number of ways to do this. Many clients allow the -display or --displayoption to specify it:

Many will use the DISPLAY environment variable if a display isn't specifically given. You can set this variable like any other:

The first part of the DISPLAY variable is just the address of the display server machine. It follows the same rule as any other IP address; it can be a resolvable DNS name (including localhost) or a specific IP address (such as 192.168.10.55).

The second part is X-specific. It gives the X ‘display’ (X server) number and screen number to use. The first (display number) generally refers to a group of devices containing one or more screens but with a single keyboard and mouse (i.e., one input stream). The screen number generally gives the specific screen within that group.

An example would be:

Here you have a single machine (paxbox1.paxco.com) with two display servers. The first has four screens and the second has two. The possibilities are then:

depending on where you want your actual windows to appear and which input devices you want to use.

Ilya Kogan

15.1k1313 gold badges6767 silver badges126126 bronze badges

paxdiablopaxdiablo

669k185185 gold badges13311331 silver badges17261726 bronze badges

Pablo Santa CruzPablo Santa Cruz

142k2929 gold badges208208 silver badges257257 bronze badges

When you are connecting to another machine over SSH, you can enable X-Forwarding in SSH, so that X windows are forwarded encrypted through the SSH tunnel back to your machine. You can enable X forwarding by appending -X to the ssh command line or setting ForwardX11 yes in your SSH config file.

To check if the X-Forwarding was set up successfully (the server might not allow it), just try if echo $DISPLAY outputs something like localhost:10.0.

TobiXTobiX

Léo Léopold Hertz 준영

50.4k140140 gold badges392392 silver badges615615 bronze badges

sreenathsreenath

Narendra Pathai

25.8k1616 gold badges6868 silver badges111111 bronze badges

thegriglatthegriglat

I ran into a similar issue, so maybe this answer will help someone.

The reason for the Error: no display specified error is that Firefox is being launched, but there is no X server (GUI) running on the remote host. You can use X11 forwarding to run Firefox on the remote host, but display it on your local host. On Mac OS X, you will need to download XQuartz in order to use X11 forwarding. Without it, you won't have a $DISPLAY variable set, so if you try and echo $DISPLAY, it will be blank.

AndrewAndrew

106k165165 gold badges470470 silver badges648648 bronze badges

Please do NOT try to set $DISPLAY manually when connecting over SSH.
If you connect via SSH -X and $DISPLAY stays empty, this usually means that no encrypted channel could be established.

Most likely you are missing the package xauth or xorg-x11-xauth. Try to install it on the remote machine using:

or

After that end and restart your SSH connection. Don’t forget to use SSH -X so that X Window output is forwarded to your local machine. Microsoft sticky notes windows 10 downlo….

Now try echo $DISPLAYagain to see if $DISPLAY has been set automatically by the SSH demon. It should show you a line with an IP address and a port.

JpsyJpsy

13.2k33 gold badges7878 silver badges8888 bronze badges

I faced similar problem today. So, here’s a simple solution:While doing SSH to the machine, just add Ctrl — Y.

After login, type firefox &. And you are good to go.

Léo Léopold Hertz 준영

50.4k140140 gold badges392392 silver badges615615 bronze badges

Nandita ShuklaNandita Shukla

login to your server via

edit /etc/ssh/sshd_config file, and add this line to it.

Restart sshd. for CentOS (check your distribution)

check your DISPLAY

you should see this

Primary Features of PowerDirector Download. Powerdirector for pc windows 7 free download.

Enjoy

Ammar BozorgvarAmmar Bozorgvar

Even i faced the same in CentOS 6.8.

End your current session and open another session in tool like mobiXterm. Make sure session has X11 forwarding enabled in the tool.

Srihari KaranthSrihari Karanth

I through vnc to understand the X11 more.To specify the display to get a many-displayed program, export DISPLAY=IP:DisplayNum.ScreenNum

For example,

Export Display X11

YangYang

Not the answer you’re looking for? Browse other questions tagged x11 or ask your own question.

Windows 10’s Bash shell doesn’t officially support graphical Linux desktop applications. Microsoft says this feature is designed only for developers who want to run Linux terminal utilities. But the underlying “Windows Subsystem for Linux” is more powerful than Microsoft lets on.

It is possible to run graphical Linux applications in Windows 10, but bear in mind that it isn’t officially supported. Not every piece of Linux software works, and graphical applications are even more complex and less tested. But these should become more stable over time as Microsoft improves the underlying Windows Subsystem for Linux.

Windows 10’s Bash shell only supports 64-bit binaries, so you can’t install and run 32-bit Linux software.

How This Works

First, let’s run down exactly how this works so you can have some understanding of what we’re doing here.

Windows 10 includes an underlying “Windows Subsystem for Linux” that allows Windows 10 to run Linux software by translating Linux system calls to Windows system calls.

When you run a Linux distribution like Ubuntu, it downloads and installs a complete Ubuntu user space image on your computer. This includes the exact same binaries–or applications–that would run on Ubuntu. That “Bash on Ubuntu on Windows” environment works thanks to the underlying Windows Subsystem for Linux.

Microsoft doesn’t want to spend any time working on graphical software, as this feature is intended for command-line developer tools. But the main technical reason that graphical applications aren’t supported is that they require an “X server” to provide that graphical interface. On a typical Linux desktop, that “X server” automatically appears when you boot your computer and it renders the entire desktop and the applications you use.

But try opening a graphical application from Bash on Windows, though, and it will complain that it can’t open a display.

There are X server applications you can install on a Windows desktop, however. Typically, these are used to render Linux applications running on other computers–the “X11” protocol is rather old and was designed with the ability run over a network connection.

If you install an X server application on your Windows desktop and change a setting in the Bash shell, applications will send their graphical output to the X server application and they’ll appear on your Windows desktop. Everything should work fine, assuming those applications don’t depend on Linux system calls that the Windows Subsystem for Linux doesn’t yet support.

Step One: Install an X Server

There are several different X servers you could install on Windows, but we recommend Xming. Download it and install it on your Windows 10 PC.

The installation process is simple: You can just accept the default settings. It will then automatically launch and run in your system tray, waiting for you to run graphical programs.

Step Two: Install the Program

Zyxel wireless n adapter driver. Acer travelmate 5720 drivers. RELATED:How to Install Linux Software in Windows 10’s Ubuntu Bash Shell

You can install graphical Linux desktop programs like you can any other program, using the apt-get command in the Ubuntu-based Bash environment. For example, let’s say you’d want to install the graphical, GTK-based vim editor. You’d run the following command in the Bash window:

It will go through the installation process in the command line window, just like it does on Ubuntu.

Step Three: Set Your Display Environment Variable

Now, you’ll need to set the “DISPLAY” environment variable to point at the X server running on your Windows 10 PC. If you don’t do this, graphical applications will simply fail to launch.

To do this, run the following command in the Bash environment:

This setting only applies to your current Bash session. If you close the window, Bash will forget it. You’ll have to run this command each time you reopen Bash and want to run a graphical application.

Step Four: Launch an Application

You can now just launch a graphical application by typing the name of its executable, like you’d type any other command. For example, to launch vim-gtk, you’d run:

It’s that simple. If the application crashes after launching, the Linux system calls it requires may not be supported by the Windows Subsystem for Linux. There’s not much you can do about this. But give it a shot, and you may find that the apps you need work decently well!

You can also combine the third and fourth steps, if you like. Rather than exporting the DISPLAY variable once for an entire Bash shell session, you’d just run a graphical application with the following command:

For example, to launch gvim, you’d run:

Remember, this isn’t officially supported, so you may run into errors with more complex applications. A virtual machine is a more reliable solution for running many graphical Linux desktop applications on Windows 10, but this is a neat solution for some of the simpler stuff.

Linux X Windows Display Environment Variable

READ NEXT

Display Linux Desktop On Windows

  • › How to Use Text Editing Gestures on Your iPhone and iPad
  • › Windows 10’s BitLocker Encryption No Longer Trusts Your SSD
  • › How to Disable or Enable Tap to Click on a PC’s Touchpad
  • › How HTTP/3 and QUIC Will Speed Up Your Web Browsing
  • › Motherboards Explained: What Are ATX, MicroATX, and Mini-ITX?

Download here

--

--