# Cygwin/X Frequently Asked Questions

## 2016-08-30 17:09

# Questions and Answers

1. General Information
  1.1. What is Cygwin/X?
  1.2. What is Cygwin?
  1.3. What is the X Window System?
  1.4. What is an X Server?
  1.5. What is an X client?
  1.6. What does DISPLAY=:0.0 mean?
  1.7. Why port the X Window System to Microsoft Windows?
  1.8. Is there a Cygwin/X newsgroup?
  1.9. Is there a Cygwin/X mailing list?
2. Installation
  2.1. What versions of Windows does Cygwin/X run on?
  2.2. How is Cygwin/X installed?
  2.3. Fatal server error: Can't read lock file /tmp/.X0-lock
  2.4. Nothing appears to happen when I try to start the X server using the "XWin Server" start menu shortcut.
3. Upgrade
  3.1. What happened to my X server? Where did `/usr/X11R6/` go?
  3.2. I upgraded my X server and now I can't type anything into any X application
  3.3. I can't find startxwin.bat or startxwin.exe to start the X server
  3.4. Moved question
  3.5. My favourite font has gone! The font Emacs uses is just boxes
  3.6. Where has xhost/xlsfonts/etc. gone?
  3.7. How do I get rid of that menu at the top of my xterm?
  3.8. ssh -X now says "Warning: untrusted X11 forwarding setup failed: xauth key data not generated"
  3.9. nedit fails to start with an error message
  3.10. I start my X server with startx or xinit and now all my X windows are contained within one large root Windows window? How do I get it back to each X window in it's own Windows window?
  3.11. Moved question
  3.12. I upgraded and now X exits immediately after starting
  3.13. I upgraded and now X clients can't connect
4. Configuration
  4.1. Is there an xorg.conf or XF86Config file?
  4.2. What are the command line options for `X`? How do I add command line options for `X`?
  4.3. Why does `X` ignore the display depth that I pass on the command line?
  4.4. I have a two button mouse, can I emulate a three button mouse?
  4.5. Is there a Focus-Follows-Mouse feature (Auto-Focus)?
  4.6. The option -nounixkill has no effect. How can i prevent the server shutdown an Ctrl-Alt-BackSpace?
  4.7. I have a multihead system. Do I need special options to make it work? I have a multihead system. Why are my X-application windows white?
  4.8. I have a firewall. Is there anything I have to take care of?
5. Internationalization
  5.1. Keyboard support
    5.1.1. How do I use a non-U.S. keyboard layout?
    5.1.2. Is there a way to add a layout to the list of autodetected layouts?
    5.1.3. Where can I find an xmodmap for my non-U.S. keyboard layout?
    5.1.4. How do I get my non-U.S. keyboard modmap to be installed when using xdmcp?
    5.1.5. Logging into AIX via XDMCP causes the keyboard to function as if AltGr is permanently pressed.
    5.1.6. Loading an XKB keyboard layout selected with -xkblayout fails
    5.1.7. I have Windows XP with Powertoys installed and AltGr does not work. What can I do?
    5.1.8. AltGr does not work properly when connecting to various older commercial unices (e.g. HP-UX, AIX) or to old XFree86.
  5.2. Display problems
    5.2.1. How do I get bash to display accents and/or umlauts?
    5.2.2. How do I put bash into "8 bit" mode?
    5.2.3. How do I display unicode characters in an xterm?
6. Remote connections
  6.1. X11Forwarding does not work with OpenSSH under Cygwin
  6.2. Why do remote programs crash with an X Error of failed request: BadAtom? Why do remote programs exit when you try to copy and paste?
  6.3. I'm confused about the difference between trusted and untrusted X11 forwarding. What does "Warning: untrusted X11 forwarding setup failed: xauth key data not generated" mean? Why is the SECURITY extension disabled?
  6.4. What does "Warning: no xauth data; using fake authentication data for X11 forwarding" mean?
  6.5. Why can't new remote X clients connect to the X server after 20 minutes?
  6.6. Remote clients can't connect
  6.7. X sessions forwarded by PuTTY can't connect. Non-cygwin local X clients can't connect.
7. XDMCP connections
  7.1. XDMCP fatal error: Session declined No valid address
  7.2. Why does Cygwin/X report AUDIT: client 1 rejected from IP `remotehost`?
  7.3. I get no login screen when using `-query`
  7.4. XDMCP does not work with Mandrake 8.1
  7.5. Why does GDM not work with `-clipboard`
  7.6. I get no login screen for Solaris
  7.7. XDMCP freezes with remote Solaris machine!
  7.8. Login to CDE on Solaris via XDMCP hangs Cygwin/X.
  7.9. Where can I find more information about XDMCP.
8. Troubleshooting
  8.1. Cygwin/X failed with "Fatal Error". What does this mean?
  8.2. Is there a log file that I can look at for diagnostic information and error messages?
  8.3. I have a specific error message, what does it mean?
  8.4. I have a specific error message that is not addressed in the Error and Warning Messages section.
  8.5. My bug report the Cygwin/X mailing list was ignored. What do I do now?
  8.6. Why does Cygwin/X freeze right after startup?
  8.7. Cygwin/X has very poor performance. What's the reason?
  8.8. I have Microsoft Services for Unix installed and can't type anything. Help me!!!
  8.9. Cygwin/X is extremely slow, especially when using XDMCP to connect to remote machines.
  8.10. Simulated mouse wheel scrolling doesn't work with a TrackPoint mouse (found on IBM laptops) or Synaptics Touchpads
  8.11. Why is the root window not shown in normal mode?
  8.12. Why is the cross the default cursor in multiwindow mode?
  8.13. How can I adjust the linewidth in bash after resizing XTerm?
  8.14. Why do some menus not work if Num-Lock is on?
9. Error and Warning Messages
  9.1. _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
  9.2. error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
  9.3. Duplicate invocation on display number: 0. Exiting.
  9.4. Fatal server error: could not open default font 'fixed'
  9.5. Could not init font path element /usr/share/fonts/`*`/, removing from list!
  9.6. The procedure entry point _check_for_executable could not be located
  9.7. cygX11-6.dll not found after installation or upgrade
  9.8. Exception: STATUS_ACCESS_VIOLATION
  9.9. Xlib: connection to "`local_host_name_or_ip_address`:0.0" refused by server Xlib: Maximum number of clients reached
  9.10. XIO: fatal IO error 104 (Connection reset by peer) on X server "127.0.0.1:0.0"
  9.11. Cannot Open Display: 127.0.0.1:0.0
  9.12. Out of environment space
  9.13. Too many parameters
  9.14. "xcb_xlib_lock: Assertion '!c->xlib.lock' failed." or "xcb_xlib_unlock: Assertion 'c->xlib.lock' failed."
  9.15. Fatal server error: Failed to activate core devices.
  9.16. "fatal error - unable to remap (some dll) to same address as parent: (some hex number) != (some other hex number)" or "(some dll): Loaded to different address: parent(some hex number) != child(some other hex number)"
  9.17. fork: child -1 - died waiting for longjmp before initialization, retry (some number), exit code (some hex number), errno (some other number)
10. Porting Software
  10.1. Is there a list of software that has been ported to Cygwin/X?
  10.2. How do I start porting software to Cygwin/X?
  10.3. Are there common problems encountered when porting software to Cygwin/X?
  10.4. Problems linking OpenGL applications? Undefined reference to _glsomething?
11. Contributing
  11.1. Are there step-by-step instructions for contributing to Cygwin/X?
  11.2. Are there editors for Windows that understand and preserve UNIX end of line characters?
  11.3. How should I generate patches for Cygwin/X?
  11.4. Where do I submit patches for Cygwin/X?
  11.5. Why doesn't the X Window System use GNU's autoconf?
  11.6. What compiler does Cygwin/X use, and which compilers are supported?
  11.7. Is cross-compiling from a non-Cygwin platform supported?
  11.8. Where can I get help for installing DocBook on Cygwin?
