{"id":13542569,"url":"https://github.com/rgl/debian-vagrant","last_synced_at":"2025-05-06T21:24:16.267Z","repository":{"id":30625025,"uuid":"75465091","full_name":"rgl/debian-vagrant","owner":"rgl","description":"This builds an up-to-date Vagrant Debian Base Box","archived":false,"fork":false,"pushed_at":"2025-04-11T18:17:01.000Z","size":172,"stargazers_count":17,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T14:58:22.146Z","etag":null,"topics":["debian","libvirt","packer","proxmox","vagrant"],"latest_commit_sha":null,"homepage":"","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,"zenodo":null}},"created_at":"2016-12-03T09:41:19.000Z","updated_at":"2025-04-11T18:17:05.000Z","dependencies_parsed_at":"2023-12-13T07:23:15.402Z","dependency_job_id":"a11ae2e4-6dfd-4335-b042-4afc853522e6","html_url":"https://github.com/rgl/debian-vagrant","commit_stats":{"total_commits":124,"total_committers":2,"mean_commits":62.0,"dds":"0.016129032258064502","last_synced_commit":"800f233b43cb4650593fba78cc22e601c33e4b88"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fdebian-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fdebian-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fdebian-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fdebian-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/debian-vagrant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252770427,"owners_count":21801536,"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":["debian","libvirt","packer","proxmox","vagrant"],"created_at":"2024-08-01T10:01:11.007Z","updated_at":"2025-05-06T21:24:16.260Z","avatar_url":"https://github.com/rgl.png","language":"HCL","readme":"This builds an up-to-date Vagrant Debian Base Box.\n\nCurrently this targets [Debian 12 (Bookworm)](https://www.debian.org/releases/bookworm/).\n\n\n# Usage\n\nInstall Packer 1.9+ and Vagrant 2.3+.\n\n\n## Ubuntu Host\n\nOn a Ubuntu host, install the dependencies by running the file at:\n\n    https://github.com/rgl/xfce-desktop-vagrant/blob/master/provision-virtualization-tools.sh\n\nAnd you should also install and configure the NFS server. E.g.:\n\n```bash\n# install the nfs server.\nsudo apt-get install -y nfs-kernel-server\n\n# enable password-less configuration of the nfs server exports.\nsudo bash -c 'cat \u003e/etc/sudoers.d/vagrant-synced-folders' \u003c\u003c'EOF'\nCmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\\:0 /tmp/*\nCmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports\nCmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status\nCmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start\nCmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar\n%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY\nEOF\n```\n\nFor more information see the [Vagrant NFS documentation](https://www.vagrantup.com/docs/synced-folders/nfs.html).\n\n\n## Windows Host\n\nOn a Windows host, install [Chocolatey](https://chocolatey.org/install), then execute the following PowerShell commands in a Administrator PowerShell window:\n\n```powershell\nchoco install -y packer vagrant jq msys2\n```\n\nThen open a bash shell by starting `C:\\tools\\msys64\\mingw64.exe` and install the remaining dependencies:\n\n```bash\npacman --noconfirm -Sy make zip unzip tar dos2unix netcat procps xorriso mingw-w64-x86_64-libcdio\nfor n in /*.ini; do\n    sed -i -E 's,^#?(MSYS2_PATH_TYPE)=.+,\\1=inherit,g' $n\ndone\nexit\n```\n\n**NB** The commands described in this README should be executed in a mingw64 bash shell.\n\n\n## qemu-kvm usage\n\nInstall qemu-kvm:\n\n```bash\napt-get install -y qemu-kvm\napt-get install -y sysfsutils\nsystool -m kvm_intel -v\n```\n\nType `make build-libvirt` and follow the instructions.\n\nTry the example guest:\n\n```bash\ncd example\napt-get install -y virt-manager libvirt-dev\nvagrant plugin install vagrant-libvirt # see https://github.com/vagrant-libvirt/vagrant-libvirt\nvagrant up --provider=libvirt --no-destroy-on-error\nvagrant ssh\nexit\nvagrant destroy -f\n```\n\n\n## proxmox usage\n\nInstall [proxmox](https://www.proxmox.com/en/proxmox-ve).\n\n**NB** This assumes proxmox was installed alike [rgl/proxmox-ve](https://github.com/rgl/proxmox-ve).\n\nSet your proxmox details:\n\n```bash\ncat \u003esecrets-proxmox.sh \u003c\u003cEOF\nexport PROXMOX_URL='https://192.168.1.21:8006/api2/json'\nexport PROXMOX_USERNAME='root@pam'\nexport PROXMOX_PASSWORD='vagrant'\nexport PROXMOX_NODE='pve'\nEOF\nsource secrets-proxmox.sh\n```\n\nCreate the template:\n\n```bash\nmake build-proxmox\n```\n\n**NB** There is no way to use the created template with vagrant (the [vagrant-proxmox plugin](https://github.com/telcat/vagrant-proxmox) is no longer compatible with recent vagrant versions). Instead, use packer (e.g. see this repository) or terraform (e.g. see [rgl/terraform-proxmox-debian-example](https://github.com/rgl/terraform-proxmox-debian-example)).\n\n\n## Hyper-V usage\n\nInstall [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v)\nand also install the `Windows Sandbox` feature (for some reason,\ninstalling this makes DHCP work properly in the vEthernet Default Switch).\n\nMake sure your user is in the `Hyper-V Administrators` group\nor you run with Administrative privileges.\n\nMake sure your Virtual Switch (its vEthernet network adapter) is excluded\nfrom the Windows Firewall protected network connections by executing the\nfollowing commands in a bash shell with Administrative privileges:\n\n```bash\nPowerShell -Command 'Get-NetFirewallProfile | Select-Object -Property Name,DisabledInterfaceAliases'\nPowerShell -Command 'Set-NetFirewallProfile -DisabledInterfaceAliases (Get-NetAdapter -name \"vEthernet*\" | Where-Object {$_.ifIndex}).InterfaceAlias'\n```\n\nCreate the base image in a bash shell with Administrative privileges:\n\n```bash\ncat \u003esecrets-hyperv.sh \u003c\u003c'EOF'\n# set this value when you need to set the VM Switch Name.\nexport HYPERV_SWITCH_NAME='Default Switch'\n# set this environment variable when you need to set the VM VLAN ID.\n#export HYPERV_VLAN_ID=''\n# set the credentials that the guest will use\n# to connect to this host smb share.\n# NB you should create a new local user named _vagrant_share\n#    and use that one here instead of your user credentials.\n# NB it would be nice for this user to have its credentials\n#    automatically rotated, if you implement that feature,\n#    let me known!\nexport VAGRANT_SMB_USERNAME='_vagrant_share'\nexport VAGRANT_SMB_PASSWORD=''\n# remove the virtual switch from the windows firewall.\n# NB execute if the VM fails to obtain an IP address from DHCP.\nPowerShell -Command 'Set-NetFirewallProfile -DisabledInterfaceAliases (Get-NetAdapter -name \"vEthernet*\" | Where-Object {$_.ifIndex}).InterfaceAlias'\nEOF\nsource secrets-hyperv.sh\nmake build-hyperv\n```\n\nTry the example guest:\n\n**NB** You will need Administrative privileges to create the SMB share.\n\n```bash\ncd example\n# grant $VAGRANT_SMB_USERNAME full permissions to the\n# current directory.\n# NB you must first install the Carbon PowerShell module\n#    with choco install -y carbon.\n# TODO set VM screen resolution.\nPowerShell -Command 'Import-Module Carbon; Grant-Permission . $env:VAGRANT_SMB_USERNAME FullControl'\nvagrant up --provider=hyperv --no-destroy-on-error\nvagrant ssh\nexit\nvagrant destroy -f\n```\n\n\n## VMware vSphere usage\n\nDownload [govc](https://github.com/vmware/govmomi/releases/latest) and place it inside your `/usr/local/bin` directory.\n\nSet your vSphere details, and test the connection to vSphere:\n\n```bash\nsudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev\nvagrant plugin install vagrant-vsphere\ncat \u003esecrets-vsphere.sh \u003c\u003cEOF\nexport GOVC_INSECURE='1'\nexport GOVC_HOST='vsphere.local'\nexport GOVC_URL=\"https://$GOVC_HOST/sdk\"\nexport GOVC_USERNAME='administrator@vsphere.local'\nexport GOVC_PASSWORD='password'\nexport GOVC_DATACENTER='Datacenter'\nexport GOVC_CLUSTER='Cluster'\nexport GOVC_DATASTORE='Datastore'\nexport VSPHERE_OS_ISO=\"[$GOVC_DATASTORE] iso/debian-12.10.0-amd64-netinst.iso\"\nexport VSPHERE_ESXI_HOST='esxi.local'\nexport VSPHERE_TEMPLATE_FOLDER='test/templates'\nexport VSPHERE_TEMPLATE_NAME=\"$VSPHERE_TEMPLATE_FOLDER/debian-12-amd64\"\nexport VSPHERE_VM_FOLDER='test'\nexport VSPHERE_VM_NAME='debian-vagrant-example'\nexport VSPHERE_VLAN='packer'\n# set the credentials that the guest will use\n# to connect to this host smb share.\n# NB you should create a new local user named _vagrant_share\n#    and use that one here instead of your user credentials.\n# NB it would be nice for this user to have its credentials\n#    automatically rotated, if you implement that feature,\n#    let me known!\nexport VAGRANT_SMB_USERNAME='_vagrant_share'\nexport VAGRANT_SMB_PASSWORD=''\nEOF\nsource secrets-vsphere.sh\n# see https://github.com/vmware/govmomi/blob/master/govc/USAGE.md\ngovc version\ngovc about\ngovc datacenter.info # list datacenters\ngovc find # find all managed objects\n```\n\nDownload the Debian ISO (you can find the full iso URL in the [debian.pkr.hcl](debian.pkr.hcl) file) and place it inside the datastore as defined by the `vsphere_iso_url` user variable that is inside the [packer template](debian-vsphere.pkr.hcl).\n\nSee the [example Vagrantfile](example/Vagrantfile) to see how you could use a cloud-init configuration to configure the VM.\n\nCreate the base image:\n\n```bash\nsource secrets-vsphere.sh\nmake build-vsphere\n```\n\nTry the example guest:\n\n```bash\ncd example\nvagrant up --provider=vsphere --no-destroy-on-error\nvagrant ssh\nexit\nvagrant destroy -f\n```\n\n\n# Preseed\n\nThe debian installation iso uses the\n[debian installer](https://wiki.debian.org/DebianInstaller) (aka d-i) to\ninstall debian. During the installation it will ask you some questions and\nit will also store your answers in the debconf database. After the\ninstallation is complete, you can see its contents with the following\ncommands:\n\n```bash\nsudo su -l\napt-get install debconf-utils\ndebconf-get-selections --installer\nless /var/log/installer/syslog\nls -la /var/log/installer/cdebconf\n```\n\nIn reality, before d-i asks a question, it will first look for the answer in\nits database, if its there, it will automatically continue the installation\nwithout asking the question at all.\n\nTo automate the installation, the database is populated from a\n[preseed.txt](preseed.txt) text file. d-i will get its location from the\nkernel command line `url` argument. Which will be a http address served by\npacker during the machine provisioning.\n\n\n# Reference\n\n* Debian Bookworm [Appendix B. Automating the installation using preseeding](https://www.debian.org/releases/bookworm/amd64/apb.en.html)\n* Debian Bookworm [example-preseed.txt](https://www.debian.org/releases/bookworm/example-preseed.txt)\n","funding_links":[],"categories":["HCL","vagrant"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fdebian-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fdebian-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fdebian-vagrant/lists"}