can wine autostart with ubuntu boot?

Questions about Wine on Linux
Locked
game12138
Level 2
Level 2
Posts: 21
Joined: Wed Oct 10, 2018 10:35 pm

can wine autostart with ubuntu boot?

Post by game12138 »

I try to run my service on ubuntu, and I am ok run it on ubuntu-desktop.
I use wine regedit ti maike my service run with wineboot.

I try to use rc.local, but wineboot no work on it. Can someone help me?

and this is my rc.local :

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo "reg test" > /home/user/text.log
wineboot
echo "reg test" > /home/user/text2.log


I already find text 、 text2.log.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: can wine autostart with ubuntu boot?

Post by Bob Wya »

@game12138

See: WineHQ Forums: persistent wineserver.

Don't ever run Wine as root. rc.local is therefore not appropriate. See: WineHQ FAQ.

Wine typically needs to be started, within an existing X Session, unless your service is a pure Win32 console application.

Please use forum Code tags:

Code: Select all

...
for blocks of terminal output/commands/file dumps...

Bob
game12138
Level 2
Level 2
Posts: 21
Joined: Wed Oct 10, 2018 10:35 pm

Re: can wine autostart with ubuntu boot?

Post by game12138 »

Bob Wya wrote:@game12138

See: WineHQ Forums: persistent wineserver.

Don't ever run Wine as root. rc.local is therefore not appropriate. See: WineHQ FAQ.

Wine typically needs to be started, within an existing X Session, unless your service is a pure Win32 console application.

Please use forum Code tags:

Code: Select all

...
for blocks of terminal output/commands/file dumps...

Bob
@Bob Wya
after this, I try to switch to user in rc.local:

Code: Select all

/bin/su - user -c "WINEDEBUG=-all /opt/wine-devel/bin/wineboot"
wine reg work, but my service not start, it a WCF with console, any the others idea?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: can wine autostart with ubuntu boot?

Post by Bob Wya »

@game12138

See: WineHQ Forums: persistent wineserver.

Code: Select all

/opt/wine-devel/bin/wineboot
will boot your WINEPREFIX, then immediately exit, because there are no foreground Windows applications running.

You need to use:

Code: Select all

/opt/wine-devel/bin/wineservert
to run Windows services in a persistent fashion, under Wine.

Again just read the forum thread I've already linked to...
Rather than wandering off into the weeds...
You are asking for help - right??! :roll:

Bob
game12138
Level 2
Level 2
Posts: 21
Joined: Wed Oct 10, 2018 10:35 pm

Re: can wine autostart with ubuntu boot?

Post by game12138 »

Bob Wya wrote:@game12138

See: WineHQ Forums: persistent wineserver.

Code: Select all

/opt/wine-devel/bin/wineboot
will boot your WINEPREFIX, then immediately exit, because there are no foreground Windows applications running.

You need to use:

Code: Select all

/opt/wine-devel/bin/wineservert
to run Windows services in a persistent fashion, under Wine.

Again just read the forum thread I've already linked to...
Rather than wandering off into the weeds...
You are asking for help - right??! :roll:

Bob
yes, I read it befoer, I already run it in rc.local. thank you a lot.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: can wine autostart with ubuntu boot?

Post by Bob Wya »

game12138 wrote:...

yes, I read it befoer, I already run it in rc.local. thank you a lot.
Hopefully you're not trying to run wineservert though... :lol:

Bob
Locked