Start two wine instances for two users

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
jefrie
Newbie
Newbie
Posts: 2
Joined: Fri May 15, 2009 6:16 am

Start two wine instances for two users

Post by jefrie »

Hello,

currently I am trying to create two running instances of a windows application. The crux is that I need two different users.

The first application is started under the current logged in user (user1). I have a bash script that exports a new wine prefix and starts the application in a new window (e.g. wine explorer /desktop=0,1152x890 explorer)

But next I like to start a second instance. Therefore I created a new linux user (user2). I' ll export a different wineprefix and start the app via

Code: Select all

 su user2 -c 'wine explorer /desktop=0,1152x890 explorer'
But I get the following error. I am not that familar with linux, but I thought by exporting the current display into the environment of the second user the display should work.

Code: Select all

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:ole:apartment_createwindowifneeded CreateWindow failed with error 1114
Can anybody give me a hint how to start the two apps (which should not be aware of each other).

Thanks
Jens
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Start two wine instances for two users

Post by vitamin »

jefrie wrote: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:ole:apartment_createwindowifneeded CreateWindow failed with error 1114
Exactly what it says.

One of the the thing 'su' does is removing all the environment variables. And without $DISPLAY defined nothing can connect to your current X session.
Gert van den Berg

Start two wine instances for two users

Post by Gert van den Berg »

On Fri, May 15, 2009 at 15:06, vitamin <[email protected]> wrote:
jefrie wrote:
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:ole:apartment_createwindowifneeded CreateWindow failed with error 1114
Exactly what it says.

One of the the thing 'su' does is removing all the environment variables. And without $DISPLAY defined nothing can connect to your current X session.
a work-around might be to enable XForwarding in your sshd_config and run:
ssh -X user2@localhost

This should allow you to run applications as the other user in your
current X session.

Gert
jefrie
Newbie
Newbie
Posts: 2
Joined: Fri May 15, 2009 6:16 am

Post by jefrie »

Thanks for your answers.
I will try both solutions - DISPLAY variable and ssh - on Monday. Hope one of them will work.
James Mckenzie

Start two wine instances for two users

Post by James Mckenzie »

Jefrie:

I know what you are trying to do.

First, check if the DISPLAY environment variable is set. This is the number one cause of the error you received.

Second, are you attempting to send X output to the same desktop as user1? I don't know if that is possible. You might want to talk to the folks at X.org to see if this is possible.

Third, user2 should have their own screen space when you switch.

Fourth, you might want to try using a different WINEPREFIX for the second app and starting it in its own wine process:

WINEPREFIX=$HOME/some_other_wine_installation wine program.exe

This should start a second wine process set.

James McKenzie


-----Original Message-----
From: jefrie <[email protected]>
Sent: May 15, 2009 4:55 AM
To: [email protected]
Subject: [Wine] Start two wine instances for two users

Hello,

currently I am trying to create two running instances of a windows application. The crux is that I need two different users.

The first application is started under the current logged in user (user1). I have a bash script that exports a new wine prefix and starts the application in a new window (e.g. wine explorer /desktop=0,1152x890 explorer)

But next I like to start a second instance. Therefore I created a new linux user (user2). I' ll export a different wineprefix and start the app via

Code:
su user2 -c 'wine explorer /desktop=0,1152x890 explorer'



But I get the following error. I am not that familar with linux, but I thought by exporting the current display into the environment of the second user the display should work.


Code:
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:ole:apartment_createwindowifneeded CreateWindow failed with error 1114



Can anybody give me a hint how to start the two apps (which should not be aware of each other).

Thanks
Jens



Locked