12. Licenses, Patents, Trademarks, and Copyrights
  12.1. What licenses apply to Cygwin/X source code?
  12.2. What licenses apply to the X Window System source code?
  12.3. What license applies to Cygwin source code?
  12.4. Who holds the copyright on the Cygwin/X source code?
  12.5. Who holds the copyright on the X Window System source code?
  12.6. Who holds the copyright on the Cygwin source code?
  12.7. What license applies to Motif?
  12.8. Isn't "XWin" trademarked by StarNet Communications?

### 1. General Information

1.1. What is Cygwin/X?

Cygwin/X is a port of the X Window System to Cygwin. Cygwin provides a UNIX-like API on the Win32 platform.

1.2. What is Cygwin?

Cygwin tools are, in the words of the Cygwin FAQ, " ports of the popular GNU development tools and utilities for Microsoft Windows. They run thanks to the Cygwin library which provides the POSIX system calls and environment these programs expect. " Cygwin provides the compiler (gcc), libraries, headers, and other utilities which build and support the operation of Cygwin/X.

1.3. What is the X Window System?

[ScheiflerGettys92]

The X Window System, or X, is a network-transparent window system. With X, multiple applications can run simultaneously in windows, generating text and graphics in monochrome or color on a bitmap display. Network transparency means that application programs can run on machines scattered through the network.

1.4. What is an X Server?

An X Server is a program that provides display and user input services to other programs. In comparison, a file server provides other programs with access to file storage devices. File servers are typically located in a remote location and you use the services of a file server from the machine that you are located at. In contrast, an X Server is typically running on the machine that you are located at; display and user input services may be requested by programs running on your machine, as well as by programs running on remote machines.

1.5. What is an X client?

An X client is a program that utilizes the display and user input services provided by an X Server. X clients may run on the same or disparate machine as the X Server that is providing display and user input services.

1.6. What does DISPLAY=:0.0 mean?

The `DISPLAY` environment variable instructs an X client which X server it is to connect to by default. Typically this can be overriden by running the client with a `-display` or `-d` command line option.

The `:0.0` part of the `DISPLAY` variable denote the display and the screen of an X server.

The display is the first number and should equal the display number given to a running instance of an X server. By default the X server uses display number 0. If the X server is using TCP/IP for communication it listens on port 6000 + `display-number` for X client connections. For local (UNIX domain sockets) it uses the socket `/tmp/.X11-unix/X`display-number``

The screen denotes different output devices of the X server. You could start `X` with two `-screen` options and would end up with two X11 windows. Each of them is a different screen. Other X servers open different screens for different monitors connected to the computer.

Cygwin/X supports different formats of the `DISPLAY` variable

- `:0.0` or `unix:0.0`

  This names a local X server and the communication uses the UNIX domain sockets.

- `hostname:0.0`

  This names a remote X server and the communication uses the TCP/IP network.

See the DISPLAY NAMES section of man X for more information.

1.7. Why port the X Window System to Microsoft Windows?

Porting X Window System to Microsoft Windows benefits many people and projects in many ways:

- Prior to Cygwin/X only commercial, closed source X Servers were available for Microsoft Windows.

- An X Server on Windows may be used to display the output of programs running on remote UNIX machines.

- Cygwin/X, in conjunction with Cygwin, provides a complete compatibility layer for compiling and running UNIX applications on Microsoft Windows.

1.8. Is there a Cygwin/X newsgroup?

No, Cygwin/X does not have a newsgroup; however, we do have a mailing list. See Q: 1.9.

You can read and post to the mailing list using your newsreader using the GMANE mail-to-news gateway.

1.9. Is there a Cygwin/X mailing list?

Yes, Cygwin/X is on-topic for the cygwin@cygwin.com mailing list. Non-subscribers may post to this list. Visit the Cygwin Mailing Lists page to subscribe to cygwin@cygwin.com as well as to read and search an online archive of the mailing list traffic.

### 2. Installation

2.1. What versions of Windows does Cygwin/X run on?

Cygwin/X aims to support all versions of Windows supported by Cygwin.

However, Cygwin/X is not tested on older versions of Windows (i.e. Windows NT4, Windows 2000) and may be broken. Problem reports are welcomed.

Cygwin/X requires Cygwin to compile and run. Cygwin is not, as of writing, available on Microsoft Windows CE, therefore Cygwin/X is not currently available on Microsoft Windows CE.

2.2. How is Cygwin/X installed?

The Cygwin/X User's Guide thoroughly documents the installation process. Installation is performed through Cygwin's setup program.

2.3. Fatal server error: Can't read lock file /tmp/.X0-lock

This question should be obsolete.

A1: /tmp resides on a FAT filesystem

Start the server with the `-nolock` option. See Q: 4.2.

You should really consider updating the filesystem to NTFS using Microsoft's convert.exe tool.

A2: /tmp resides on a NTFS filesystem.

This can be caused by a stale lock file being left behind after the X server is run by a user with Adminstrator rights, which cannot be overwritten when the X server is next run by a user without Adminstrator rights.

Failure to clean up the lock file properly is a bug in the X server, but until that is fixed the following workarounds may be neccessary.

1. Try removing the stale lock file using rm -f /tmp/.X`n`-lock where `n` is the display number. If this fails due to insufficent permissions, you must either get the owner or a user with Adminstrator rights to remove the stale lock file.

2. Try starting the server with the `-nolock` option. (See Q: 4.2.)

Technical details: The X server attempts to create a lock file in `/tmp` by creating the file under a temporary name, then renaming it to the proper name (by hard linking it under the correct name, then unlinking it from the temporary name). If this rename fails it attempts to read the existing lock file to determine the pid of an already running server. The FAT filesystem does not support hardlinks so this operation cannot succeed. On NFTS filesystems, the failure case appears to be that lock file was created successfully, but the rename failed due to a stale lock file created by a user with Adminstrator rights.

2.4. Nothing appears to happen when I try to start the X server using the "XWin Server" start menu shortcut.

A1:

This answer should be obsolete.

Task manager shows the startxwin.exe process starting, spawning XWin.exe and xterm.exe, but no windows are shown. Running startxwin.exe from a bash shell works correctly. This is caused by having `tty` in the `CYGWIN` environment variable set through the Windows control panel. Removing `tty` resolves this issue.

If you really need `CYGWIN=tty` for working with cmd.exe windows, you'll have to arrange to set that by some other means before invoking cygwin.bat.

A2:

Try running startxwin from a bash shell in the mintty terminal emulator, it should output some error message which should indicate why it's not able to start.

> Note: For technical reasons, the output of XWin doesn't appear in cmd.exe windows unless the `CYGWIN` environment variable set through the Windows control panel contains `tty`, so to ensure the output can be seen, use mintty.

### 3. Upgrade

3.1. What happened to my X server? Where did `/usr/X11R6/` go?

The upgrade from X.Org R6.8 to modular X.Org R7.4 made a lot of changes. Please read the announce email and pay attention to the upgrade instructions

3.2. I upgraded my X server and now I can't type anything into any X application

This question should be obsolete.

Launch the X server via the shortcut under "Cygwin-X" on the start menu.

Technical details: The startxwin.bat script used to set several enviroment variables used by the X server to specify the location of files it needs to access. Specifically this batch file would set `XKEYSYMDB` to `/usr/X11R6/lib/X11/XKeysymDB`. This file was moved to `/usr/share/X11/XKeysymDB`. The keyboard won't work if `XKEYSYMDB` points to a non-existent file.

