{"id":18513049,"url":"https://github.com/vmware/photon-packer-templates","last_synced_at":"2025-08-30T17:05:42.019Z","repository":{"id":35686844,"uuid":"39963306","full_name":"vmware/photon-packer-templates","owner":"vmware","description":"VMware Photon Packer Templates","archived":false,"fork":false,"pushed_at":"2022-10-20T21:34:22.000Z","size":76,"stargazers_count":34,"open_issues_count":1,"forks_count":19,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-02-17T03:19:29.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2015-07-30T17:28:22.000Z","updated_at":"2024-10-26T21:03:47.000Z","dependencies_parsed_at":"2022-09-18T05:59:29.417Z","dependency_job_id":null,"html_url":"https://github.com/vmware/photon-packer-templates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vmware/photon-packer-templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fphoton-packer-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fphoton-packer-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fphoton-packer-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fphoton-packer-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware","download_url":"https://codeload.github.com/vmware/photon-packer-templates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fphoton-packer-templates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272878320,"owners_count":25008336,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-06T15:36:22.831Z","updated_at":"2025-08-30T17:05:41.997Z","avatar_url":"https://github.com/vmware.png","language":"HCL","readme":"![VMware Photon OS][vmware-photon-logo]\n\n# Packer Templates for VMware Photon OS\n\n\u003cimg alt=\"VMware Fusion\" src=\"https://img.shields.io/badge/VMware%20Fusion-12-blue?style=for-the-badge\"\u003e \u003cimg alt=\"VMware Workstation Pro\" src=\"https://img.shields.io/badge/VMware%20Workstation%20Pro-16-blue?style=for-the-badge\"\u003e \u003cimg alt=\"VirtualBox\" src=\"https://img.shields.io/badge/VirtualBox-6.1-blue?style=for-the-badge\"\u003e\u003cbr/\u003e\n\u003cimg alt=\"Packer\" src=\"https://img.shields.io/badge/Packer-1.8.3+-blue?style=for-the-badge\u0026logo=packer\"\u003e\n\u003cimg alt=\"Vagrant\" src=\"https://img.shields.io/badge/Vagrant-2.3.1+-blue?style=for-the-badge\u0026logo=vagrant\"\u003e\n\n## Introduction\n\nThis repository provides infrastructure-as-code examples to automate the creation of [VMware Photon OS][vmware-photon] ( `x86_64` ) machine images as Vagrant boxes using Packer. These Vagrant boxes can be run on VMware Fusion, VMware Workstation Pro, and VirtualBox.\n\nThis project is also used to generate the offical [`vmware/photon`][vagrant-boxes-photon] Vagrant boxes.\n\nAll examples are authored in the HashiCorp Configuration Language (\"HCL2\").\n\nThe following builds are available:\n\n* VMware Photon OS 4.0 R2 (default)\n* VMware Photon OS 4.0 R1\n* VMware Photon OS 3.0 R3\n\n## Requirements\n\n* [HashiCorp Packer][packer] 1.8.3 or later\n  * Packer Plugin for VMware ( `vmware-iso` ) 1.0.7 or later\n  * Packer Plugin for Virtualbox ( `virtualbox-iso` ) 1.0.4 or later (Optional)\n\n      \u003e Required Packer plugins are automatically downloaded and initialized when using the `Makefile`.\n      \u003e\n      \u003e For dark sites, you may download the plugins and place these same directory as your Packer executable `/usr/local/bin` or `$HOME/.packer.d/plugins`.\n\n* [HashiCorp Vagrant][vagrant-download] 2.3.1 or later\n\n  * Vagrant Plugin for VMware ( `vagrant-vmware-desktop` ) 3.0.1 or later\n  * Vagrant [VMware Utility][vagrant-vmware-utility] 1.0.21 or later\n\n* [VMware Fusion][vmware-fusion] 12 (macOS) or [VMware Workstation Pro][vmware-workstation] 16 (Windows and Linux)\n\n* [Virtualbox][virtualbox] 6.1 (Optional)\n\nThe following software packages are recommened to be installed on the Packer host:\n\n* Git\n\n  Used for cloning the project repository.For information on installing the Git Command line tools, see [Git][git].\n\n* Microsoft Visual Code\n  \n  Used for editing configrations. For information on installing Microsoft Visual Studio Code, see [Visual Studio Code][vscode].\n  \n  The Visual Studio Code extension for Packer 0.3.0 or later is also recommended for syntax support. Learn more on the [Visual Studio Code Marketplace][vscode-packer].\n\n## Get Started\n\n### Step 1 - Clone the Repository\n\nClone the project repository.\n\n  **Example**:\n\n  ```console\n  git clone https://github.com/vmware/photon-packer-templates.git\n  ```\n\n  The general directory structure of the repository.\n\n  ```console\n  ├── scripts\n  │   ├── system\n  │   │   └── *.sh\n  │   ├── vagrant\n  │   │   ├── *.sh\n  │   │   └── *.tpl\n  │   ├── virtualbox\n  │   │   └── *.sh\n  │   ├── vmware\n  │   │   └── *.sh*\n  │   └── *.sh\n  ├── output\n  │   ├── photon-\u003cversion\u003e-\u003crelease\u003e-vagrant-\u003cprovider\u003e.box\n  │   └── manifest.json\n  ├── LICENSE\n  ├── Makefile\n  ├── NOTICE\n  ├── override.pkrvars.hcl\n  ├── photon-\u003cversion\u003e-\u003crelease\u003e.pkrvars.hcl\n  ├── photon.pkr.hcl\n  ├── photon.pkrtpl.hcl\n  ├── README.md\n  └── variables.pkr.hcl\n  ```\n\n  The files are distributed in the following directories.\n  \n* **`output`** - location of the Vagrant boxes and manifest created after the completion of the machine image build.\n\n* **`scripts`** - contains the scripts to initialize and prepare the machine image builds based on the platform for the Vagrant box.\n\n### Step 2 - Update Input Variables\n\n1. Obtain the URL, checksum type (_e.g._, `sha1`), and checksum value for the VMware Photon OS `.iso` image. This will be use in the build input variables.\n\n1. Obtain the `sha256` checksum value for the VirtualBox Guest Additions `.iso` image. This will be use as input variables when building for VirtualBox.\n\n1. Update the contents of the `photon-\u003cversion\u003e-\u003crelease\u003e.pkrvars.hcl` file, as needed.\n\n  ```hcl\n  // VMware Photon OS Settings\n\n  os_version         = \"4.0\"\n  os_release         = \"R2\"\n  iso_checksum_type  = \"sha1\"\n  iso_checksum_value = \"eeb08738209bf77306268d63b834fd91f6cecdfb\"\n  iso_url            = \"https://packages.vmware.com/photon/4.0/Rev2/iso/photon-4.0-c001795b8.iso\"\n\n  // VirtualBox Guest Additions\n\n  guest_additions_url      = \"https://download.virtualbox.org/virtualbox/6.1.40/VBoxGuestAdditions_6.1.40.iso\"\n  guest_additions_checksum = \"d456c559926f1a8fdd7259056e0a50f12339fd494122cf30db7736e2032970c6\"\n  ```\n\n1. Modify the Overrides (Optional)\n\n  The project sets input defaults in the `variables.pkr.hcl`. You can override the defaults by editing the `override.pkr.hcl` file and uncommenting the relevent overrides.\n\n  ```hcl\n  # Override the default input variable values.\n\n  # os_packagelist           = \"minimal\"\n  # vm_name                  = \"photon\"\n  # guest_additions_url      = \"https://download.virtualbox.org/virtualbox/7.0.0/VBoxGuestAdditions_7.0.0.iso\"\n  # guest_additions_checksum = \"f1e214507e4e845e18fdc4ce6ae9ab3aa3514f37d8a702201129c69ea2b3a675\"\n  # ssh_password             = \"VMw@re123!\"\n  # ssh_timeout              = \"15m\"\n  # boot_wait                = \"3s\"\n  # boot_key_interval        = \"10ms\"\n  # hardware_version_vmw     = 18\n  # headless                 = false\n  # cpu_count                = 2\n  # memory_size              = 1024\n  # disk_size                = 20480\n  # network_vmw              = nat\n  ```\n\n## Build\n\nYou can use the included `Makefile` to validate and build the all or specific machine images on macOS and Linux:\n\n```shell\n\u003e make\n\nTargets:\n  validate\n    validate-vmware-iso.vagrant-vmw\n    validate-virtualbox-iso.vagrant-vbx\n   \n  build\n    build-vmware-iso.vagrant-vmw\n    build-virtualbox-iso.vagrant-vbx\n   \n  clean\n```\n\n* **`validate`** - validates the configuration for all or specific targets.\n\n* **`build`** - runs a build for all or specific targets.\n\n* **`clean`** - removes all artifacts from the the `output` directory **and** removes the `packer_cache` directory. It **does not** remove any registered Vagrant boxes.\n\nAll required Packer plugins are automatically initialized when using validate and build options. If the plugins are not present, they will be automatically downloaded and installed.\n\nFor dark sites, you may download the plugins and place these same directory as your Packer executable `/usr/local/bin` or `$HOME/.packer.d/plugins`.\n\n**Example**: Build all targets.\n\n```shell\nmake build \n```\n\n**Example**: Build only the VMware Fusion / Workstation Pro target.\n\n```shell\nmake build-vmware-iso.vagrant-vmw\n```\n\nAlternatively, you can manually initilize, validate, and build on macOS, Linux, and Windows.\n\n**Example**: Initialize for all targets.\n\n* macOS and Linux:\n\n  ```shell\n  packer init -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows:\n\n  ```powershell\n  packer init -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n**Example**: Validate all targets.\n\n* macOS and Linux:\n\n  ```shell\n  packer validate -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows:\n\n  ```powershell\n  packer validate -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n**Example**: Build all targets.\n\n* macOS and Linux:\n\n  ```shell\n  packer build --force -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows:\n\n  ```shell\n  packer build --force -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n**Example**: Build only the VMware Fusion / Workstation Pro target.\n\n* macOS and Linux:\n\n  ```shell\n  packer build --force -only=vmware-iso.vagrant-vmw -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows:\n\n  ```powershell\n  packer build --force -only vmware-iso.vagrant-vmw -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n**Example**: Build only the VirtualBox target.\n\n* macOS and Linux:\n\n  ```shell\n  packer build --force -only=virtualbox-iso.vagrant-vbx -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows\n\n  ```powershell\n  packer build --force -only virtualbox-iso.vagrant-vbx -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n**Example**: Build only the VMware Fusion / Workstation Pro target with an input variable override for the VMware Photon OS Developer package list.\n\n* macOS and Linux:\n\n  ```shell\n  packer build --force -var os_packagelist=developer -only=vmware-iso.vagrant-vmw -var-file=photon-4.0-R2.pkrvars.hcl .\n  ```\n\n* Windows:\n\n  ```powershell\n  packer build --force -var os_packagelist=developer -only vmware-iso.vagrant-vmw -var-file .\\photon-4.0-R2.pkrvars.hcl .\n  ```\n\n## Run\n\nAfter you have created the Vagrant boxes for VMware Photon OS, you can bring them up in your provider of choice.\n\n**Example**: VMware Fusion or VMware Workstation Pro\n\n```shell\ncd output\nvagrant init photon-4.0-R2-minimal-vagrant-vmw.box\nvagrant up --provider vmware_desktop\n```\n\n**Example**: VirtualBox\n\n```shell\ncd output\nvagrant init photon-4.0-R2-minimal-vagrant-vbx.box\nvagrant up --provider virtualbox\n```\n\n**Example**: SSH to the VMware Photon OS box.\n\n```shell\n\u003e vagrant ssh\nvagrant@photon-minimal [ ~ ]$ \n```\n\nBy default, shared folders are disabled between the Vagrant box and the host.\n\nEdit the `Vagrantfile` to manage the share folders.\n\n**Example**: Enable Shared Folders\n\n```shell\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"photon-4.0-R2-minimal-vagrant-vmw.box\"\n  config.vm.synced_folder '.', '/vagrant', disabled: false\nend\n```\n\nEdit the `Vagrantfile` to modify additional provider configurations, such as CPU and memory.\n\n**Example**: Modify the CPU and Memory Resources\n\n```shell\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"photon-4.0-R2-minimal-vagrant-vmw.box\"\n  config.vm.provider \"vmware_desktop\" do |v|\n    v.vmx[\"numvcpus\"] = \"2\"\n    v.vmx[\"memsize\"] = \"2048\"\n  end\nend\n```\n\nLearn more about the Vagrant provider configurations:\n\n* [VMware Provider Configuration][vagrant-provider-config-vmware]\n* [VirtualBox Provider Configuration][vagrant-provider-config-virtualbox]\n\n[git]: https://git-scm.com\n[packer]: https://packer.io\n[vagrant-boxes-photon]: https://app.vagrantup.com/vmware/boxes/photon\n[vagrant-download]: https://vagrantup.com/downloads\n[vagrant-provider-config-vmware]: https://vagrantup.com/docs/providers/vmware/configuration\n[vagrant-provider-config-virtualbox]: https://vagrantup.com/docs/providers/virtualbox/configuration\n[vagrant-vmware-utility]: https://www.vagrantup.com/vmware/downloads\n[virtualbox]: https://virtualbox.org\n[vmware-fusion]: https://vmware.com/products/fusion\n[vmware-workstation]: https://mware.com/products/workstation-pro\n[vmware-photon]: https://vmware.github.io/photon\n[vmware-photon-logo]: logo.png\n[vscode]: https://code.visualstudio.com\n[vscode-packer]: https://marketplace.visualstudio.com/items?itemName=4ops.packer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fphoton-packer-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware%2Fphoton-packer-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fphoton-packer-templates/lists"}