Cygwin window closes immediately

6

The configuration:

  • Windows 10 (64-bit) (Fresh installation)
  • Cygwin64 fresh installation (downloaded setup-x86_64.exe)

Installation looks like it worked. However, when I try to launch the newly created shortcut, the window closes immediately.

The shortcut target is C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -.

If I modify it to C:\cygwin64\bin\mintty.exe -h always -i /Cygwin-Terminal.ico -, the window stays open, but the message inside is Failed to run /Cygwin-Terminal.ico: Permission denied.

The following might be a red herring, but I suspect it is actually related to the problem: If I run cmd and cd c:\cygwin64, I can run Cygwin.bat, however the prompt is Unknown+User@DESKTOP-6SQ80GV ~, which is not actually my username. /cygdrive/c/cygwin64/Cygwin-Terminal.ico is owned by Unknown+User with group of Administrators, and has permissions of 644. If I chmod +x it, the error message in the window changes to:

C:/cygwin64/sbin/nologin.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
/sbin/nologin: Exit 127

I've done some quick searching and my google-fu is apparently failing, as I'm not finding much to go on. I'm guessing I could thrash around and eventually make things work, but I'm wondering if anyone here knows "what is the right way to fix this problem?".

Jed Daniels

Posted 2015-10-12T19:05:38.337

Reputation: 1 166

Answers

13

I had the same issue after updating my Cygwin installation on Windows 7. The problem wasn't the update itself but the activation of the cygserver service. If you have any Cygwin service installed in your Windows machine try solving the problem by setting these services to either manual start or automatic start but delayed.

The problem is that the service 'cygserver' will cache account information and provide it to other Cygwin applications and services like described in https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-caching. The account data is retrieved from Microsoft LDAP service which needs more time to start than the cygserver service. Setting the cygserver service to delayed automatic start will resolve this problem. But keep in mind that the start of the cygserver service may delayed a couple of minutes after (re)boot of Windows.

Hope this helps :-)

Izzet Beltir

Posted 2015-10-12T19:05:38.337

Reputation: 131

1To make cygserver run automatically but delayed, do the following: Press Win+R to open the Run console and enter services.msc. Find CYGWIN cygserver in the services list, right-click it and select Properties, and choose Automatic (Delayed Start) for the Startup type option, under the General tab. – gpanders – 2019-03-28T17:56:20.563

4

To expand on Izzet Beltir's answer, you can simply restart the service if you want to get Cygwin working immediately.

Open an elevated command line or PowerShell window, and simply run these commands:

net stop cygservice
net start cygservice

You should now be able to open Cygwin just fine.

Benjamin Paine

Posted 2015-10-12T19:05:38.337

Reputation: 41

1I had to use cygserver instead of cygservice, but otherwise this worked for me. – gpanders – 2019-03-28T17:53:09.520

1

for the issue of
Unknown+User@DESKTOP-6SQ80GV

you need to read
https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch

as cygwin seems currently unable to recover from SSID your user profile. As W10 is recent, may be something in your configuration has not yet been considered, so best place for extra support is the main mailing list:
https://www.cygwin.com/cygwin/lists.html
https://www.cygwin.com/ml/cygwin/

matzeri

Posted 2015-10-12T19:05:38.337

Reputation: 1 662