If you are (perhaps unintentionally) using a copy of the old startxwin.bat (perhaps under another name) to start the X server, remove the environment variables `XAPPLRESDIR`, `XCMSDB`, `XNLSPATH` and `XKEYSYMDB` from it, or (preferrably) use the updated startxwin.

If echo $XKEYSYMDB outputs something, you have something else setting `XKEYSYMDB` in your environment. Find it and remove it.

These variables were always being set to the defaults, so they can simply be removed. See Q: 8.8. for the reason why you might need to set them.

3.3. I can't find startxwin.bat or startxwin.exe to start the X server

The executable startxwin.exe previously used to start the X server has been retired and replaced with a shell script startxwin.

The MS-DOS batch file startxwin.bat previously used to start the X server has been retired, as implementing this as a batch file made it difficult to reliably wait until the the X server had started before starting any clients.

X.Org now uses the prefix `/usr` not `/usr/X11R6`. So startxwin.bat was moved from `/usr/X11R6/bin/startxwin.bat` to `/usr/bin/startxwin.bat`.

A "XWin Server" shortcut to startxwin is created on the Start menu, under "Cygwin-X"

startxwin and the Start menu link to it are now installed by the `xinit` package.

3.4. Moved question

3.5. My favourite font has gone! The font Emacs uses is just boxes

Only minimal fonts will be installed after the upgrade from X.Org R6.8 to modular X.Org.

Font packages are now named `font-<author/class>-<fonttype>`

Some packages dependencies have not yet been updated for the fonts they require, so you may need to manually install the needed fonts. For example, to provide the font emacs wants to use by default you will probably want to install `font-adobe-dpi75` (or `font-adobe-dpi100` if you like large fonts). This package provides the `courier`, `helvetica`, `new century schoolbook` and `times` font families.

The `lucida` font family is provided by the package `font-bh-dpi75` (or `font-bh-dpi100`). The monospaced version, `lucida typewriter` is provided by the package `font-bh-lucidatypewriter-dpi75` (or `font-bh-lucidatypewriter-dpi100`).

Note that after installing fonts you will need to restart the X server or run xset fp default; xset fp rehash to make the new fonts available

3.6. Where has xhost/xlsfonts/etc. gone?

Previously all the X utility programs were contained in a single package, `xorg-x11-bin`, which needed to be updated when any of the programs it contained was updated. In modular X each of these programs can be found in a separate package, usually named xhost/xlsfont/etc.

3.7. How do I get rid of that menu at the top of my xterm?

Run it as xterm +tb, or add `XTerm*toolBar: false` to `~/.Xresources`

3.8. ssh -X now says "Warning: untrusted X11 forwarding setup failed: xauth key data not generated"

See Q: 6.1. and following. See point 3 in this mail. Use ssh -Y.

Technical details: ssh tried to run xauth generate to create a untrusted cookie for the session, which failed because the server isn't compiled with the XCSECURITY extension built-in. Since OpenSSH 7.2p1, ssh does not fallback to trusted forwarding, so no X11 forwarding is setup.

3.9. nedit fails to start with an error message

This question should be obsolete.

    $ nedit
    X Error of failed request:  BadMatch (invalid parameter attributes)
      Major opcode of failed request:  70 (X_PolyFillRectangle)
      Serial number of failed request:  some number
      Current serial number in output stream:  some other number

nedit needs rebuilding with a patch to work around an issue `lesstif` has with current X servers.

Until this happemns, you can work around the issue by adding `XLIB_SKIP_ARGB_VISUALS` to your enviroment, e.g.

    $ export XLIB_SKIP_ARGB_VISUALS=1
    $ nedit

3.10. I start my X server with startx or xinit and now all my X windows are contained within one large root Windows window? How do I get it back to each X window in it's own Windows window?

This is a deliberate change from Cygwin/X X11 R6.9 behaviour.

1. Start the X server using the "XWin Server" shortcut under "Cygwin-X" on the Start menu, or using startxwin.

   Note: If you wish to customize the X clients started when the X server starts, you can do so using a `~/.startxwinrc` script.

2. Alternatively, add the server option `-multiwindow` to your xinit or startx invocation, i.e. xinit -- -multiwindow or startx -- -multiwindow

3. Alternatively, put XWin -multiwindow into `~/.xserverrc` or `/etc/X11/xinit/xserverrc`

3.11. Moved question

3.12. I upgraded and now X exits immediately after starting

Since `xinit-1.3.4-1`, startxwin is now implemented by a script based on startx. Unfortunately, this has changed the behaviour in a backwards-incompatible way, as the X server is now killed when `~/.startxwinrc` exits.

If you have an empty `~/.startxwinrc`, you should change it to contain exec sleep infinity so the X server will not exit until explicitly told to do so.

If you are using a custom `~/.startxwinrc`, either run the last client in the foreground (i.e. without &), so the X server exits when that client exits, or use exec sleep infinity as described above.

You should also make sure that `~/.startxwinrc` is executable (e.g. chmod +x ~/.startxwinrc).

See the announce mail for more details.

3.13. I upgraded and now X clients can't connect

A1:

Since X server 1.17, by default the server does not listen for TCP/IP connections, only accepting local connections on a unix domain socket.

For local clients, use DISPLAY=:0.0, rather than DISPLAY=localhost:0.0, DISPLAY=127.0.0.1:0.0, DISPLAY=::1:0.0, etc. See Q: 1.6..

A2:

