Using OpenTofu/Terraform to create a disposable Tails virtual machine
OpenTofu
Terraform or OpenTofu (the open-source fork supported by the Linux Foundation) is a nice tool to setup the infrastructure on different cloud environments. There is also a provider that supports libvirt.
If you want to get started with OpenTofu there is a free training available from the Linux foundation:
I also joined the talk about OpenTofu and Infrastructure As Code, in general, this year in the Virtualization and Cloud Infrastructure DEV Room at FOSDEM this year:
I’ll not start to explain “Declarative” vs “Imperative” in this blog post, there’re already enough blog posts or websites that’re (trying) to explain this in more detail (the links above are a good start).
The default behaviour of OpenTofu is not to try to update an existing environment. This makes it usable to create disposable environments.
Tails
Tails is a nice GNU/Linux distribution to connect to the Tor network.
Personally, I’m less into the “privacy” aspect of the Tor network (although being aware that you’re tracked and followed is important), probably because I’m lucky to live in the “Free world”.
For people who are less lucky (People who live in a country where freedom of speech isn’t valued) or journalists for example, there’re good reasons to use the Tor network and hide their internet traffic.
tails/libvirt Terraform/OpenTofu module
To make it easier to spin up a virtual machine with the latest tail environment I created a Terraform/OpenTofu module to spin up a virtual machine with the latest Tails version on libvirt.
There’re security considerations when you run tails in a virtual machine. See
for more information.
The source code of the module is available at the git repository:
The module is published on the Terraform Registry and the OpenTofu Registry.
Have fun!
Leave a comment