https://github.com/andrejmaya/vsphere-packer-vm-deployment
This repository provides a streamlined process to quickly provision an Ubuntu virtual machine on your local vSphere ESXi host using Packer. It includes a pre-configured Packer template and detailed instructions to guide you through the setup, making it ideal for building a home lab environment.
https://github.com/andrejmaya/vsphere-packer-vm-deployment
packer terraform vmware vsphere
Last synced: 25 days ago
JSON representation
This repository provides a streamlined process to quickly provision an Ubuntu virtual machine on your local vSphere ESXi host using Packer. It includes a pre-configured Packer template and detailed instructions to guide you through the setup, making it ideal for building a home lab environment.
- Host: GitHub
- URL: https://github.com/andrejmaya/vsphere-packer-vm-deployment
- Owner: andrejmaya
- Created: 2023-01-14T13:48:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-14T13:50:59.000Z (over 3 years ago)
- Last Synced: 2025-03-02T05:27:44.805Z (over 1 year ago)
- Topics: packer, terraform, vmware, vsphere
- Language: HCL
- Homepage: https://andrejmaya.medium.com/build-vms-on-local-vsphere-with-packer-13535fe551ee
- Size: 867 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Provision Ubuntu VM on a local vSphere ESXi host

## Hardware prerequisites
1. Spare x86 host like an old laptop, PC etc.
1. USB Stick with min 8 GB capacity
## Installation steps
### Installation of vSphere
* Get vSphere 8 for free for 60 days ([link](https://customerconnect.vmware.com/en/evalcenter?p=vsphere-eval-8))
* Create a bootable USB Stick with [Rufus](https://rufus.ie/en/) (Windows) or [Etcher](https://www.balena.io/etcher/)(Mac)
* Adjust your boot settings in BIOS on your target host (spare laptop, PC etc.), boot with the vSphere image and run through the installation
After you ESXi host is running you can open the vSphere console by navigating to the IP on any device in your local network.

After a successful login you will be welcomed with the vSphere management home screen

### Preparation of the Ubuntu ISO image
* Download Ubuntu ISO [here](https://ubuntu.com/download/server#downloads)
* Navigate to your datastore in vSphere and upload the ISO to a folder of your choice


Now adjust the variables in [vars.auto.pkrvars.hcl](./vars.auto.pkrvars.hcl) based on your environment parameters
## Deploy a VM
```
packer build -var 'vm_name=tf-edu-ubuntu' -var 'host_name=ubuntu4' -var 'vm_cpus=1' -var 'vm_ram=1024' -var 'vm_disk_size=6144' .
```