For remote clients, rather than connecting over TCP/IP by explicitly setting `DISPLAY` and allowing access using xhost or by disabling access control, use ssh tunnelling with ssh -Y instead. (See the User's Guide section on X forwarding using ssh for more details).

A3:

Use the `-listen tcp` option to restore the previous behaviour, allowing the X server to open a TCP/IP socket as well e.g. startxwin -- -listen tcp. See Q: 4.2..

### 4. Configuration

4.1. Is there an xorg.conf or XF86Config file?

No. Options which are configurable are available as command line options. For example, for more information on configuring other keyboard layouts using command line options, see Q: 5.1.1.

4.2. What are the command line options for `X`? How do I add command line options for `X`?

The Cygwin/X User's Guide and man XWin document the command line options for X.

To supply a command line option to `X`:

- If you use the start menu shortcut to start the X server, you will need to amend it's target to add an option, e.g. C:\cygwin\bin\run.exe --quote /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock"

  > Note: Note well that the entire command after `-c` is quoted

  > Note: Note that this start menu shortcut is created by the `xinit` package, and your changes will be overwritten when the `xinit` package is updated.

  > Note: Note that X server options to startxwin are preceded by `--`.

- If you use startxwin, xinit or startx to start the server, run it as e.g. startxwin -- -nolock, xinit -- -nolock or startx -- -nolock

- If you use `startxwin.bat` or `startxwin.sh` to start the server, add e.g. `-nolock` to the XWin line in that script.

4.3. Why does `X` ignore the display depth that I pass on the command line?

When running in windowed mode or GDI-based fullscreen mode, `X` must run the X Server at whatever display depth Windows is currently using; in these cases the display depth passed on the command line is ignored. `X` only uses the display depth parameter when running in a DirectDraw-based fullscreen mode, as DirectDraw allows applications to change the display resolution and depth when running in fullscreen mode.

4.4. I have a two button mouse, can I emulate a three button mouse?

Yes. Pass the `-emulate3buttons `timeout_in_milliseconds`` parameter to `X`, where `timeout_in_milliseconds` is the, optional, maximum number of milliseconds between a button release and opposite button press that will trigger an emulated third button press.

4.5. Is there a Focus-Follows-Mouse feature (Auto-Focus)?

This is a setting of the window manager used. The default window manager twm has no such feature. But with fvwm2 this can be achieved with the this configuration entry:

    Focus FocusFollowsMouse

Other window managers (eg. windowmaker) have similar features too.

If you are using the `-multiwindow` mode you can not set this behaviour in the window manager but you can use the TweakUI tool to enable this feature for all windows, not limited to Cygwin/X windows.

4.6. The option -nounixkill has no effect. How can i prevent the server shutdown an Ctrl-Alt-BackSpace?

This question should be obsolete as the TerminateServer keybinding is no longer present by default.

The TerminateServer keybinding can be enabled with

    setxkbmap -option terminate:ctrl_alt_bksp

4.7. I have a multihead system. Do I need special options to make it work? I have a multihead system. Why are my X-application windows white?

You should start `X` with the `-multiplemonitors` option.

Note that this option is enabled by default in `-multiwindow` mode.

4.8. I have a firewall. Is there anything I have to take care of?

`X` uses port 6000/TCP when the option `-listen tcp` is used. You will have to allow incoming and outgoing traffic on this port even if you are only using local clients. `X` has a builtin access control so you won't have to worry about opening the port. If you are still concerned about security, you may limit the allowed hosts to the local IP addresses.

If you use a different display number check section Q: 1.6. for details about which ports are used. For additional information about firewalls and XDMCP connections check Q: 7.3..

### 5. Internationalization

#### 5.1. Keyboard support

5.1.1. How do I use a non-U.S. keyboard layout?

Some keyboard layouts are autodetected from the Windows keyboard settings. For these layouts no special change is needed. For all other layouts there is the possibility to configure the layout via commandline options.

The main option for changing the layout is `-xkblayout `countrycode`` where `countrycode` is in most cases the 2 character code which also represents the country in internet adresses (e.g. Australia = au, Deutschland = de, France = fr, Japan = jp)

Other options for tweaking the XKB layout are `-xkbmodel`,`-xkbvariant`, `-xkboptions` and `-xkbrules`. These are the counterparts for the similar named options known from the xorg.conf file.

If the loading fails, check Q: 5.1.6.

5.1.2. Is there a way to add a layout to the list of autodetected layouts?

If your keyboard layout is not automatically detected you can send the required information for including it into Cygwin/X to cygwin@cygwin.com. Please include the following information in your mail:

- The windows keyboard layout code and the layout name

  You will find it in `/var/log/xwin/XWin.0.log` in lines similar to these:

      (--) winConfigKeyboard - Layout: "00001809" (00001809)
      (EE) Keyboardlayout "Irish" (00001809) is unknown

- The XKB layout code for this layout if you know it. Please experiment with setxkbmap or `-xkblayout` (as described in Q: 5.1.1.) to find an XKB layout code which works for you, otherwise the maintainers will have to guess it.

- A description how the layout looks like. This makes it easy to identify the matching XKB layout code. Many layouts are available from the Microsoft Global Dev website (It seems that website only works with some browsers). Just add a link to your layout.

5.1.3. Where can I find an xmodmap for my non-U.S. keyboard layout?

This question should be obsolete The package `xkeyboard-config` should contain just about any needed layout

Or, you can use xkeycaps to automatically generate a modmap for one of over 208 different layouts. See the xkeycaps home page to download and for more information.

5.1.4. How do I get my non-U.S. keyboard modmap to be installed when using xdmcp?

See Q: 5.1.1.

5.1.5. Logging into AIX via XDMCP causes the keyboard to function as if AltGr is permanently pressed.

[paraphrased from the Xming FAQ] AIX login scripts contain a call to xmodmap (for IBM keyboards) which causes the keyboard to be incorrectly configured for XWin. Commenting out those calls should allow you to use XWin with AIX.

The XKB extension is now always enabled in the X.Org xserver, so the previous answer to this question of disabling the XKB extension with the `-kb` parameter is no longer applicable.

5.1.6. Loading an XKB keyboard layout selected with -xkblayout fails

Not all keyboard layouts are tested very well and some contain errors or do not work at all. To test if the compiling of your layout works start

    setxkbmap de -print | xkbcomp -w3 -xkm - :0.0

(replace the "de" with your layout code). This may produce warnings, but must not produce errors. If there are errors then please report them to the mailing list.

5.1.7. I have Windows XP with Powertoys installed and AltGr does not work. What can I do?

This question should be obsolete.

5.1.8. AltGr does not work properly when connecting to various older commercial unices (e.g. HP-UX, AIX) or to old XFree86.

`xkeyboard-config` XKB keyboard layouts generally have AltGr mapped as ISO_Level3_Shift to access additional characters on non-english keyboards. For reasons unknown to us, this is incompatible with some older X11 releases. We don't have access to such a machine, so we are unable to track this down and find a reason.

It has been reported that sometimes it helps to run

    DISPLAY=:0.0 setxkbmap languagecode

from a cygwin shell after connecting.

See this mailing list thread for more discussion and a possible workaround.

#### 5.2. Display problems

5.2.1. How do I get bash to display accents and/or umlauts?

(Heinz Peter Hippenstiel) Add the following lines to `.inputrc` in your Cygwin home directory (e.g. `~/.inputrc`):

    set input-meta on    # to accept 8-bit characters
    set output-meta on   # to show 8-bit characters
    set convert-meta off # to show it as character, not the octal representation

5.2.2. How do I put bash into "8 bit" mode?

See Q: 5.2.1.

5.2.3. How do I display unicode characters in an xterm?

A1: for Cygwin 1.7

If you have a UTF-8 locale configured, this should all just work :-).

To confirm this is working properly, you may try the following:

    $ wget http://www.cl.cam.ac.uk/~mgk25/ucs/examples/quickbrown.txt
    [...]
    $ cat quickbrown.txt

    $ wget http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
    [...]
    $ cat UTF-8-demo.txt

If you want to be able type unicode characters into this xterm, you'll need to configure your bash shell not to escape 8-bit characters, see Q: 5.2.1.

A2: for Cygwin 1.5

Start your xterm in UTF-8 mode as xterm +lc -u8.

To confirm this is working properly, you may try the following

    $ wget http://www.cl.cam.ac.uk/~mgk25/ucs/examples/quickbrown.txt
    [...]
    $ cat quickbrown.txt

For reasons I don't currently understand, the default fixed font is only capable of supplying accented roman, hiragana and katakana characters, so if you wish to work with e.g. greek, cyrillic, hebrew, thai, etc. you'll need to start your xterm specifying a suitable font e.g. xterm +lc -u8 -fn -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1

To confirm this is working properly, you may try the following

    $ wget http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
    [...]
    $ cat UTF-8-demo.txt

For other programs run from your xterm to output properly (e.g. less, which is why cat is used in the examples above), you may also need to set the LANG environment variable to `LL_CC`.UTF-8, where LL_CC is your language and country code.

If you want to be able type unicode characters into this xterm, you'll need to configure your bash shell not to escape 8-bit characters, see Q: 5.2.1.

See also the main Cygwin FAQ question on unicode support in Cygwin

### 6. Remote connections

6.1. X11Forwarding does not work with OpenSSH under Cygwin

A1:

Try adding the `-v` option to ssh, which often pinpoints the reason for a connection problem.

From the ssh man-page : -v Verbose mode. Causes ssh to print debugging messages about its progress. This is helpful in debugging connection, authentication, and configuration problems. Multiple -v options increase the verbosity. The maximum is 3.

A2:

Before establishing the ssh connection the xserver must be started and the environment variable `DISPLAY` must be set.

    $ DISPLAY=:0.0
    $ export DISPLAY
    $ ssh -Y remotehost

or

    $ DISPLAY=:0.0 ssh -Y remotehost

