Whonix Wiki Download Docs News Support Tips Issues Contribute DONATE

Tor state file/folder

I’m confused after reading about the state file. I have a reason to regenerate it on the odd occasion so it would be good to know if I need to delete the whole state folder or just the state file. In the wiki “Tor Entry Guards” (I can’t add this link) it mentions them interchangeably. I guess it would depend on what the use case is but I think in some cases even if you change your entry guards then you might still be identifiable because of the other things you have cached. Say I go offline for a week then the amount of data I have to fetch when I come back online is a predictable amount as opposed to if I delete the whole state folder and refetch everything. Does this sound right or is it just the state file to worry about?

Wiki instructions consistently use Tor state folder. Doesn’t delete/move Tor /var/lib/tor/state at any place. Probably wiki should say Tor state folder instead of Tor state file.

Indeed only deleting /var/lib/tor/state in theory might not be enough. Hence replacing of the whole Tor state folder should be safer.

Thanks for your help.

There is actually a section of the documentation that runs “sudo rm /var/lib/tor/state”, it’s the section “Fresh Tor Entry Guards by Regenerating the Tor State File”. The instructions that do the whole state folder are Non-Qubes-Whonix only. Qubes-Whonix options include the state file method or creating a clone and copying the state folder back.

I have found a method for Qubes-Whonix that is basically the same as Non-Qubes-Whonix and can replace the state file method.

Before arriving at remote

  1. sudo su
  2. systemctl stop tor@default
  3. mkdir /home/user/state-backup
  4. mv /var/lib/tor/* /home/user/state-backup
  5. ls -a /var/lib/tor (verify empty, manually move anything remaining to /home/user/state-backup)
  6. Stop sys-whonix and next time you start it will have a new state folder

Before returning home

  1. sudo su
  2. systemctl stop tor@default
  3. rm -r /var/lib/tor/*
  4. mv /home/user/state-backup/* /var/lib/tor
  5. ls -a /home/user/state-backup (verify empty, manually move anything remaining to /var/lib/tor)
  6. systemctl restart tor@default

Q1) Can you see anything wrong here?
Q2) What is difference between systemctl start/stop tor@default and anon-connection-wizard connect/disable?