{"id":15678006,"url":"https://github.com/rgl/terraform-libvirt-windows-example","last_synced_at":"2025-05-07T01:48:35.444Z","repository":{"id":139753332,"uuid":"213759804","full_name":"rgl/terraform-libvirt-windows-example","owner":"rgl","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-16T12:58:45.000Z","size":90,"stargazers_count":14,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T05:11:13.576Z","etag":null,"topics":["example","libvirt","terraform","windows"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-08T21:36:57.000Z","updated_at":"2025-03-25T12:42:26.000Z","dependencies_parsed_at":"2025-03-10T16:35:20.083Z","dependency_job_id":"cf182fda-3992-4697-a13f-013ff940f5c0","html_url":"https://github.com/rgl/terraform-libvirt-windows-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-windows-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-windows-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-windows-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fterraform-libvirt-windows-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/terraform-libvirt-windows-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798780,"owners_count":21805880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","libvirt","terraform","windows"],"created_at":"2024-10-03T16:14:56.117Z","updated_at":"2025-05-07T01:48:35.417Z","avatar_url":"https://github.com/rgl.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usage (Ubuntu 22.04 host)\n\n**NB** For using Ansible as a provisioner see the [rgl/terraform-libvirt-ansible-windows-example repository](https://github.com/rgl/terraform-libvirt-ansible-windows-example).\n\nCreate and install the [UEFI Windows 2022 vagrant box](https://github.com/rgl/windows-vagrant).\n\nInstall the dependencies:\n\n* [Visual Studio Code](https://code.visualstudio.com).\n* [Dev Container plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).\n\nOpen this directory with the Dev Container plugin.\n\nOpen `bash` inside the Visual Studio Code Terminal.\n\nCreate the infrastructure:\n\n```bash\nterraform init\nterraform plan -out=tfplan\ntime terraform apply tfplan\n```\n\n**NB** if you have errors alike `Could not open '/var/lib/libvirt/images/terraform_example_root.img': Permission denied'` you need to reconfigure libvirt by setting `security_driver = \"none\"` in `/etc/libvirt/qemu.conf` and restart libvirt with `sudo systemctl restart libvirtd`.\n\nShow information about the libvirt/qemu guest:\n\n```bash\nvirsh dumpxml terraform_example\nvirsh qemu-agent-command terraform_example '{\"execute\":\"guest-info\"}' --pretty\nvirsh qemu-agent-command terraform_example '{\"execute\":\"guest-network-get-interfaces\"}' --pretty\n./qemu-agent-guest-exec terraform_example winrm enumerate winrm/config/listener\n./qemu-agent-guest-exec terraform_example winrm get winrm/config\n```\n\nLogin into the machine using SSH:\n\n```bash\nssh-keygen -f ~/.ssh/known_hosts -R \"$(terraform output --raw ip)\"\nssh \"vagrant@$(terraform output --raw ip)\"\nsshd -V # show the sshd version.\nssh -V  # show the ssh version.\nexit # ssh\n```\n\nLogin into the machine using PowerShell Remoting over SSH:\n\n```bash\npwsh\nEnter-PSSession -HostName \"vagrant@$(terraform output --raw ip)\"\n$PSVersionTable\nwhoami /all\nexit # Enter-PSSession\nexit # pwsh\n```\n\nDestroy the infrastructure:\n\n```bash\ntime terraform destroy -auto-approve\n```\n\nList this repository dependencies (and which have newer versions):\n\n```bash\nGITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh\n```\n\n# Virtual BMC\n\nYou can externally control the VM using the following terraform providers:\n\n* [vbmc terraform provider](https://registry.terraform.io/providers/rgl/vbmc)\n  * exposes an [IPMI](https://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface) endpoint.\n  * you can use it with [ipmitool](https://github.com/ipmitool/ipmitool).\n  * for more information see the [rgl/terraform-provider-vbmc](https://github.com/rgl/terraform-provider-vbmc) repository.\n* [sushy-vbmc terraform provider](https://registry.terraform.io/providers/rgl/sushy-vbmc)\n  * exposes a [Redfish](https://en.wikipedia.org/wiki/Redfish_(specification)) endpoint.\n  * you can use it with [redfishtool](https://github.com/DMTF/Redfishtool).\n  * for more information see the [rgl/terraform-provider-sushy-vbmc](https://github.com/rgl/terraform-provider-sushy-vbmc) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fterraform-libvirt-windows-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fterraform-libvirt-windows-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fterraform-libvirt-windows-example/lists"}