A3:

Make sure you're not starting ssh with the option `-X`. Since OpenSSH 7.2p1, ssh does not fallback to trusted forwarding, option `-Y`, so no X11 forwarding is setup. Use ssh -Y.

Make sure you're not starting ssh with the option `-x` (lowercase). This disables X11 forwarding.

A4:

Check that X11Forwarding is not disabled in the ssh client configuration.

The configfiles are by default `~/.ssh/config` and `/etc/ssh_config`. The file in the home directory overrides settings in the global one.

The configfile is split into various sections starting with "Host `wildcard`". The section applies to all hosts where `wildcard` matches the hostname.

If this section contains an entry "ForwardX11 no" then X11Forwarding is disabled. To enable it change the entry to:

    ForwardX11 yes

A5:

Check that X11Forwarding is not disabled in the ssh server configuration.

The configfile is by default `/etc/ssh/sshd_config`. If there is an entry "X11Forwarding no" then X11Forwarding is disabled.

If you have write access to the config file then change it to

    X11Forwarding yes

The OpenSSH server must be restarted or SIGHUP'ed to re-read the configuration file after it is changed. Otherwise, ask your administrator to change this for you.

A6:

[Frederick W. Wheeler] If the remote machine is a Windows machine using Cygwin OpenSSH server, make sure the Cygwin xauth package is installed on the remote machine. The OpenSSH server needs to be able to run xauth to do X11 Forwarding.

6.2. Why do remote programs crash with an X Error of failed request: BadAtom? Why do remote programs exit when you try to copy and paste?

This question should be obsolete since the SECURITY extension is now disabled

OpenSSH 3.8 enables untrusted X11Forwarding by default when connecting to an ssh server that supports it.

You will quickly notice that this is the case if most of your X applications are now killed when you try to copy and paste, X applications fail with an error similar to that below, or if xdpyinfo returns only a fraction of the supported extensions that it does if run locally.

     X Error of failed request: BadAtom (invalid Atom parameter)
      Major opcode of failed request: 18 (X_ChangeProperty)
      Atom id in failed request: 0x114
      Serial number of failed request: 370
      Current serial number in output stream: 372

It is easiest to just override untrusted X11Forwarding by passing `-Y` to ssh in place of `-X`. The `-Y` does the same thing as `-X`, but it enables trusted X11 forwarding for the current connection.

Setting "ForwardX11Trusted yes" in the ssh client configuration file does the same thing. See man ssh_config for more information.

See also Q: 6.1.

6.3. I'm confused about the difference between trusted and untrusted X11 forwarding. What does "Warning: untrusted X11 forwarding setup failed: xauth key data not generated" mean? Why is the SECURITY extension disabled?

The warning means that ssh is going to use trusted X11 forwarding because untrusted X11 forwarding depends on the SECURITY extension, which isn't built into the X server and has been disabled by default upstream.

Trusted X11 forwarding means that you trust the server that you wish to ssh into. The X server will allow remote clients to do whatever a local client would be able to do to your X session, for example, monitor your keypresses and take a screenshot. Such programs could be run by a malicious or compromised root user on the ssh server, or under your account if it was compromised on the ssh server.

Starting with OpenSSH 3.8, untrusted forwarding is the default when X forwarding is requested using the `-X` command line option and you need to use the option `-Y` or specify "ForwardX11Trusted yes" in the client configuration for trusted forwarding by default.

Since OpenSSH 7.2p1, untrusted forwarding (ssh `-X`) does not fallback to ssh `-Y` trusted forwarding.

So why is this disabled? Untrusted X11 forwarding was meant to be a way to allow logins to unknown or insecure systems. It generates a cookie with xauth and uses the security extension to limit what the remote client is allowed to do. But this is widely considered to be not useful, because the security extension uses an arbitrary and limited access control policy, which results in a lot of applications not working correctly (e.g. not being able to cut and paste) and what is really a false sense of security. See this mail for more on the subject.

(Words adapted from an email by Yaakov Selkowitz)

6.4. What does "Warning: no xauth data; using fake authentication data for X11 forwarding" mean?

Unless you started the X server with the `-auth` option (typically by using startx) this warning is expected and can safely be ignored.

6.5. Why can't new remote X clients connect to the X server after 20 minutes?

Starting with OpenSSH 5.6, ssh enforces the ForwardX11Timeout (which defaults to 1200 seconds) when an untrusted connections is requested, even if an untrusted connection could not be made (e.g. you used ssh -X which asks for an untrusted connection, and got the "untrusted X11 forwarding setup failed" warning). This means that no new connections to the X server can be made 20 minutes after the ssh connection is established.

Use ssh -Y. See also Q: 6.2..

6.6. Remote clients can't connect

The X server now uses `-nolisten tcp` by default, which increases the security of the X server by not opening a TCP/IP socket.

Use the `-listen tcp` option to allow the X server to open a TCP/IP socket as well, e.g. startxwin -- -listen tcp. See Q: 4.2..

