I am trying to create machine image on VMware using packer
.
While building it keeps on waiting for ssh to become available. This is my json:
{
"builders": [
{
"type": "vmware-iso",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"boot_wait": "10s",
"disk_size": 40960,
"guest_os_type": "Ubuntu-64",
"http_directory": "http",
"iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-i386.iso",
"iso_checksum": "1214cd22448338b60bb24f583dd8741a",
"iso_checksum_type": "md5",
"ssh_username": "ubuntu",
"ssh_password": "root123",
"remote_datastore": "aaa",
"vm_name": "aaa",
"format": "vmx",
"ssh_pty": "true",
"ssh_port": "22",
"headless": false,
"remote_type": "esx5",
"remote_host": "aaa",
"remote_username": "aaa",
"remote_password": "aaa",
"remote_port": "22",
"ssh_wait_timeout": "10000s",
"shutdown_command": "shutdown -P now"
}
]
}
Any problems with this setup?
this is my preceed.cfg:
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string 172.22.1.74
d-i netcfg/get_netmask string 255.255.252.0
d-i netcfg/get_gateway string 172.22.64.1
d-i netcfg/get_nameservers string 172.22.64.1
d-i netcfg/confirm_static boolean true
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
d-i mirror/country string US
d-i mirror/http/proxy string
d-i pkgsel/install-language-support boolean false
tasksel tasksel/first multiselect standard, ubuntu-server
d-i partman-auto/method string regular
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
d-i passwd/user-password password root123
d-i passwd/user-password-again password root123
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note
First A: You need to open your firewall for VNC.
Second A: You either need to configure a dhcp server or you have to use a static IP address which needs to be configured both in the preseed.cfg and in the packer template with ssh_host.