{"id":15650128,"url":"https://github.com/rgl/ubuntu-vagrant","last_synced_at":"2025-08-20T14:31:23.425Z","repository":{"id":45711707,"uuid":"43052447","full_name":"rgl/ubuntu-vagrant","owner":"rgl","description":"Ubuntu Linux Vagrant Base Box (https://app.vagrantup.com/rgl)","archived":false,"fork":false,"pushed_at":"2024-11-22T08:25:13.000Z","size":113,"stargazers_count":39,"open_issues_count":0,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-10T02:10:42.208Z","etag":null,"topics":["cloud-init","libvirt","packer","proxmox","ubuntu","vagrant","vsphere"],"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}},"created_at":"2015-09-24T07:44:34.000Z","updated_at":"2024-11-22T08:25:03.000Z","dependencies_parsed_at":"2024-04-02T20:29:16.319Z","dependency_job_id":"df2e7e15-b658-4505-b9e8-6c407d726033","html_url":"https://github.com/rgl/ubuntu-vagrant","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%2Fubuntu-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fubuntu-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/ubuntu-vagrant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230431100,"owners_count":18224655,"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":["cloud-init","libvirt","packer","proxmox","ubuntu","vagrant","vsphere"],"created_at":"2024-10-03T12:33:26.999Z","updated_at":"2024-12-19T12:09:35.284Z","avatar_url":"https://github.com/rgl.png","language":"HCL","readme":"This builds an up-to-date Vagrant Ubuntu Base Box as described at the [From Iso To Vagrant Box](http://blog.ruilopes.com/from-iso-to-vagrant-box.html) article.\n\nCurrently this targets [Ubuntu 22.04 (Jammy Jellyfish)](https://wiki.ubuntu.com/JammyJellyfish/ReleaseNotes).\n\nOther Ubuntu versions might be available in a [separate branch](https://github.com/rgl/ubuntu-vagrant/branches).\n\n# Usage\n\nInstall Packer 1.7+ and Vagrant 2.2.14+.\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## 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\n# NB if you want to use Hyper-V see the Hyper-V section in this document.\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 openssh\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## 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\nvagrant up --provider=libvirt --no-destroy-on-error --no-tty\nvagrant ssh\nexit\nvagrant destroy -f\n```\n\n## Proxmox usage\n\nSet the Proxmox VE 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-ubuntu-example](https://github.com/rgl/terraform-proxmox-ubuntu-example)).\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 value 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 '\u0026\"$env:ChocolateyInstall/lib/Carbon/Carbon/Import-Carbon.ps1\"; Grant-CPermission . $env:VAGRANT_SMB_USERNAME FullControl'\nvagrant up --provider=hyperv --no-destroy-on-error --no-tty\nvagrant ssh\nexit\nvagrant destroy -f\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 VMware vSphere details and test the connection:\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\u003c'EOF'\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/ubuntu-22.04.5-live-server-amd64.iso\"\nexport VSPHERE_ESXI_HOST='esxi.local'\nexport VSPHERE_TEMPLATE_FOLDER='test/templates'\nexport VSPHERE_TEMPLATE_NAME=\"$VSPHERE_TEMPLATE_FOLDER/ubuntu-22.04-amd64-vsphere\"\nexport VSPHERE_VM_FOLDER='test'\nexport VSPHERE_VM_NAME='ubuntu-vagrant-example'\nexport VSPHERE_VLAN='packer'\nexport VSPHERE_IP_WAIT_ADDRESS='0.0.0.0/0'\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 Ubuntu ISO (you can find the full iso URL in the [ubuntu.pkr.hcl](ubuntu.pkr.hcl) file) and place it inside the datastore as defined by the `iso_paths` property that is inside the [packer template](ubuntu-vsphere.pkr.hcl) file.\n\nSee the [example Vagrantfile](example/Vagrantfile) to see how you could use a cloud-init configuration to configure the VM.\n\nType `make build-vsphere` and follow the instructions.\n\nTry the example guest:\n\n```bash\nsource secrets-vsphere.sh\ncd example\nvagrant up --provider=vsphere --no-destroy-on-error --no-tty\nvagrant ssh\nexit\nvagrant destroy -f\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fubuntu-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fubuntu-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fubuntu-vagrant/lists"}