Run a Windows app on Linux with Wine at boot up

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
ve2pkt
Level 1
Level 1
Posts: 8
Joined: Wed Aug 31, 2016 4:34 am

Run a Windows app on Linux with Wine at boot up

Post by ve2pkt »

Good day, I wonder if this is even possible...

I need to run a windows application on linux at boot up, The application run very well if I start it manually, but really need to be able to start it up at boot up, since the Linux Box will be on a remote site, not easyly accessable.

Thanks and Happy Ney Year.

Jean
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Run a Windows app on Linux with Wine at boot up

Post by jkfloris »

This depends on whether you want to start the Windows program as a service or at a user login.
As a service create a systemd service file.

For the user, see the example at:
viewtopic.php?p=142246#p142246
ve2pkt
Level 1
Level 1
Posts: 8
Joined: Wed Aug 31, 2016 4:34 am

Re: Run a Windows app on Linux with Wine at boot up

Post by ve2pkt »

I like to run it as a service,

I tried few thing, but dosen't work,
get this error: nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
I am missing something.

this is my vara.service file

[Unit]
Description=Run VARA - Wine application
[Service]
ExecStart=/usr/bin/wine start /unix "/home/ve2pkt/.wine/drive_c/VARA FM/VARAFM.exe"
[Install]
Alias=vara.service
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Run a Windows app on Linux with Wine at boot up

Post by jkfloris »

Systemd does not know about a display until a user is logged in. In other words, you can't run a graphical program as a system wide service.

Move the vara.service file to the ~/.local/share/systemd/user/ directory.
(Create the systemd and user directory if they do not exist.)

And modify the file to something like:

Code: Select all

[Unit]
Description=Vara FM - Wine application

[Service]
Type=forking
ExecStart=/usr/bin/wine start /unix "/home/ve2pkt/.wine/drive_c/VARA FM/VARAFM.exe"
ExecStop=/usr/bin/wineserver -k

[Install]
WantedBy=graphical-session.target
Test and enable the service file:

Code: Select all

systemctl --user start vara
systemctl --user stop vara
systemctl --user enable vara
ve2pkt
Level 1
Level 1
Posts: 8
Joined: Wed Aug 31, 2016 4:34 am

Re: Run a Windows app on Linux with Wine at boot up

Post by ve2pkt »

Thanks for the info's
I did all that but get thiserror:

ve2pkt@VE2PKT-NucBox-G3:/usr/local/bin/packet/linbpq$ cd ~/.local/systemd/user/
ve2pkt@VE2PKT-NucBox-G3:~/.local/systemd/user$ ls
vara.service
ve2pkt@VE2PKT-NucBox-G3:~/.local/systemd/user$ systemctl --user start vara
Failed to start vara.service: Unit vara.service not found.
ve2pkt@VE2PKT-NucBox-G3:~/.local/systemd/user$

did a lot of reading on systemctrl, all seen OK for my, since a a Newbe at that stuff.

Thanks, I will keep digging.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Run a Windows app on Linux with Wine at boot up

Post by jkfloris »

The exact location of the service file varies between Linux distributions. Probably a search engine can answer which location should be used for your distribution.
staidtaverner
Newbie
Newbie
Posts: 1
Joined: Thu Feb 01, 2024 12:39 pm

Re: Run a Windows app on Linux with Wine at boot up

Post by staidtaverner »

I'm in need of a solution that allows me to run a Windows application on Linux during the system's boot-up sequence. While the application functions seamlessly when initiated manually, the crux of the matter lies in automating its launch during boot-up. This is particularly crucial as the Linux box in question is located at a remote site, making regular manual intervention impractical.

If anyone has experience or expertise in configuring such setups, your guidance would be immensely appreciated. I'm open to exploring different avenues, whether it involves specific tools, scripts, or any other innovative approaches to ensure the smooth initiation of this Windows application on Linux at system startup. Thank you in advance for any assistance you can provide!

Thank you.
Post Reply