Zeus
Zeus

Reputation: 6566

Unable to start the startxwin cygwin

I was using Cygwin download by some one in our organization and the xterm worked fine, I recently updated the xterm version, since then I lost the ability to use the xwindow/start the xserver. The bash console where I ran the startxwin shows the following and does not open the xterm window. I manually opened the xterm window and it does not open the xwindows when I ssh'd into the remote machine.

$ startxwin
:0" in "list" command display name "6175
xauth: (stdin):1:  bad "add" command line

Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.19.3.0
OS: CYGWIN_NT-6.1 6175 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64
OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (Win64)
Package: version 1.19.3-2 built 2017-04-23

XWin was started with the following command line:

/usr/bin/XWin :0 -multiwindow -auth
 /home/usrpao/.serverauth.13204

(II) xorg.conf is not supported
(II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
LoadPreferences: /home/usrpao/.XWinrc not found
LoadPreferences: Loading /etc/X11/system.XWinrc
LoadPreferences: Done parsing the configuration file...
winDetectSupportedEngines - RemoteSession: no
winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL
winDetectSupportedEngines - Returning, supported engines 00000005
winSetEngine - Multi Window or Rootless => ShadowGDI
winScreenInit - Using Windows display depth of 32 bits per pixel
winAllocateFBShadowGDI - Creating DIB with width: 2560 height: 1024 depth: 32
winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
MIT-SHM extension disabled due to lack of kernel support
XFree86-Bigfont extension local-client optimization disabled due to lack of shared memory support in                                                                                 the kernel
glWinSelectGLimplementation: Loaded 'cygnativeGLthunk.dll'
(II) AIGLX: Testing pixelFormatIndex 1
GL_VERSION:     4.3.0 - Build 10.18.14.4280
GL_VENDOR:      Intel
GL_RENDERER:    Intel(R) HD Graphics 4600
(II) GLX: enabled GLX_SGI_make_current_read
(II) GLX: enabled GLX_SGI_swap_control
(II) GLX: enabled GLX_MESA_swap_control
(II) GLX: enabled GLX_SGIX_pbuffer
(II) GLX: enabled GLX_ARB_multisample
(II) GLX: enabled GLX_SGIS_multisample
(II) GLX: enabled GLX_ARB_fbconfig_float
(II) GLX: enabled GLX_EXT_fbconfig_packed_float
(II) GLX: enabled GLX_ARB_create_context
(II) GLX: enabled GLX_ARB_create_context_profile
(II) GLX: enabled GLX_ARB_create_context_robustness
(II) GLX: enabled GLX_EXT_create_context_es2_profile
(II) GLX: enabled GLX_ARB_framebuffer_sRGB
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) 80 pixel formats reported by wglGetPixelFormatAttribivARB
(II) 44 fbConfigs
(II) ignored pixel formats: 0 not OpenGL, 0 unknown pixel type, 36 unaccelerated
(II) GLX: Initialized Win32 native WGL GL provider for screen 0
winPointerWarpCursor - Discarding first warp: 1280 512
(--) 8 mouse buttons found
(--) Setting autorepeat to delay=500, rate=31
(--) Windows keyboard layout: "00000409" (00000409) "US", type 4
(--) Found matching XKB configuration "English (USA)"
(--) Model = "pc105" Layout = "us" Variant = "none" Options = "none"
Rules = "base" Model = "pc105" Layout = "us" Variant = "none" Options = "none"
winInitMultiWindowWM - DISPLAY=:0.0
winMultiWindowXMsgProc - DISPLAY=:0.0
winInitMultiWindowWM - xcb_connect () returned and successfully opened the display.
winProcEstablishConnection - winInitClipboard returned.
winClipboardThreadProc - DISPLAY=:0.0
winMultiWindowXMsgProc - xcb_connect() returned and successfully opened the display.
OS maintains clipboard viewer chain: yes
winClipboardProc - XOpenDisplay () returned and successfully opened the display.
Using Composite redirection

Upvotes: 1

Views: 3110

Answers (2)

rustyx
rustyx

Reputation: 85371

It's a PATH issue. Cygwin\bin should be in the PATH before Windows\System32.

Otherwise system32\hostname.exe is invoked instead of /bin/hostname, which adds a trailing newline to the hostname.

A possible workaround is to invoke /bin/hostname instead of just hostname:

sed -i s/\`hostname/\`\\/bin\\/hostname/ /usr/bin/startx /usr/bin/startxwin

... but you'll face other issues until you put Cygwin at the beginning of the PATH (though then you might face yet other issues, so there's no ideal solution).

Upvotes: 0

Syrinx
Syrinx

Reputation: 81

I had a similar issue and tracked it down to startx misbehaving. This is what I saw:

$ ./startx -- :1
:1" in "list" command display name "hostname
xauth: (stdin):1:  bad "add" command line

The problem is with the way startx is setting its hostname variable. It does not strip out the carriage return. Later, when startx uses the hostname variable, the contained carriage return causes xuath "add" command to terminate prematurely and fail.

The fix for me was to strip out the carriage return.

Find where the variable hostname gets set in /usr/bin/startx, and just below there add this line:

hostname=$(echo $hostname | sed 's/\x0D//g')

Upvotes: 1

Related Questions