After my little Raspberry PI Mono installation accident, that fucked up everything with Mono, I decided to reinstall Raspbian Wheezy. I know a lot of people that love touchy and clicky interfaces, the tablet market rise reflect this. I personally use my RPi through command line, SSH it over LAN, because I one Desktop environment (my Windows machine) is more than enough for me.
But after a couple mails with a friend trying to view his PI’s lxsession on his Windows machine and explaining him my setup using Cygwin only, he told me there’s no tutorial on this. Nothing new or super cool, just another way.
This guide should work ok with any linux environment, not only RPIs, provide you properly set ssh configurations.
The first thing to do is downloading Cygwin installer, be sure to add xorg, xint and openssh packages while installing. There may be some other needed packages, if you get somenthing like a “command not found”, you have to add that package too.
Now open a Cygwin shell with its nice desktop shortcut and type:
cygstart tells Cygwin to run a command and give you back your shell control. Removes the need for two shells (one for launching the Xserver and one for SSH connection). It can be omitted.
xwin Launches the XWin application, which is our Xserver
This is usually enough, but as default setting, xwins create a window big as my current resolution. I prefer using this command:
cygstart xwin -screen 0 1440x900@1 -wgl
-screen 0 1440×900@1 tell xwin to create the remote screen window number 0, with a resolution of 1440×900 at monitor 1. Use this parameter as this, modifying only the resolution part. See Note 1 for better explanation.
-wgl will enable OpenGL accelerated graphics on the remote screen window. It is not mandatory and if not enabled the remote screen window will use software rendering.
After that we must make sure that Cywin is aware of this remote display, it can be done by setting and exporting the environment variable DISPLAY.
The newly created window will have name like: Cygwin/X:0.0, make sure to set this variable to whatever is written after the X, like
Now, using Cygwin, SSH to your PI
ssh -Y pi@address
and after logon, start you windows manager:
This should show your Raspberry PI desktop inside your XWin window.
If you want to do all of this stuff at cygwin’s startup, just add the lines
cygstart xwin #+your parameters
at the end of cygwin\home\user\.bashrc.
See XWin manual for possible parameters.
-screen 0 1440×900@1 explanation:
0 Create windows number 0. It’s like an ID to identify which windows is this. If you want to use multiple remote screens, for each new screen you have to increment this value by one.
1440×900 Is pretty self explanatory. Sets the PI’s max resolution to this size.
@1 Tell XWin on which (real) monitor you want the window to appear. So in case of a multiple monitor setup 1 is the main monitor, while 2, 3, 4, …, are the other monitors. If you have a single monitor this value is always 1.