element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Taking Advantage of X Windows on Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mconners
  • Date Created: 2 Feb 2016 6:48 PM Date Created
  • Views 9575 views
  • Likes 7 likes
  • Comments 18 comments
Related
Recommended
  • raspberry
  • x windows
  • raspberry pi

Taking Advantage of X Windows on Raspberry Pi

mconners
mconners
2 Feb 2016

This blog tutorial will address taking advantage of features available in X Windows on the Raspberry Pi.

 

What is X Windows

 

 

From Wikipedia:

The X Window System (X11, or shortened to simply X, and sometimes informally X-Windows) is a windowing system for bitmap displays, common on UNIX-like computer operating systems.

X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface — this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.

X's design requires the clients and server to operate separately...

 

Modern X implementations use Unix domain sockets for efficient connections ...

 

Taking advantage of this design

 

OK. What does this mean to us. What we now know is that X Windows is the windowing system for UNIX/GNU Linux type operating systems. We know that the client and the server operate separately, and we know that it uses sockets for communication.

 

Taking advantage of the fact that the client and the server operate separately and communicate through sockets, we can run the client (the GUI program) on one machine and display the output on another machine running an X server.

 

On a linux system, this is a trivial task. I currently run Ubuntu on my desktop, and my Raspberry Pi is connected to my local network. Without any special configuration I can log in to my Pi via ssh, start a GUI program, and have it display on my local monitor. This avoids the necessity of having an additional keyboard and monitor setup just for the pi.

 

image

 

You'll notice that in the terminal, I started out on my desktop, onyx, did

ssh -X pi@raspberrypi.home

 

Notice I typed the ssh command with the -X argument. This allows X11 information to be forwarded. There are security implications to this, but I leave the research of those up to the reader. For a home development network this is probably not an issue.

 

once logged in there, I simply typed

geany &

 

to start the geany program, and it displayed locally. The & means to run the program in the background, and to return control of the terminal to the user.

 

If you look at the title bar of the application, you can see that it says

 

Geany (on raspberrypi)

 

and I am able to open files on the raspberrypi in the geany editor, and display them locally. I can hit F9 to compile, and F5 to run, and the output displays on my screen, as if I were running locally.

This saves the step of editing locally and copying the files to the pi, or of logging into the pi and running a text based editor, such as vi or nano. All of the processing takes place on the pi. The compilation, the save, and the execution. Only the display is forwarded.

 

Realize this capability takes no (with the exception of the editor, geany, but any gui program will work)  additional software other than what comes with both a standard Ubuntu installation on my desktop, and raspian, as distributed, for the pi.

 

What about windows users?

 

Fortunately, you are in luck. There are packages available that will give you the same capability. One such program is MobaXterm, available at MobaXterm free Xserver and tabbed SSH client for Windows . There is a free Home Edition and paid for professional edition that each provide a terminal, an X Server, and other tools. This is one of several packages, but this is the one I have been using when I work from a windows system. I'm not going to cover setup and installation, it was a typical windows install. Once it is installed though, this is what you can expect:

 

image

 

This is a capability I have taken advantage of for years that I get the feeling people new to the Raspberry Pi and linux world are not aware of. This is a great way to take advantage of your existing hardware without having to setup vnc or any other type of screen sharing system. It allows you to only display the applications that you are using integrated seamlessly into your current desktop.

 

Bear in mind, there are configurations, network setups, etc..., that can cause this not to work as easily as I have demonstrated above, I would urge you to search google for the answers for issues you encounter if you decide to attempt this. This technology is 20+ years old, and there is a wealth of information for it already on the net.

 

If you were aware of this prior to this post and have something to add, please leave a comment, if this is new to you, I hope it helps.

 

BTW, this is not limited to the Raspberry PI, this works on odroids, beagle bones, and pretty much any of the SBCs running a variant of linux, It also works the other way as well, if you have a ras pi with a monitor and keyboard connected, you can login to another pi or unix machine on your network and do the same thing.

  • Sign in to reply

Top Comments

  • johnbeetem
    johnbeetem over 10 years ago +4
    One of the most confusing features of X Windows for newbies is the "client" and "server" terminology, which seems backwards. Normally, you run a client on your local machine and it talks to a server on…
  • johngriswold
    johngriswold over 8 years ago +4
    Well, I appear to be coming to this party late, but I needed just this solution for a development project at work. Slick - thank you!
  • Jan Cumps
    Jan Cumps over 6 years ago +4
    I use XWindow in this blog: BeagleBone - Show XWindow Graphic Apps on Windows Desktop . Hope I don't go to hell
Parents
  • phoenixcomm
    phoenixcomm over 6 years ago

    mconners

    Mike, I hate to be a nitpicker BUT! There is no S  in X-Window System(X-11)!

    Windows refers to an MS product that I would like to see die!

    Basically, (cuss me out if I got it wrong, but I haven't played with this for a LONG  time)

    X-11 uses the typical server-client model, but it's not what you think it's the other way around.  Enter the client-server model.

    Why did I say client then server? It is because the server is the Display Server on your computer! This is what does the presentation Layer.

    which forms the Root Window (or desktop). Children are placed on top of the Root Window in layers. The layer on top is what you see (opacity).

    enough said.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 6 years ago in reply to phoenixcomm

    "I hate to be a nitpicker BUT! There is no S  in X-Window System(X-11)!"

    There were no hyphens either from what I recall ? 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 6 years ago in reply to beacon_dave

    beacon_dave

    So right my foopah! I should get 20 lashes with the wet noodle.. LOL

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 6 years ago in reply to phoenixcomm

    Here the noodle. LOL. You can be off the wall funny.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 6 years ago in reply to clem57

    Thank you so much, I could not find mine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • phoenixcomm
    phoenixcomm over 6 years ago in reply to clem57

    Thank you so much, I could not find mine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube