[execnet-dev] how to remotely open a program on win box?

Mathieu Drapeau matdrapeau at gmail.com
Thu Jul 29 23:18:07 CEST 2010


Hi Charles,

In the source of your server script, I did change the makegateway definition
to this:

gw = execnet.makegateway("popen//pytho=C:\Python26\python.exe")

When I connect to the server, a python box pop and when I try to send basic
command to the server, I never receive any answers. The client just wait for
something.
Here is what I tried:
    ch = gw.remote_exec("import os; channel.send(os.getcwd())")
    ch.receive()

Do you know what could cause this problem?

Thanks,
Mathieu


2010/7/29 Mathieu Drapeau <matdrapeau at gmail.com>

> Hi Charles,
> I was able to install it finally, I needed to change the name of the file
> (which was socketserver.py and causes conflict).
>
> My problem now when I am trying to do a remote_exec, I am not able to debug
> what's happening in the background. Do you have an idea where/how I can see
> the trace?
>
> thanks,
> Mathieu
>
>
> 2010/7/29 Charles Solar <charlessolar at gmail.com>
>
> well, i would check the process list, see if pythonservice.exe is
>> running.  You may need to run it as admin if you are not.  Open
>> services.msc to make sure the service is actually installed ( named
>> 'python service' creatively enough).
>> If all that is working, then make sure you are connecting to it as a
>> socket gateway, not a ssh gateway.
>>
>> Another thing you may want to check, make sure you have the latest
>> version I posted which should have a class def for IOJoiner at the
>> top.  That version has a few improvements and should work better than
>> the first one i posted.
>> Also, there is a script in the execnet scripts folder called
>> socketservice.py or something which works similarly and might work
>> better for you.
>>
>> Charles
>>
>> On Thu, Jul 29, 2010 at 9:54 AM, Mathieu Drapeau <matdrapeau at gmail.com>
>> wrote:
>> > Charles,
>> > Like you mentionned the problem was with sshd which didn't have the
>> option
>> > to "interact with the desktop".
>> > This option could be enabled in the windows services panel.
>> Unfortunately,
>> > this can only be done in Windows XP pre-SP! Since then Microsoft has
>> > disabled this option for security reasons.
>> >
>> > So, I decided to switch to a socket server. I did see the socket server
>> > script you posted but I am not able to make it work.
>> > I do install and start the server but I am not able to connect to it.
>> Seems
>> > it is not running because when I try to stop it right after, it says the
>> > service has not been started.
>> >
>> > Do you have an updated version of your script? Do you have an idea why
>> the
>> > script seems not to be running?
>> >
>> > thanks,
>> > Mathieu
>> >
>> > 2010/7/27 Charles Solar <charlessolar at gmail.com>
>> >>
>> >> I suspect that cygwin's sshd probably operates in non-interactive
>> >> mode.  Check the process list on the computer, does calc.exe show up?
>> >> If so, it just means that sshd is indeed non-interactive which means
>> >> it will not spawn graphical windows for logged in users.  There is
>> >> probably some way for it to do so, but it would be a cygwin thing, not
>> >> execnet specificly =/
>> >>
>> >> Charles
>> >>
>> >> On Tue, Jul 27, 2010 at 4:36 PM, Mathieu Drapeau <matdrapeau at gmail.com
>> >
>> >> wrote:
>> >> > Hi,
>> >> > I am trying to connect to a windows box and execute a program which
>> >> > requires
>> >> > the display using execnet. The windows box has cygwin installed where
>> >> > sshd
>> >> > is running.
>> >> > Here is a small example of what I am trying to achieve.
>> >> >
>> >> >
>> >> > # remote.py script which should open the windows calculator utility
>> >> > from subprocess import call
>> >> > if __name__ == '__channelexec__':
>> >> >     call(["calc"])
>> >> >
>> >> >
>> >> > #code to run locally
>> >> > import execnet, remote
>> >> > gw = execnet.makegateway("ssh=%s" % WINBOX_IP)
>> >> > ch = gw.remote_exec (remote)
>> >> > ch.waitclose ()
>> >> >
>> >> >
>> >> > Looking on the screen of my windows box, I don't see any calculator
>> >> > program!
>> >> > Is it expected?
>> >> >
>> >> > Thanks,
>> >> > Mathieu
>> >> >
>> >> > _______________________________________________
>> >> > execnet-dev mailing list
>> >> > execnet-dev at codespeak.net
>> >> > http://codespeak.net/mailman/listinfo/execnet-dev
>> >> >
>> >> >
>> >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/execnet-dev/attachments/20100729/7db4d893/attachment.html>


More information about the execnet-dev mailing list