communication between linux and Wine

Questions about Wine on Linux
Locked
mrmedia
Level 2
Level 2
Posts: 19
Joined: Tue Nov 22, 2011 12:48 am

communication between linux and Wine

Post by mrmedia »

Is it possible for a data service installed on Linux to communicate and pass data to an app on Wine?

I would think that tcpip stack conversion would be similar to what a router does.

Maybe a wine proxy etc. or getting wine to listen to a port on the linux proxy???
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: communication between linux and Wine

Post by oiaohm »

mrmedia Wine is not a sandbox as such. Some areas are hard to use from Linux application to Wine application.

http://wiki.winehq.org/NamedPipes Yes namepipes are possible but insane pain in but for Linux application as it has to talk the the right wineserver to interface. Hopefully this will get simpler in future.

http://www.unixodbc.org/doc/wine.html odbc in wine by default is the host odbc(same as what other Linux applications can access). This works as long as you don't install windows/native odbc in the wineprefix. This works for databases. Like accessing Linux mysql from windows application running in wine just use normal odbc calls.

You still have normal fdopen streams http://pubs.opengroup.org/onlinepubs/79 ... dopen.html this works inside wine and outside with only very minor code differences ie some functions _ at start and others not and the file location one having to be Linux and one having to be Windows but as long as they are the same file it all joins up and both programs are aware of the encoding. winepath program is handy to get the linux path as a windows path for the windows applciation to use to open file where the stream is. fdopen streams is fairly bullet proof.

tcp/ip and udp/ip from a wine application is no different to any other Linux application running. Normally recommended to avoid the path of open your own network ports if possible. Why there are a limited number of ports and a tcp/ip or udp/ip port and the tcp/ip or udp/ip port might be network accessable(remote exploit possibliies). Ports are better saved for network traffic using well maintained and secure developed applications to open the ports. Also there is more overhead using a tcp/ip or udp/ip than just using fdopen or odbc for local Linux applications. Like http://activemq.apache.org/ applications comes to mind for the tcp/ip or udp/ip path. These is designed kinds of applications are designed as application to application information broker. Basically leave the possible exposed to network in the hands of a development team. Yes I know its more overhead using a broker but do you really trust yourself to write a secure non exploitable protocol if yes go ahead and open your own ports. If no use a broker designed protocal or something else not network exposed.

Yes there are more ways to share data from a Linux application to a windows application running in wine. Posix standard is always a good starting point.

So yes its possible to have a data service on Linux being accessed by Wine. For particular things like databases doing this is built in feature.
mrmedia
Level 2
Level 2
Posts: 19
Joined: Tue Nov 22, 2011 12:48 am

Re: communication between linux and Wine

Post by mrmedia »

Thinking aloud...
I have an app in wine the allows a proxy setting.
I can go to Linux, open a terminal, type in ssh script to get connected to a proxy that forwards traffic, then go to system/network and enter details as a manual proxy (either http or socks) - hence 1) my browser in Linux is now showing the ip of the remote proxy pc and 2) the wine app is receiving data from the proxy.
So maybe i can
a) setup squid and do something?
i.e. Linux data collection and wine front end app - communicating via squid.
b)Alternately install on remote pc and ssh forward to linux manual proxy and onto wine.

This last option is sensible - install on a linux server and consume on a linux(wine) client via ssh.
Need to test it.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: communication between linux and Wine

Post by oiaohm »

http://wiki.winehq.org/FAQ#head-d582e2a ... 5621eb220f

Setting proxy inside wine sometimes works.

Inside Linux itself you have network namespaces and iptables. So you can setup a transparent redirection to proxy for all applications including wine ones running inside a network namespace.

Wine does behave like a normal Linux application fairly much. Only catch is making sure wineserver and applications using it are in the same namespace. Some network requests by some applications can be coming from wineserver instead of the application.

Tor usage on Linux talk about a lot of the different redirection methods.
mrmedia
Level 2
Level 2
Posts: 19
Joined: Tue Nov 22, 2011 12:48 am

Re: communication between linux and Wine

Post by mrmedia »

I am wondering...... I know my app can communicate with excel - if I also install MSOffice in Wine.
But in general can my app talk to Libre Office Calc on the Linux Platform?

If not easily - I think "namedpipes" may be an option or stunnel installed on Linux and Wine.
Am I reinventing the wheel has this been discussed before.
Locked