Packer VMWare no GUI

43 views
Skip to first unread message

Morgan Andrew Davis

unread,
Nov 4, 2020, 1:16:26 PM11/4/20
to Packer
Hello,

I'm having difficulty with packer's vmware iso builder in a linux environment. I'm accessing this environment via ssh. I've copied over a working build from my windows machine and made needed changes to file path's and such, but it fails with an "error operation was canceled." I have not been able to find a solution to this online. You'll find a file with over 200 lines of output using PACKER_LOG=1 attached here. Anyone have any thoughts as to what I can do here? 

Packer json:
{
        "builders": [{
                "type": "vmware-iso",
                "boot_command": ["<up><wait><tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}<enter>"],
                "iso_checksum": "6d44331cc4f6c506c7bbe9feb8468fad6c51a88ca1393ca6b8b486ea04bec3c1",
                "iso_url": "/home/mdavis/CentOS-7-x86_64-DVD-1810.iso",
                "ssh_pty": "true",
                "headless": "true",
                "format": "ova",
                "vmx_data": {
                        "cpuid.coresPerSocket": "1",
                        "memsize": "1024",
                        "numvcpus": "2"
                },
                "vmx_remove_ethernet_interfaces": "false",
                "disk_size": "65536",
                "ssh_username": "root",
                "ssh_password": "atomicorp",
                "ssh_wait_timeout": "10000s",
                "http_directory": "/home/mdavis/awp-packer-build/",
                "output_directory": "./vmware-ova-upload-attempt",
                "vm_name": "vmware-ova-upload-attempt-headless",
                "shutdown_command": "echo 'atomicorp' | sudo -S shutdown -P now"
        }],

        "provisioners": [{
                "type": "file",
                "source": "./firstboot.sh",
                "destination": "/root/firstboot.sh"
        },
        {
        "type": "shell",
        "expect_disconnect": "true",
        "environment_vars": [
        "CLEANUP_BUILD_TOOLS={{user `cleanup_build_tools`}}",
        "DESKTOP={{user `desktop`}}",
        "UPDATE={{user `update`}}",
        "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}",
        "SSH_USERNAME={{user `ssh_username`}}",
        "SSH_PASSWORD={{user `ssh_password`}}",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "ftp_proxy={{user `ftp_proxy`}}",
        "rsync_proxy={{user `rsync_proxy`}}",
        "no_proxy={{user `no_proxy`}}"
      ],
                "execute_command": "echo 'atomicorp' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
                "scripts": ["./desktop.sh","./vmware.sh"]
        },
        {
                "type": "shell",
                "script": "./custom-script-aslv6.sh",
                "expect_disconnect": "true"
        },
        {
                "type": "file",
                "source": "./amazoncurl-alt2.sh",
                "destination": "/tmp/amazoncurl-alt2.sh"
        },
        {
                "type": "shell",
                "inline": ["sudo mv /tmp/amazoncurl-alt2.sh /var/lib/cloud/scripts/per-once/amazoncurl-alt2.sh"]
        }],

        "post-processors" : [{
                "type": "amazon-import",
        "access_key": "AKIATNBQDFTLWSJNYR5O",
        "secret_key": "XaKjwPYkntAbW89mpFyCOpDuOozfxaairNFUXAxp",
        "region": "us-east-1",
        "s3_bucket_name": "packertestbucket",
                "ami_name": "awp_v6_11/02/2020",
        "tags": {
             "Description": "packer amazon-import v6 {{timestamp}}"
        }
        }],

        "variables": {
                "kickstart": "ks.cfg"
        }
}

Any help would be appreciated.

Morgan Davis

dragon788

unread,
Nov 5, 2020, 9:29:25 PM11/5/20
to Packer
Have you tried using SSH port forwarding to tunnel the X display from the server back to your local workstation and then set headless to false so that you can see the VMware GUI and any dialogues that it is attempting to present like a license agreement or a requirement to recompile the kernel modules?
Message has been deleted

Gabo Kete

unread,
Nov 6, 2020, 12:40:37 PM11/6/20
to Packer
can't see the packer debug log attached 

first "impression" is to make sure the root password specified in the Kickstart file is the one you have mentioned in your JSON File

"ssh_username": "root",
"ssh_password": "atomicorp"
Reply all
Reply to author
Forward
0 new messages