A better solution is to stop explicitly setting DISPLAY and allowing access using xhost or by disabling access control. Use ssh -Y instead. (See the User's Guide section on X forwarding using ssh for more details).

6.7. X sessions forwarded by PuTTY can't connect. Non-cygwin local X clients can't connect.

The X server now uses `-nolisten tcp` by default, which increases the security of the X server by not opening a TCP/IP socket, only a local (UNIX domain) socket. Non-cygwin applications cannot connect to that socket.

Use the `-listen tcp` option to allow the X server to open a TCP/IP socket as well, e.g. startxwin -- -listen tcp. See Q: 4.2..

### 7. XDMCP connections

7.1. XDMCP fatal error: Session declined No valid address

Cygwin/X is sometimes unable to determine which local network interface's address should be reported to the XDMCP server; in these cases you need to pass `-from` `local_host_name_or_ip_address` to `X` to specify which interface address to report.

7.2. Why does Cygwin/X report AUDIT: client 1 rejected from IP `remotehost`?

The problem is most likely a wrong DNS (Network name resolution). Make sure your windows host has a hostname which is valid from linux too and an IP address which linux can resolve to that hostname.

If you add a line

    192.168.26.1 myhost

to /etc/hosts on the XDMCP server with the IP address and the hostname of your windows host the name resolution should work.

7.3. I get no login screen when using `-query`

A1: Disabled XDMCP on servers

[Mika Laitio] For security reasons, XDMCP is not enabled by default on most Linux/UNIX/*NIX/*BSD distributions (Red Hat, Mandrake, SuSE, FreeBSD, NetBSD, etc.) by default. You have to manually enable remote logins to your X Display Manager (e.g. xdm, kdm, or gdm). The location of the proper config file is distribution/OS dependent, but a short list of known config file locations is given in Table 1. You must change the line:

    [Xdmcp]
    Enable=false

to:

    [Xdmcp]
    Enable=true

or for xdm style configuration:

    DisplayManager.requestPort:     0

to:

    !DisplayManager.requestPort:     0

Table 1. Known XDM Configuration File Locations

Distribution/OS | Version | Display Manager | Location
--- | --- | --- | ---
Linux Mandrake | 8.1 | kdm | /usr/share/config/kdm/kdmrc
Debian GNU/Linux | Unstable | kdm | /etc/kde3/kdm/kdmrc
Debian GNU/Linux | Unstable | gdm | /etc/X11/gdm/gdm.conf
Debian GNU/Linux | Unstable | xdm | /etc/X11/xdm/xdm-config
Debian GNU/Linux | Unstable | wdm | /etc/X11/wdm/wdm-config

A2: XDMCP and firewalls

XDMCP will not work correctly if you have a personal firewall installed or the built-in firewall of Windows is activated.

The XDMCP protocol will send and receive data on port 177/UDP. But the actual connections will be made to the local port 6000/TCP. It is safe to allow connections since the xserver has an own security layer. An overview of used ports is given in Table 2.

Table 2. Ports used with XDMCP connections

Port | Protocol | Direction | Comment
--- | --- | --- | ---
177 | UDP | Incoming/Outgoing | Actual XDMCP connection
6000+`display` | TCP | Incoming | Connection for X11 clients. `display` is usually 0 except if you specify it on the commandline.

7.4. XDMCP does not work with Mandrake 8.1

See Q: 7.3.

7.5. Why does GDM not work with `-clipboard`

Newer versions of GDM have a more complex startup mechanism than the other display manager have. This can interfere with the way the clipboard integration client is started.

Workaround: add (or modify) this section in the `gdm.conf` (or `/etc/gdm/custom.conf`) file.

    [daemon]
    KillInitClients=false

7.6. I get no login screen for Solaris

See also Q: 7.7. and Q: 7.8.

[David Dawson] For whatever reason, certain versions of Solaris need fonts that are not provided by Cygwin/X; the result is that you may see the Solaris background tile and the hourglass cursor, but the XDM login prompt will never appear. The simplest solution is to point Cygwin/X at the font server that is usually running on the Solaris machine. You'll need a command line similar to the following to start your XDMCP session and to connect to the Solaris font server:

`X -query `solaris_hostname_or_ip_address` -fp tcp/`solaris_hostname_or_ip_address`:7100`

> Note: The `-fp` parameter is a general X Server parameter, it is not specific to Cygwin/X; therefore, the `-fp` is documented in the X Server manual page. For additional information about fonts, see Fonts in X11R6.7.

The standard port number for a font server is `7100`, however, you may need to ask your system administrator what the font server port number is if you cannot connect to a font server on port `7100`. It is also possible that your Solaris machine is not running a font server, in which case you will need to consult your Solaris documentation for instructions on how to run a font server.

7.7. XDMCP freezes with remote Solaris machine!

See also Q: 7.6. and Q: 7.8.

Solaris appears to not support certain display bit depths, such as 24 bits per pixel. Change your Windows display bit depth to 8, 16, or 32 and try logging in again. File a complaint with Sun if this issue is important to you, or change your Solaris machines to use XFree86 instead of the Solaris X Window System.

7.8. Login to CDE on Solaris via XDMCP hangs Cygwin/X.

See also Q: 7.6. and Q: 7.7.

Install the recommended set of patches for your version of Solaris.

7.9. Where can I find more information about XDMCP.

See the Linux XDMCP HOWTO for more information about XDMCP.

### 8. Troubleshooting

8.1. Cygwin/X failed with "Fatal Error". What does this mean?

The Fatal Error is a general error message. More specific information what caused this is available in `/var/log/xwin/XWin.0.log`. Please check the common error messages in the Section called Error and Warning Messages. If your error is not mentioned proceed with Q: 8.4.

8.2. Is there a log file that I can look at for diagnostic information and error messages?

Yes. The Cygwin/X log file is located at `/var/log/xwin/XWin.0.log`. You will find solutions to the most common error messages in the Section called Error and Warning Messages.

8.3. I have a specific error message, what does it mean?

See the Error and Warning Messages section for help with specific error messages. Return to this section if you do not find a specific answer for the error message that you have.

8.4. I have a specific error message that is not addressed in the Error and Warning Messages section.

Search the Cygwin/X mailing list archives to see if the error message has already been reported and/or addressed. Report the error message to the cygwin@cygwin.com mailing list, how the error message was caused, and the behavior of the X Server after the error message was generated (exit, freeze, etc.), only if the error message has not been reported, if the circumstances that produced the error message are significantly different from other reports, or if you have additional information regarding the error message to contribute. Please include `/var/log/xwin/XWin.0.log` in your mail. This may help us identify the cause of your problem quicker.

8.5. My bug report the Cygwin/X mailing list was ignored. What do I do now?

Some bug reports are deliberately ignored by project members if the bug in question was recently dealt with; did you search the mailing list archives for a solution to your problem before submitting your bug report? Some bug reports are ignored if they do not contain sufficient information to understand the situation that produces the bug; did your bug report have enough information? Some bug reports are missed or forgotten, thus some valid bug reports do not receive a reply; simply resubmit such bug reports that have not received a response within 7 days of submission.

8.6. Why does Cygwin/X freeze right after startup?

Zone Alarm 5 is known to break Cygwin/X. As a result you'll see this line (or a similar) as last output in `/var/log/xwin/XWin.0.log`

    Rules = "xorg" Model = "pc101" Layout = "us" Variant = "(null)" Options = "(null)"

Disabling Zone Alarm will not solve this problem. You can only uninstall Zone Alarm 5 and switch to an earlier version (4.5 is known to work) or use a different personal firewall.

Another reason is `/tmp` mounted in textmode. This does only happen with the `-multiwindow` and `-clipboard` switches because of the extra threads within Cygwin/X.

You can remount `/tmp` to binmode with these commands:

    mount -b "$(cygpath -m /tmp)" /tmp

If this fails with an error message stating insufficient rights, try

    mount -b -u "$(cygpath -m /tmp)" /tmp

8.7. Cygwin/X has very poor performance. What's the reason?

Most likely you have installed some kind of personal firewall, VPN software or any other software that modifies the TCP/IP stack of Windows. Especially Webwasher and some other filtering software are known to slow down the network traffic.

Some online virus scanners like Symantec Antivirus do slowdown Cygwin/X a lot. They scan every file access and network traffic which causes serious processing overhead beyond that from the X11 protocol and the unix emulation layer.

So far there is no known solution but to disable the virus scanner completely.

[Dr. Edward Wornar] Certain programs that are installed by various drivers and software packages can consume an incredible amount of system resources and processing time. One known example of such a program is `ATI2evxx.exe`, a utility installed with some ATI Technologies graphics card drivers. Answers That Work has information on `ATI2evxx.exe` on their Task List Programs - A page. You may want to try disabling, one-by-one, `ATI2evxx.exe` and other such programs until you find the program that is causing the slowdown.

8.8. I have Microsoft Services for Unix installed and can't type anything. Help me!!!

Microsoft Services for Unix set some environment variables which points Cygwin/X to outdated or not existing files. These variables are

    XAPPLRESDIR
    XCMSDB
    XKEYSYMDB
    XNLSPATH

To have Cygwin/X work correctly you have to unset at least `XKEYSYMDB`.

Reported by Juan Medina, Pavel Rozenboim

8.9. Cygwin/X is extremely slow, especially when using XDMCP to connect to remote machines.

see Q: 8.7..

8.10. Simulated mouse wheel scrolling doesn't work with a TrackPoint mouse (found on IBM laptops) or Synaptics Touchpads

[Gerald S. Williams] The TrackPoint driver tries to send scroll up/down messages to the default scrollbar in a window. Cygwin/X does not use Windows scrollbars for X Client windows, so we must configure the TrackPoint driver to send standard WM_MOUSEWHEEL messages to the Cygwin/X window. This can be done by editing the TrackPoint configuration that can be found in the `tp4table.dat` and/or `tp4scrol.dat` files, which are usually located in `%SYSTEM_ROOT%\System32\`, `%PROGRAMFILES%\Synaptics\SynTP\` or `%PROGRAMFILES%\Lenovo\Trackpoint\`.

Add the following to the "Pass 0 rules"section and then restart your computer to ensure the driver reloads it's settings.

    ; X Windows
    *,*,XWin.exe,*,*,*,WheelStd,0,9

8.11. Why is the root window not shown in normal mode?

This question should be obsolete.

8.12. Why is the cross the default cursor in multiwindow mode?

This question should be obsolete

To workaround this add the command

    run xsetroot -cursor_name left_ptr -fg white -bg black

to `startxwin.bat`

8.13. How can I adjust the linewidth in bash after resizing XTerm?

We think this question is probably obsolete

Try starting `resize`.

8.14. Why do some menus not work if Num-Lock is on?

The problem are programs which treat Num-Lock as modifier similar to Control. The programs expect a plain click but received some strange Num-Lock-Click combination and can't associate this with the action "open menu".

### 9. Error and Warning Messages

9.1. _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

    _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
    _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created

This question should be obsolete as this error is no longer generated.

This warning message can be ignored; it does not cause any known problems.

9.2. error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy

This question should be obsolete as this error is no longer generated.

This error is harmless.

9.3. Duplicate invocation on display number: 0. Exiting.

Most likely you have started `X` twice.

if you start multiple instances of `X` you have to give then unique display numbers

    X -query foo
    X :1 -query bar
    X :2 -query blubb

Specifying no display number is the same as using `:0`

If you want another terminal window (which in fact is just a convenient side effect of running `startxwin`) you should do this by starting `xterm &` from an existing terminal window, from the notification area icon menu, from a cygwin shell or from the start menu.

9.4. Fatal server error: could not open default font 'fixed'

This question should be obsolete as the default font is now built into the server.

This error occurs for one of three reasons:

1. You do not have a font package which provides the default font ('fixed') installed. This is rarely the problem; but in the event that it is the problem, just rerun Cygwin' setup program, select the font-misc-misc package and install it.

2. The mount point for `/usr/share/fonts/` was either invalid (does not point to a valid folder on your system) or is a text-mode mount. You can confirm that this is the problem by running mount from a Cygwin shell and checking the disk path returned for the `/usr/share/fonts/` mount point.

   > Note: You cannot reliably fix this problem by deleting your Cygwin installation and reinstalling it. The mount points that Cygwin was using will be left in your system settings and the invalid mount point for `/usr/share/fonts/` will be used again when you perform the reinstallation. You SHOULD follow the instructions below to fix the problem.

   To fix the problem, perform the following steps:

   1. Open a Cygwin shell and run umount /usr/share/fonts/.

   2. Close the Cygwin shell.

   3. Run Cygwin's setup program.

   4. For each of the font packages, if they are marked Keep, then select Reinstall, otherwise leave them as they are:

   5. Allow Cygwin's setup program to download and reinstall the fonts packages. The key to fixing this problem is that the files were previously untarred into an invalid location; removing the mount point for the fonts directory should result in the files being untarred to a valid location.

3. You chose "DOS/text" as the "Default Text File type" during Cygwin setup, ignoring the advice that the Default Text File Type should be left on Unix/binary unless you have a very good reason to switch it to DOS/text.

   Open a Cygwin shell and run.

       umount /usr/share/fonts/
       mount -f -s -b "C:/cygwin/usr/share/fonts" "/usr/share/fonts"

   Reinstall your fonts

9.5. Could not init font path element /usr/share/fonts/`*`/, removing from list!

These warnings are generally harmless since they indicate that default search paths for fonts do not actually contain fonts; this is only a problem if the `misc` path does not contain fonts and/or all of the paths do not contain fonts.

If you are getting these message and the X Server is also failing to start, then see Q: 9.4. for information on how to fix your fonts.

9.6. The procedure entry point _check_for_executable could not be located

This question should be obsolete.

Programs that you are attempting to use were compiled against a newer version of Cygwin than is currently on your system. Run Cygwin's setup program to update your installation to the latest version.

9.7. cygX11-6.dll not found after installation or upgrade

This question should be obsolete.

9.8. Exception: STATUS_ACCESS_VIOLATION

- It is believed that this may have the same underlying causes as Q: 9.16.

- `cygwin1.dll` uses a shared memory section amongst all loaded copies of `cygwin1.dll`; unfortunately, the layout and usage of the shared memory section changes between versions of `cygwin1.dll`. Loading two different versions of `cygwin1.dll` will cause the shared memory section to become corrupted, which almost always results in an Exception: STATUS_ACCESS_VIOLATION. You must search your filesystem(s) and remove all copies of `cygwin1.dll` except the copy in `/bin`. You must remove the different versions of `cygwin1.dll` even if they are not in your path, as programs that depend on `cygwin1.dll` attempt to load the file from the local directory before searching other paths; thus, it is rather easy, and common, for multiple versions of `cygwin1.dll` to become loaded at the same time if they exist on a particular system.

- See also this main Cygwin FAQ question for an issue which may cause this problem with older binaries on Terminal Server.

9.9. Xlib: connection to "`local_host_name_or_ip_address`:0.0" refused by server Xlib: Maximum number of clients reached

Cygwin/X queries getdtablesize() for the maximum number of client connections allowed; by default Cygwin returns 32 from getdtablesize(). Cygwin/X Server Test Series release Test44, released on 2001-08-15, changed the maximum number of clients from 32 to 1024 by passing the square of getdtablesize() to setdtablesize().

9.10. XIO: fatal IO error 104 (Connection reset by peer) on X server "127.0.0.1:0.0"

See Q: 9.9.

9.11. Cannot Open Display: 127.0.0.1:0.0

Certain classes of software, such as that used for Virtual Private Networking and fire-walling may cause the IP address 127.0.0.1, or other local adapter addresses, to be redirected, to become inoperable in some way, or to be operated in a manner that violates the defined operation of IP address.

As a potential remedy, try removing all instances of such software; this may not always fix the problem though, as some software may leave artifacts even after uninstallation is completed. The only way to be sure that you have not found a Cygwin/X bug is to install Windows on a freshly formatted hard drive, followed by Cygwin and Cygwin/X, and finally add your other software one application at a time until Cygwin/X stops working.

Some products that have been reported to cause problems:

- Aventail Connect

- Zonealarm PC Firewall from Zonelab

> Note: These products may not cause problems in all configurations. However, the Cygwin/X project has neither the time, ability, nor resources to help you correctly configure your third-party software.

See the main Cygwin FAQ question for an up-to-date list of software which has been known to interfere with the correct operation of Cygwin.

9.12. Out of environment space

Increase your Windows environment space by following the instructions provided by Microsoft.

9.13. Too many parameters

See Q: 9.12.

9.14. "xcb_xlib_lock: Assertion '!c->xlib.lock' failed." or "xcb_xlib_unlock: Assertion 'c->xlib.lock' failed."

This question should be obsolete.

Both of these represent bugs in a caller of libX11, and not in libX11 or libxcb. The first assertion means that a caller attempted to lock the display while already locked. The second assertion means that a caller attempted to unlock the display without having it locked.

If you encounter such bugs, please report a bug against the offending software (which is not libX11 or libxcb)

This error can be worked around by using export LIBXCB_ALLOW_SLOPPY_LOCK=1

9.15. Fatal server error: Failed to activate core devices.

    (EE) XKB: Could not invoke xkbcomp
    (EE) XKB: Couldn't compile keymap
    XKB: Failed to compile keymap
    Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
    Fatal server error: Failed to activate core devices.

- Verify that xkeyboard-config is correctly installed using cygcheck -c xkeyboard-config,

- Check that /usr/bin/xkbcomp can be run from a bash shell. If that fails, see if cygcheck /usr/bin/xkbcomp reports any missing DLLs.

- Something is interferring with the ability of the X server to invoke xkbcomp to compile the keymap.

  See Q: 9.16. for possible causes.

9.16. "fatal error - unable to remap (some dll) to same address as parent: (some hex number) != (some other hex number)" or "(some dll): Loaded to different address: parent(some hex number) != child(some other hex number)"

This is commonly caused by one of three things:

- You have run Cygwin's setup program to do an update while some cygwin processes were running, and then clicked on the continue option in the "In-use files detected" dialog, and then tried to carry on using Cygwin without rebooting as advised by setup. Reboot.

- This is one of the symptoms of an application interfering with Cygwin's fork() emulation. See the main Cygwin FAQ question for a list of software which has been known to interfere with the correct operation of Cygwin.

- This also caused by DLLs with conflicting base addresses preventing Cygwin's fork() emulation from functioning correctly. See the main Cygwin FAQ question for advice.

9.17. fork: child -1 - died waiting for longjmp before initialization, retry (some number), exit code (some hex number), errno (some other number)

This is believed to have the same underlying causes as Q: 9.16.

### 10. Porting Software

10.1. Is there a list of software that has been ported to Cygwin/X?

Look in Cygwin's setup program for packages in the X11 category.

Also, see this Cygwin/X - Ported Software old list.

10.2. How do I start porting software to Cygwin/X?

Cygwin/X provides a software interface that is very similar to the software interface provided by GNU/Linux and other UNIX systems. Most software packages will compile on Cygwin/X without any changes at all. To begin with, try to compile a given software package following that package's compilation instructions for GNU/Linux.

10.3. Are there common problems encountered when porting software to Cygwin/X?

One common problem encountered when porting software to Cygwin/X is due to Cygwin's inability to distinguish between files with the same name but different capitalization (e.g. XvMC.h and xvmc.h), which is due to a Windows' limitation.

Example 1. Include Problems

This example is based off an error that actually occurred in the source code tree in `xc/programs/Xserver/Xext/xvmc.c`. `xvmc.c` included `XvMC.h`, as shown below:

    #include "XvMC.h"

The intention was to include the file `xc/include/extensions/XvMC.h`. Unfortunately, there was a file named `xc/programs/Xserver/Xext/xvmc.h` that ended up getting included instead of the desired file, because the precompiler searched the local directory, `xc/programs/Xserver/Xext/`, before searching the rest of the include path. Cygwin can't distinguish between `XvMC.h` and `xvmc.h`, so `xvmc.h` ended up being included in `xvmc.c`. The build process on Cygwin broke because the contents of `XvMC.h` were entirely different than the contents of `xvmc.h`.

The solution was to change the include to specifically reference the desired header:

    #include "../../../include/extensions/XvMC.h"

10.4. Problems linking OpenGL applications? Undefined reference to _glsomething?

Cygwin has two OpenGL implementations:

1. headers in /usr/include/w32api/GL, libraries (-lglut32 -lglu32 -lopengl32) from the opengl and w32api packages which are for displaying OpenGL graphics directly through the native Windows interface (Win32) without any X server

2. headers in /usr/include/GL, libraries (-lglut -lglu -lgl) from the Mesa libGL packages (libGL-devel, libGL1, libGLU-devel, libGLU1, libglut-devel, libglut3, freeglut) which are for displaying OpenGL graphics through an X server.

These are incompatible, even the headers (as the native OpenGL API has the stdcall calling convention), so you must exercise care if you have both sets of devel packages installed. An application must be built using only one of these.

- X applications using GLX must be built using option 2.

- Applications using GLUT have a choice.

- Applications using the WGL API must be built using option 1.

(Words adapted from an email by André Bleau)

### 11. Contributing

11.1. Are there step-by-step instructions for contributing to Cygwin/X?

Yes. The Cygwin/X Contributor's Guide has step-by-step instructions for obtaining the source, building the source, building debug versions of the source, and even cross-compiling under Linux.

11.2. Are there editors for Windows that understand and preserve UNIX end of line characters?

Yes. Emacs and XEmacs are available for Windows; they both understand and preserve UNIX end of line characters.

11.3. How should I generate patches for Cygwin/X?

Only submit patches that have UNIX end of line characters. See Q: 11.2. for information on editors for Windows that are aware of UNIX end of line characters.

11.4. Where do I submit patches for Cygwin/X?

Submit patches for Cygwin/X to the cygwin@cygwin.com mailing list.

See Q: 11.3. for more information on generating patches.

11.5. Why doesn't the X Window System use GNU's autoconf?

It does! Thanks to the excellent efforts of the X.Org community, the X Window System has been autotoolized since X.Org R7.0.

Anyone who despaired of touching the monolithic tree will find things much easier now with modular packages.

11.6. What compiler does Cygwin/X use, and which compilers are supported?

Cygwin/X uses the gcc compiler from the Free Software Foundation. Cygwin/X source code is mostly ANSI C compliant, but we cannot guarantee that Cygwin/X will compile with any other compiler, nor can we afford the time to support compilers other than gcc.

See the GCC Home Page for more information on gcc.

11.7. Is cross-compiling from a non-Cygwin platform supported?

Cross-compiling from a non-Cygwin platform is described in the Cygwin/X Contributor's Guide

11.8. Where can I get help for installing DocBook on Cygwin?

The required packages are listed in the Cygwin/X Contributor's Guide.

### 12. Licenses, Patents, Trademarks, and Copyrights

12.1. What licenses apply to Cygwin/X source code?

Cygwin/X proper isn't covered by a single license, as Cygwin/X is made up of two parts that are covered by distinct licenses: Cygwin and the X Window System.

See Q: 12.2. and Q: 12.3. for more information regarding the licenses that apply to Cygwin/X.

12.2. What licenses apply to the X Window System source code?

X Window System source code is generally licensed under an X11 style license, which is certified by the Free Software Foundation as compatible with the GNU GPL.

12.3. What license applies to Cygwin source code?

Cygwin source code is licensed under a modified version of the GNU GPL . Cygwin's license modification specifically allows third-party software under an open source license to be linked with Cygwin without requiring that the source code for the third-party software be distributed under the terms of the GNU GPL. Cygwin's developers went to great trouble to obtain this modification and should be thanked for doing so, as without it the modification, Cygwin/X linking to Cygwin would be the subject of endless discussion.

12.4. Who holds the copyright on the Cygwin/X source code?

Cygwin/X proper doesn't have a single copyright holder, as Cygwin/X is made up of two parts, namely Cygwin and the X Window System; each part follows a different scheme in regards to who will hold the copyright on source code.

See Q: 12.5. and Q: 12.6. for more information regarding who holds the copyright on Cygwin/X source code.

12.5. Who holds the copyright on the X Window System source code?

Each source code file in the X Window System typically has its own license and copyright statement. Therefore, there is not a general rule for determining who holds the copyright on a particular X Window System source file, as each author is free to assign the copyright to someone else, to some group, or to keep the copyright themselves. You must inspect the source code file in question to determine who holds the copyright for that file.

12.6. Who holds the copyright on the Cygwin source code?

Red Hat owns the copyright on the Cygwin source code. Red Hat requires that copyright be assigned to Red Hat for non-trivial changes to Cygwin. You must fill out a copyright transfer form if you are going to contribute substantial changes to Cygwin.

12.7. What license applies to Motif?

Motif is a product of The Open Group. After many years under the The Open Group Public License (which does not satisfy the Open Source Definition and is thus not compatible with Cygwin's license), Motif was released as free software under the LGPL v2.1 in October 2012.

12.8. Isn't "XWin" trademarked by StarNet Communications?

Not in the USA, at least. A quick search at the United States Patent and Trademark Office for "XWin" turns up one dead record and one live record. The live record is for a logo belonging to a rock crusher manufacturer based out of Belgium. Neither trademark affects Cygwin/X, as the dead record is no longer enforceable, while the live record is in an unrelated and distinct industry; there cannot be confusion between rock crushers and computer programs.

|  | Next
|  | Bibliography