This guide helps you diagnose and resolve common issues with the Tor VPN System.
Symptoms:
Solutions:
Check if Tor is installed:
:::bash
tor --version
Check Tor service status:
:::bash
sudo systemctl status tor # Linux
ps aux | grep tor # macOS
tasklist | findstr tor # Windows
Check for port conflicts:
:::bash
netstat -tulnp | grep 9050
netstat -tulnp | grep 9051
Check Tor logs:
:::bash
sudo journalctl -xe | grep -i tor # Linux
tail -f /usr/local/var/log/tor/log # macOS
Restart Tor:
:::bash
sudo systemctl restart tor # Linux
sudo /etc/init.d/tor restart # init.d systems
Symptoms:
Solutions:
Check if control port is listening:
:::bash
netstat -tulnp | grep 9051
Verify torrc has ControlPort:
:::bash
cat ~/.tor_config/torrc | grep ControlPort
Check firewall:
:::bash
sudo ufw status # Linux
Test with telnet:
:::bash
telnet 127.0.0.1 9051
Check Tor is running with correct config:
:::bash
ps aux | grep "tor -f"
Symptoms:
Solutions:
Run with sudo:
:::bash
sudo python tor_vpn_beta.py
sudo python tor_auto_torrc_config.py
Check file permissions:
:::bash
ls -la ~/.tor_config/torrc
Fix permissions:
:::bash
chmod 600 ~/.tor_config/torrc
chmod 700 ~/.tor_config
Fix ownership:
:::bash
sudo chown -R $USER:$USER ~/.tor_config
Symptoms:
Solutions:
Install tkinter:
:::bash
sudo apt install python3-tk # Ubuntu/Debian
Check display environment:
:::bash
echo $DISPLAY
Try running with explicit display:
:::bash
export DISPLAY=:0
python tor_vpn_beta.py
Check for X11/Wayland issues:
:::bash
export GDK_BACKEND=x11
python tor_vpn_beta.py
Diagnosis:
# Check service status
sudo systemctl status tor
# Check for errors
sudo journalctl -xe | grep -i tor
# Try manual start
tor -f /path/to/torrc
Common Causes and Solutions:
Invalid torrc syntax
:::bash
tor --verify-config -f /path/to/torrc
Missing directories
:::bash
sudo mkdir -p /var/lib/tor
sudo chown debian-tor:debian-tor /var/lib/tor
Port conflicts
:::bash
sudo kill -9 <pid></pid>
Permission issues
:::bash
sudo chown -R debian-tor:debian-tor /var/lib/tor
Diagnosis:
# Check crash logs
sudo journalctl -u tor -n 100
# Check memory usage
ps aux | grep tor
Solutions:
Memory issues
:::bash
MaxCircuitDirtiness 300
Disk space issues
:::bash
df -h
rm -rf /var/lib/tor/cached-certs
Configuration errors
:::bash
sudo mv /etc/tor/torrc /etc/tor/torrc.backup
sudo systemctl restart tor
Symptoms:
Solutions:
Run diagnostic tool:
:::bash
python tor_diagnostic_repair.py
Test Tor connection:
:::bash
python tor_network_test.py
Check network connectivity:
:::bash
ping -c 4 8.8.8.8
Check firewall:
:::bash
sudo iptables -L -n
sudo ufw status
Verify Tor is working:
:::bash
curl --socks5 127.0.0.1:9050 https://check.torproject.org
Symptoms:
Solutions:
Test with different exit nodes:
:::bash
connect_to_tor("nl") # Netherlands
connect_to_tor("de") # Germany
Check exit node performance:
:::bash
python tor_network_test.py
Reduce circuit rebuilds:
:::bash
NewCircuitPeriod 60
Use nearby exit nodes:
:::bash
Symptoms:
Solutions:
Check internet stability:
:::bash
ping -c 100 8.8.8.8
Increase circuit lifetime:
:::bash
MaxCircuitDirtiness 600
Use stable guard nodes:
:::bash
EntryNodes {us}
GuardLifetime "30 days"
Symptoms:
Solutions:
Verify password hash:
:::bash
tor --hash-password "your_password"
Check torrc authentication:
:::bash
cat ~/.tor_config/torrc | grep HashedControlPassword
Test authentication:
:::python
from stem.control import Controller
try:
with Controller.from_port(port=9051) as controller:
controller.authenticate(password="your_password")
print("Authentication successful")
except Exception as e:
print(f"Authentication failed: {e}")
Regenerate password:
:::bash
python tor_custom_config.py
Symptoms:
Solutions:
Check cookie file exists:
:::bash
ls -la /run/tor/control.authcookie
ls -la /var/lib/tor/control_auth_cookie
Check cookie permissions:
:::bash
ls -la /run/tor/control.authcookie
Enable cookie authentication:
:::bash
CookieAuthentication 1
Restart Tor:
:::bash
sudo systemctl restart tor
Symptoms:
Solutions:
Validate configuration:
:::bash
tor --verify-config -f /path/to/torrc
Check for common errors:
Incorrect port numbers
Use configuration template:
:::bash
cp /etc/tor/torrc ~/.tor_config/torrc.backup
Symptoms:
Solutions:
Restart Tor:
:::bash
sudo systemctl restart tor
Check which config is being used:
:::bash
ps aux | grep tor
Verify config file location:
:::bash
cat ~/.tor_config/torrc
Check for multiple config files:
:::bash
sudo systemctl cat tor
Symptoms:
Solutions:
Monitor Tor CPU usage:
:::bash
top -p $(pgrep tor)
Reduce circuit count:
:::bash
MaxCircuitDirtiness 300
Disable unused features:
:::bash
Check for infinite loops in custom scripts
Symptoms:
Solutions:
Monitor memory usage:
:::bash
ps aux | grep tor
Reduce circuit count:
:::bash
MaxCircuitDirtiness 300
Clear Tor cache:
:::bash
rm -rf /var/lib/tor/cached-certs
Restart Tor:
:::bash
sudo systemctl restart tor
Symptoms:
Solutions:
Check disk usage:
:::bash
du -sh /var/lib/tor
du -sh /var/log/tor
Configure log rotation:
:::bash
Log notice file /var/log/tor/notices.log
Log warn file /var/log/tor/warnings.log
Clean old logs:
:::bash
sudo rm /var/log/tor/notices.log.
sudo rm /var/log/tor/warnings.log.
Limit data directory size:
:::bash
MaxMemInQueues 2 GB
Symptoms:
Solutions:
Check systemd status:
:::bash
systemctl is-system-running
Use init.d fallback:
:::bash
sudo /etc/init.d/tor restart
Check service file:
:::bash
systemctl cat tor
Symptoms:
Solutions:
Check iptables rules:
:::bash
sudo iptables -L -n
sudo iptables -t nat -L -n
Flush and reapply:
:::bash
sudo iptables -F
sudo iptables -t nat -F
sudo python tor_route_traffic_setup.py
Check for other firewall rules:
:::bash
sudo ufw status
Symptoms:
Solutions:
Update Homebrew:
:::bash
brew update
brew doctor
Clean and reinstall:
:::bash
brew uninstall tor
brew install tor
Symptoms:
Solutions:
Fix ownership:
:::bash
sudo chown -R $USER:staff ~/Library/Application\ Support/Tor
Check permissions:
:::bash
ls -la ~/Library/Application\ Support/Tor
Symptoms:
Solutions:
Add C:\Tor to PATH
Use full path:
:::cmd
C:\Tor\tor.exe -f C:\Tor\torrc
Symptoms:
Solutions:
Run Tor manually:
:::cmd
tor -f %APPDATA%\tor\torrc
Check Windows Event Viewer for errors
Use Task Scheduler instead of service
Run the comprehensive diagnostic tool:
python tor_diagnostic_repair.py
This tool:
Test Tor connectivity:
python tor_network_test.py
This tool:
tor --version
tor --verify-config
ps aux | grep tor
netstat -tulnp | grep tor
sudo journalctl -u tor -f
tail -f /var/log/tor/notices.log
Review Configuration
Run diagnostics
bash
python tor_diagnostic_repair.py
python tor_network_test.py
Check logs
System logs
Search existing issues
Include:
Tor version
Error Messages
Log excerpts
Steps to Reproduce
Expected vs actual behavior
Configuration
Command used
Diagnostic Output
Cause: Tor not running or control port blocked
Solution:
sudo systemctl start tor
sudo ufw allow 9051/tcp
Cause: Incorrect password or authentication method
Solution:
# Regenerate password
python tor_custom_config.py
# Or use cookie authentication
Cause: Another process using the port
Solution:
# Find and kill process
sudo lsof -i :9051
sudo kill -9 <PID>
Cause: Insufficient permissions
Solution:
# Run with sudo
sudo python <script>
# Or fix permissions
chmod 600 ~/.tor_config/torrc
Cause: Tor not installed or not in PATH
Solution:
# Install Tor
sudo apt install tor
# Or add to PATH
export PATH=$PATH:/path/to/tor
Last Updated: 2024-04-23
Wiki: Configuration
Wiki: FAQ
Wiki: Home
Wiki: Installation
Wiki: Security
Wiki: User Guide