Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted

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).

share|improve this answer
Great idea with the "Startup" folder; something so obvious, but I never thought about it. – Javid Jamae Oct 14 '11 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .