[fpc-devel] Windows 32bits .EXE socket server application on Linux x64
Jy V
jyv110 at gmail.com
Tue Jan 29 11:49:39 CET 2013
I wanted to share how I have been able to setup a Windows 32 bits
executable on Ubuntu x64 using Wine,
the EXE has been compiled with Delphi (the same works with Lazarus),
the program is an embedded http server listening on port 80,
any program listening on low ports (server sockets on ports 25, 80, 110,
...) will obtain WSAEACCESS error when running it,
install Wine on your Ubuntu, then
sudo setcap cap_net_bind_service=+ep /usr/bin/wine
sudo setcap cap_net_bind_service=+ep /usr/bin/wine-preloader
sudo setcap cap_net_bind_service=+ep /usr/bin/wineserver
sudo setcap cap_net_bind_service=+ep /home/default/Demos/Bin/Ultima.exe
you are ready to run your program using:
wine /home/default/Demos/Bin/Ultima.exe
maybe you will also need
sudo capsh --inh=cap_net_bind_service --uid=1000
to obtain the uid of user "default" (if your username is "default"):
id default
this setup is very light and provide no routing overhead since it is not
using the technique of iptables
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port
8080
which is not always possible since it would require to modify the listing
ports inside your program.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130129/989e05d3/attachment.html>
More information about the fpc-devel
mailing list