Cygwin/X
From Wikipedia, the free encyclopedia
Cygwin/X is an implementation of the X Window System that runs under Microsoft Windows. It is part of the Cygwin project, and is installed using Cygwin's standard setup system. As with the rest of Cygwin, Cygwin/X is free software, licensed under the GPL.
Cygwin/X originally used XFree86, but now uses the X.Org Server, owing to concerns over XFree86's new license not being compatible with the GPL.
Recent releases of Cygwin/X added support for "rootless" operation, where the X root window is not displayed, and where X applications appear on the Windows desktop as fully-fledged toplevel applications. Before this feature was introduced, all X windows were confined to a single container window (in a manner similar to MDI subwindows).
Contents |
[edit] Before experiencing X
Cygwin/X is installed by selecting the necessary packages from the X11 category with the standard Cygwin installer. Users unfamiliar or unsure of what is needed should install all the components of the X11 category.
The Cygwin/X install should add /usr/X11R6/bin the PATH variable but users should verify this manually before proceeding with first usage.
[edit] Accessing X of your Local Cygwin
You are tired of the Windows platform and want to emulate the X Windows System on your Windows desktop? You can run the X server and the Window Manager locally and get the X Windows GUI environment.
There are various ways you can do it.
[edit] MultiWindow Mode
In the multiwindow mode, there is an internal window manager that creates a Windows window to display the X application on the Windows desktop.
[edit] X
X is a soft-link (shortcut from Windows standpoint) to /usr/X11R6/bin/XWin.
- Start Cygwin (The Bash shell comes up)
- Execute the command, X -multiwindow &. (Cygwin/X window comes up)
- Execute the command, export DISPLAY=127.0.0.1:0.0
- Execute the command, xclock &, xclock &. (xclock comes up).
Now any X application can be run. They open up in separate windows individually with their own windows title-bar, caption buttons and border. In this case, the desktop environment is not available.
[edit] startxwin.bat
- Run startxwin.bat from usr\X11R6\bin\ folder where your Cygwin is installed. This can be done by double clicking on the batch file. It will bring up an xterm window. If you don't want to go through the hassle of finding this file, you can simply run the startxwin-multiwindow.bat file which should be present on your desktop. Both the scripts are very similar.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
[edit] startxwin.sh
- Start Cygwin (The Bash shell comes up)
- Execute the command, startxwin.sh &. It'll bring up an xterm window.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
[edit] startx
- Start Cygwin (The Bash shell comes up)
- Execute the command, startx &. It'll bring up an xterm window.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
[edit] External Local Window Manager
If you want the complete desktop environment, you will have to run a window manager or Linux desktop to send the GUI to your X server. This section is a discussion on this topic.
[edit] X
X is a soft-link (shortcut from Windows standpoint) to /usr/X11R6/bin/XWin.
- Start Cygwin (The Bash shell comes up)
- Execute the command, X &. (Cygwin/X window comes up)
- Execute the command, export DISPLAY=127.0.0.1:0.0
- Execute the command, wmaker &
- Check your Cygwin/X window. You have got the desktop. :-)
[edit] Accessing X of a Remote Box
In the following discussion the following IP addresses and user name have been assumed:-
- remote_box - IP Address or domain name of remote box
- my_system - IP Address or domain name of your Windows system
- user_name - A valid account in the remote box
[edit] X11 Forwarding
For some of the methods described in this section, X Forwarding should be enabled in the remote box. Whether this is enabled or not can be found out from the file, /etc/ssh/sshd_config of the remote box.
If there is a line X11Forwarding yes, it means X11 Forwarding is enabled and you can go ahead with the above steps.
If it is, X11Forwarding no, X11 Forwarding is disabled. You can edit it to enable it. Of course this can be done by the "root" only. If you need X11 Forwarding enabled and you are not the "root" of the box, you'll have to talk to its admin.
[edit] MultiWindow Mode
In the multiwindow mode, there is an internal window manager that creates a Windows window to display the X application on your Windows desktop.
[edit] X
X is a soft-link (shortcut from Windows standpoint) to /usr/X11R6/bin/XWin directory.
- Start Cygwin (The Bash shell comes up)
- Execute the command, X -multiwindow &. (Cygwin/X window comes up)
- Execute the command, export DISPLAY=127.0.0.1:0.0
- Log in to the remote box with the command, ssh -X user_name@remote_box
- Execute the command, xclock &. (xclock comes up).
Now you can run any X application on the remote box. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
For the above method to work, X11 Forwarding should be enabled in the remote box.
[edit] startxwin.bat
- Run startxwin.bat from usr\X11R6\bin\ folder where your Cygwin is installed. This can be done by double clicking on the batch file. It'll bring up an xterm window. If you don't want to go through the hassle of finding this file, you can simply run the startxwin-multiwindow.bat file which should be present on your desktop. Both the scripts are exactly similar.
- Execute the command, xhost remote_box to provide remote box access to the X server running on your Cygwin. Alternatively you can execute the command, xhost + to disable access control completely, so that any client can connect to your X server.
- Log in to the remote box with the command, ssh -X user_name@remote_box
- Execute the command, export DISPLAY=my_system:0.0 on the remote box.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application on the remote box. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
If X11 Forwarding is enabled in the remote box, you can omit step 2 and step 4.
[edit] startxwin.sh
- Start Cygwin (The Bash shell comes up)
- Execute the command, startxwin.sh &. It'll bring up an xterm window.
- Execute the command, xhost remote_box to provide remote box access to the X server running on your Cygwin. Alternatively you can execute the command, xhost + to disable access control completely, so that any client can connect to your X server.
- Log in to the remote box with the command, ssh -X user_name@remote_box
- Execute the command, export DISPLAY=my_system:0.0 on the remote box.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application on the remote box. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
If X11 Forwarding is enabled in the remote box, you can omit step 3 and step 4.
[edit] startx
- Start Cygwin (The Bash shell comes up)
- Execute the command, startx &. It'll bring up an xterm window.
- Execute the command, xhost remote_box to provide remote box access to the X server running on your Cygwin. Alternatively you can execute the command, xhost + to disable access control completely, so that any client can connect to your X server.
- Log in to the remote box with the command, ssh -X user_name@remote_box
- Execute the command, export DISPLAY=my_system:0.0 on the remote box.
- Execute the command, xclock & in the xterm window. (xclock comes up).
Now you can run any X application on the remote box. They open up in separate windows individually with your windows title-bar, caption buttons and border. You don't get the desktop environment in this case.
If X11 Forwarding is enabled in the remote box, you can omit step 3 and step 4.
[edit] PuTTY
- Open PuTTY
- From the Category tree, select "Session" and enter the host details.
- From the Category tree, select "Connection > SSH > X11" and check the "Enable X11 Forwarding" checkbox.
- Click "Open" and login.
- Run an X Server on your Windows machine. There are various ways to do it.
- Open Cygwin and run X -multiwindow &.
- Run startxwin.bat from Windows or open Cygwin and run startx, startxwin.sh. An extra xterm opens which might be a pain since you don't need it. (The previous two steps save you from that).
- Get back to your PuTTY window and execute the command, xclock & (xclock comes up).
- Check your Cygwin/X window. (You have got the desktop :-))
For this method to work X11 Forwarding should be enabled in the remote box and you should be logging into the remote box using the SSH protocol.
If you want to save yourself from the first four steps, simply add the path of the PuTTY directory to the Windows PATH variable or you can simply put PuTTY.exe in the Windows directory. Henceforth, you can simply execute the command, putty -X user_name@remote_host from anywhere and then proceed with step 5.
[edit] External Remote Window Manager
If you want the complete desktop environment of a remote box, you will have to run a window manager or Linux desktop on the remote box and forward the X output to the X server of your Windows PC so that you can see the GUI on your X server. This section is a discussion on how this can be done.
[edit] X
X is a soft-link (shortcut from Windows standpoint) to /usr/X11R6/bin/XWin directory.
- Start Cygwin (The Bash shell comes up)
- Execute the command, X &. (Cygwin/X window comes up)
- Execute the command, export DISPLAY=127.0.0.1:0.0
- Log in to the remote box with the command, ssh -X user_name@remote_box
- Execute the command, wmaker & on the box.
- Check your Cygwin/X window. You have got the desktop of the remote box. :-)
For the above method to work, X11 Forwarding should be enabled in the remote box.
[edit] PuTTY
- Open PuTTY
- From the Category tree, select "Session" and enter the host details.
- From the Category tree, select "Connection > SSH > X11" and check the "Enable X11 Forwarding" checkbox
- Click "Open" and login.
- Execute the command, X &, to run the Cygwin X server on your Windows system.
- Get back to your PuTTY window and run wmaker &.
- Check your Cygwin/X window. (You have got the desktop :-))
For this method to work X11 Forwarding should be enabled in the remote box and you should be logging into the remote box using the SSH protocol.
If you want to save yourself from the first four steps, simply add the path of the PuTTY folder to the Windows PATH variable for once and ever. Henceforth, you can simply execute the command, putty -X user_name@remote_host from anywhere and then proceed with step 5.
[edit] See also
[edit] External links
- Project home page
- XWinLogon - A Free X-Server based on Cygwin
- Installing Cygwin/X (official page)
- Displaying Remote Clients (Secure SSH and Unsecure Telnet) with Cygwin/X (official page)
- Cygwin/X Tutorial from UBiC
- How to Install Cygwin/X and use Secure SSH at RIT
- Cygwin: Changing the Face of Windows
- Xming: a compact X server for Windows
- http://x.cygwin.com/docs/ug/ (Cygwin/X User's Guide - Same document is availabe in HTML, PDF, PS, RTF, TXT formats there)
- http://facilities.cs.utexas.edu/htdoc/faqs/xwindows.html (Nice set of FAQs)
- http://xwinman.org/ (Descriptions of various Window Managers for X and Linux/Unix Desktops)