# Using OpenTofu/Terraform to create a disposable Tails virtual machine

DevFeed: [Using OpenTofu/Terraform to create a disposable Tails virtual machine](<https://devfeed.tech/articles/using-opentofu-terraform-to-create-a-disposable-tails-virtual-machine-39535.md>)

Original publisher: [Read original article](<https://blog.wagemakers.be/blog/2025/06/22/using-opentofu-to-create-tails-environment/>)

Author: Staf Wagemakers

Published: 2025-06-22T06:37:00Z

Content type: tutorial

Language: en

Sources: [stafwag Blog](<https://devfeed.tech/sources/stafwag-blog.md>)

Topics: [opentofu](<https://devfeed.tech/topics/opentofu.md>), [Infrastructure as code](<https://devfeed.tech/topics/infrastructure-as-code.md>), [virtualization](<https://devfeed.tech/topics/virtualization.md>), [gnu linux](<https://devfeed.tech/topics/gnu-linux.md>)

Tags: [fosdem](<https://devfeed.tech/tags/fosdem.md>), [infrastructure-as-code](<https://devfeed.tech/tags/infrastructure-as-code.md>), [libvirt](<https://devfeed.tech/tags/libvirt.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-foundation](<https://devfeed.tech/tags/linux-foundation.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [opentofu](<https://devfeed.tech/tags/opentofu.md>), [tails](<https://devfeed.tech/tags/tails.md>), [terraform](<https://devfeed.tech/tags/terraform.md>), [tor](<https://devfeed.tech/tags/tor.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [virtualization](<https://devfeed.tech/tags/virtualization.md>)

## AI overview

This tutorial explains how OpenTofu and Terraform can provision disposable environments and presents a Terraform/OpenTofu module for creating a virtual machine running the latest Tails version on libvirt. It also notes security considerations for running Tails in a virtual machine.

## Source excerpt

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. https://github.com/dmacvicar/terraform-provider-libvirt If you want to get started with OpenTofu there is a free training available from the Linux foundation: https://training.linuxfoundation.org/express-learning/getting-started-with-opentofu-lfel1009/ 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: https://fosdem.org/2025/schedule/event/fosdem-2025-6057-the-iac-tooling-multiverse-and-the-future-of-iac/