简体   繁体   中英

Tor Win32 Service doesn't start

I have a Windows service named Tor Win32 Service that was installed by the Tor installer today but does not start. I get the message Windows could not start the Tor Win32 Service service on Local Computer. Error 1064: An exception occurred in the service when handling the control request. The service is installed with this path to the executable

"E:\...\tor browser\browser\torbrowser\tor\tor.exe" --nt-service "-f" "e:\...\tor browser\browser\torbrowser\data\tor\torrc"

This post https://tor.stackexchange.com/questions/15207/problems-with-starting-the-tor-service-on-windows-10-error-1064 suggests that the problem (when running the service for a Tor relay) is the log file path in torrc . But (a) I fixed that and it did not solve the problem and (b) I don't want to run a Tor relay anyway, I need the service to provide a proxy for my Python program.

Running into a similar issue on Windows 7 and Windows 10 using TorBrowser 8.0.2_en_US.

I usually solve it with starting Tor Browser itself even if I am not intending to use it. It seems to impact Error 1064.

The change I see is that despite having "ControlPort 9051" in the torcc file running netstat -an in the command prompt does not show port 9051 as listening or established unless I start Tor Browser itself. Running code cold in python with the correct settings for Chrome or Firefox never works.

Other issue that I've ran into with the same error code is that Tor might not be running as a service or is stopped. Win+R and services.msc should show it running.

If not install it via the command prompt (run as administrator) and type sc create "Tor Win32 Service" binPath= "\\"C:\\xxxxxxxx\\Tor\\tor.exe\\" --nt-service -f \\"C:/xxxxxxxx/Data/Tor/torrc\\"". If it is already listed in the services might be good to delete it via sc delete "Tor Win32 Service" and reinstall.

You can run Tor not as a service (without --nt-service ) inside your python application and pass your custom torrc, using -f <config> parameter. It's useful if you want to change listening port. You can use --hash-password <PASSWORD> parameter to prevent another applications to access your tor proxy.

I raised a ticket at the Tor project about this and got the following response:

Tor we ship in Tor Browser is not to be meant to be a standalone Tor. If you want to have a standalone Tor on Windows please use the expert bundle https://www.torproject.org/dist/torbrowser/7.0.11/tor-win32-0.3.1.9.zip

So I took the advice and downloaded the recommended package and the tor.exe in that package works perfectly, both from the command line and as a service.

AN's comment/question "is it the correct Tor executable?" was right on the money, though I didn't read that until after I had solved the problem. And until then I wouldn't have known how to answer it. ("Is it the correct executable? How would I know? How is one supposed to tell? The one I have won't even tell me what version it is.")

It is a puzzle to me that the Tor Browser bundle contains a program called tor.exe , and installs it as a service, when the file is not meant to be a program you can actually run. I do realize that .exe files are not always really executable, and can be simply repositories of binary resources. But you don't install such files as services. Having two files called tor.exe , one which is meant to be executed and the other not, does strike me as unnecessarily obscure.

Just open services.msc right click on Tor Win32 Service, then properties, navigate to the Log On tab and click local system account. Hit apply. Done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM