I am running Wine on a Linux Server so as to run some old Windows Applications.

I now need to write a script to make sure they are running.

Is it possible to create an ssh connection to the server and start the application?

e.g. if I am on the desktop, open a terminal window and run

wine "Z:\home\user\Desktop\application"

the application opens. But If I connect by SSH and run

wine "Z:\home\user\Desktop\application"

I get:

Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly. 

I'm assuming I need to tell it where to start the application rather than just starting it, but can't see how to do this?


I am currently working on a Windows PC, and connecting with Putty to the Linux/Wine server. (I also have a RDP connection so I can see the desktop).

Long term I will be running the script on another Linux server (MgmtSrv) that will make an ssh connection to the Linux/Wine server to manage it. The MgmtSrv does not have Wine installed, and does not have an X-Display set up.

  • Long term, do you need to see the Windows applications' windows? If so, where? – Stephen Kitt Jan 7 '16 at 10:17
  • Yes, the windows Applications are 'visual' applications, so they will be running on the Linux/Wine server, hence the reason for installing the X-Display on that server. – IGGt Jan 7 '16 at 10:21

As you surmise, you need to tell Wine where to display its applications. Since your Wine server has an X display, it's probably :0:

DISPLAY=:0 wine ...

should do the trick (assuming your X authentication cookies are OK; if they're not you'll get an Invalid MIT-MAGIC-COOKIE error).

| improve this answer | |
  • That makes sense. Unfortunately it still gives me the same error as initially – IGGt Jan 7 '16 at 10:39
  • 1
    From the terminal window where you can launch the Wine application properly, what does echo $DISPLAY show? – Stephen Kitt Jan 7 '16 at 10:40
  • that's got it. On the Desktop it came up as :11.0. So I then ran DISPLAY=:11.0 in my (remote) terminal and my application opened. Cheers for that. – IGGt Jan 7 '16 at 10:44
  • Thanks that's really works . – Salem F Mar 24 at 21:33

Depending on your application type, you've the following approaches:

  • If your application is console based (without graphics), run using wineconsole (not wine).
  • If you've X server installed, you need to specify DISPLAY variable to point to the right screen.
  • If you'd to run application via X11 Forwarding, configure X11Forwarding in your SSH config.
  • If you want to run graphics program headlessly, consider installing X virtual framebuffer.
| improve this answer | |

Just login as NORMAL user fixed this issue.


/root *# wine .....


/root # exit


/normal_user> ./wine yourappname  OR ./wine64 yourappname
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.