How can I get XWin to start as a Windows service?

Posted on

QUESTION :

I’m running Cygwin on Windows XP. I want XWin to start as a Windows service. How can I configure this?

ANSWER :

You don’t. Services are not supposed to have access to the1 user’s desktop – this was actually removed in Vista – and without it, XWin is sort of useless.

Just put XWin in your “Startup” folder.

(1 I said “the”, but Windows XP has “Fast User Switching” on by default. There may be multiple users logged in at the same time. Which session would XWin run on?)


[Now, I’m going to hate myself for this, but] you can run arbitrary programs as Windows services by using a Microsoft tool srvany, as described in Microsoft’s KB article “How To Create a User-Defined Service”. Along with it comes instsrv for easy installation. Do not forget to change the account your service runs on. Later, mark the service as “interactive” via sc config svcname type= interact, or via the Services manager (services.msc).

Leave a Reply

Your email address will not be published.