{"id":21710671,"url":"https://github.com/mbrav/virt-cloud-init","last_synced_at":"2026-02-14T09:07:28.129Z","repository":{"id":149795124,"uuid":"599518879","full_name":"mbrav/virt-cloud-init","owner":"mbrav","description":"Script for preparing cloud init images for virt-manager","archived":false,"fork":false,"pushed_at":"2025-10-20T19:14:56.000Z","size":63,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T21:06:21.817Z","etag":null,"topics":["cloud","cloud-init","script","terminal","virt-manager","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-02-09T10:05:19.000Z","updated_at":"2025-10-20T19:15:01.000Z","dependencies_parsed_at":"2023-06-02T16:15:39.046Z","dependency_job_id":null,"html_url":"https://github.com/mbrav/virt-cloud-init","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mbrav/virt-cloud-init","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fvirt-cloud-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fvirt-cloud-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fvirt-cloud-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fvirt-cloud-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrav","download_url":"https://codeload.github.com/mbrav/virt-cloud-init/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Fvirt-cloud-init/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29441168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cloud","cloud-init","script","terminal","virt-manager","virtual-machine"],"created_at":"2024-11-25T23:16:48.433Z","updated_at":"2026-02-14T09:07:28.120Z","avatar_url":"https://github.com/mbrav.png","language":"Shell","readme":"# virt-cloud-init\n\nScript for preparing [cloud](https://github.com/canonical/cloud-init) init images for [virt-manager](https://virt-manager.org/)\n\n## Description\n\nThis is a bash script that downloads a cloud init Debian image, resizes it, generates an iso image based on *cloud-init.yml* config, then runs it using virt-manager. Once created, the VM will also be available in your [Virtual Machine Manager](https://virt-manager.org/) GUI.\n\nThe script itself is designed to work in the directory where you plan to store iso and images for your VMs. It will create the following directories when all procedures are run:\n\n```text\ncloud/\ndisk/\ndownloads/\nvirt-cloud-init.sh\ncloud-init.yml\n```\n\n- The *cloud/* folder will store all the *.iso* file that were generated based on the *cloud-init.yml* file.\n- The *disk/* folder will store disk images of your VMs.\n- The *downloads/* folder will store all the downloaded *.qcow2* images.\n\nCurrently, the script can be customized using argument flags. Other customization will be added in the future.\n\nBefore a run, edit the *cloud-init.yml* file according to your needs. Examples can be found at [cloud inits GitHub repo](https://github.com/canonical/cloud-init/tree/main/doc/examples).\n\n## Script arguments\n\nTo view script's instructions, run:\n\n```bash\n./virt-cloud-init.sh --help\n```\n\nYou will get the following text\n\n```text\nvirt-cloud-init script v0.5.0\nABOUT\nCloud init image preparation tool for virt and virt-manager\n\nSYNTAX\n./virt-cloud-init.sh [download|prepare|create|regenerate-cloud-init|all] [-h] [-n|o|m|s|c|net|img|u|i|b] [ARG]\n\nCOMMANDS\ndownload               Download iso\nprepare                Prepare image and cloud-init iso\ncreate                 Create VM with cloud-init iso (optionally can run)\nregenerate-cloud-init  Cleans VM disk off cloud-init, regenerates the iso\nall                    Run All commands above consecutively\n\nOPTIONS\n-h --help           Print this Help.\n-n --name           Specify VM and image name prefix. Default: default-vm\n-o --os             Specify OS variant. Default: debian12\n-m --memory         Specify VM memory (in MiB). Default: 2048\n-s --storage        Specify VM images size (in K|M|G). Default: 16G\n-c --cpus           Specify CPU numbers. Default: 2\n-net --network      Specify Network name for VM. Default: default\n-img --image-index  Specify a known config listed in images.ini. By default asks dynamically.\n-u --url            Specify custom url to an .qcow2 image. Default: https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-genericcloud-amd64-daily.qcow2\n-i --interactive    Flag to attaching console upon VM start (also boots the VM).\n-b --boot           Flag for booting VM after creation.\n```\n\nUpon every run, you get the following interactive prompt:\n\n```text\n0) debian13 debian-13-generic-arm64.qcow2\n1) debian12 debian-12-genericcloud-amd64-daily.qcow2\n2) debian11 debian-11-generic-amd64.qcow2\n3) debian10 debian-10-generic-amd64.qcow2\n4) ubuntu23.04 lunar-server-cloudimg-amd64.img\n5) ubuntu22.04 jammy-server-cloudimg-amd64.img\n6) ubuntu20.04 focal-server-cloudimg-amd64.img\n7) ubuntu18.04 bionic-server-cloudimg-amd64.img\n8) fedora37 Fedora-Cloud-Base-37-1.7.x86_64.qcow2\n9) fedora36 Fedora-Cloud-Base-36-1.5.x86_64.qcow2\n[✓] fedora37 Fedora-Cloud-Base-37-1.7.x86_64.qcow2 selected\n```\n\n**Note:** Ubuntu support is WIP\n\n## Examples\n\nDownload default Debian 11 image:\n\n```bash\n./virt-cloud-init.sh download\n```\n\nChange VM image name to \"my-vm\", resize it to 32GB and generate a cloud image iso with config based on `cloud-init.yml`:\n\n```bash\n./virt-cloud-init.sh prepare -n my-vm -m 4096 -s 32\n```\n\nStart VM with name \"my-vm\" and give 4096MB of memory\n\n\u003cdetails\u003e\n\u003csummary\u003eℹ Note about Virtual Machine Manager URI\u003c/summary\u003e\n\nBy default, libvert uses `qemu:///session` URI, hence, VMs created with `virt-install` will not appear in your Virtual Machine Manager GUI. To fix this issue, export the following variable:\n\n```bash\nexport LIBVIRT_DEFAULT_URI=\"qemu:///system\"\n```\n\nMore info on this issue on [StackOverflow](https://stackoverflow.com/questions/35683443/why-are-my-vms-visible-to-either-virsh-virt-manager-but-not-both)\n\n\u003c/details\u003e\n\n```bash\n./virt-cloud-init.sh run -n my-vm -m 4096\n```\n\nOnce you run initialize you vm in the output console, press `ctrl + ]` to exit tty.\n\ncd /run/media/mbrav/hd1/iso \u0026\u0026 ./virt-cloud-init.sh all -m 4096 -c 2 -s 12 -n node1\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Fvirt-cloud-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrav%2Fvirt-cloud-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Fvirt-cloud-init/lists"}