Terraform is more of a deployment tool.
You can use Packer to build VMs for desktop virtualization tools like Virtualbox or VMware Workstation or server virtualization like XenServer or VMware vSphere or cloud systems like AWS EC2 or Azure VMs.
Within Packer you would use a configuration management tool like Saltstack or Chef or Ansible or Puppet (or Powershell DSC if you have existing configurations for Windows).
One of the benefits of using Packer is to have repeatable and testable builds, but you can build a base image for VMware Player/Workstation and then use the VM protection tools to make an encrypted/protected VM that won't allow modifications of the base image but instead only saves snapshots with the changes and you can set a policy to have it revert back to the base image when shut down.