I have set up Monero on Tails as described on the GitHub page: Using Tor on Tails:

sudo iptables -I OUTPUT 2 -p tcp -d -m tcp --dport 18081 -j ACCEPT
DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ip --no-igd --rpc-bind-ip \
    --data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain

However, it worked once and then I always get the following errors (though the internet connection works):

ERROR torsocks [15419]: General SOCKS server failure (in socks5_recv_connect_reply() at socks5.c:527)

Connection refused to Tor Socks (in socks5_recv_connect_replay() at socks5.c:543)

I have 3 questions:

1) I suppose I have to enter the iptables and DNS_PUBLIC command each time I start up Tails, correct? If so is there a way to make this persistent?

2) Why would I get the errors above and which steps would I have to take to avoid them?

3) Can I mine from Tails? When I tried I got an error.

2 Answers 2



Tails is a live OS, therefore changes made to your firewall (iptables) will not persist restarts. As per your last question, the iptables command is a different command to the one you are using to start Monero, thus the command:

sudo iptables -I OUTPUT 2 -p tcp -d -m tcp --dport 18081 -j ACCEPT

Needs running each time you boot into Tails and want to use Monero.

The second command:

DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ip --no-igd --rpc-bind-ip \
    --data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain

Needs running each time you wish to use Monero.

If so is there a way to make this persistent?

As Tails is a live OS, I'd imagine you would need to build your own Tails image if you want the firewall rules to be persistent.


Why would I get the errors above and which steps would I have to take to avoid them?

This is a Tor specific question. According to this answer, you need a new bridge. I suggest you ask Tor questions on the Tor StackExchange site though.


If you have the daemon running, you can mine. See the command start_mining:

help start_mining 
Command usage: 
  start_mining <addr> [<threads>|auto] [do_background_mining] [ignore_battery]

Command description: 
  Start mining for specified address. Defaults to 1 thread and no background mining. Use "auto" to autodetect optimal number of threads.

If you want to pool mine (with something like XMRig), you're going to need to add appropriate firewall rules so the miner can communicate with the pool.

  • I understand that Tails is a live OS. However, it is still possible to persistently install applications. Wouldn't there be a way to have these two commands also persisted? Feb 24, 2020 at 13:28
  • The issue isn't persistence of an installed app, rather firewall settings, which are part of the live system. I'm no expert on Tails but the answer on Tails forums for persistent changes to the firewall is building your own custom base image. One could of course make their own wrapper script to run the appropriate commands as an alternative.
    – jtgrassie
    Feb 24, 2020 at 18:18

The stackexchenge communities are great, but sometimes searching and asking in others could help you. If you look over reddit /r/tails you can find this post and this linked post. To run a sh script at startup:

  1. Use the administrator password in the additional settings
  2. Create a directory structure sudo mkdir -p /live/persistence/TailsData_unlocked/dotfiles/.config/autostart and sudo touch startup.desktop
  3. Allow RW to the folder with sudo chmod -R 777 /live/persistence/TailsData_unlocked/dotfiles/.config/autostart
  4. Write this to startup.desktop (even with a simple GUI editor)
[Desktop Entry]
  1. Write "startup.sh" in "/home/amnesia/Persistent/scripts/" with
mkdir -p /home/amnesia/Persistent/scripts/
cd /home/amnesia/Persistent/scripts/
touch startup.sh
  1. Make startup.sh executable with sudo chmod +x /home/amnesia/Persistent/scripts/startup.sh
  2. Write in the startup.sh script what you want to run at stratup (even with a simple GUI editor)

I would recommend checking this github startup.sh sample as it's more complete for your case.

Please note that it doesn't work in a virtual machine (tested personally).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.