打包器挂在这里“vmware-iso:等待ssh变得可用”

时间:2017-09-14 07:03:06

标签: ssh vmware packer

我正在尝试使用packer在VMware上创建计算机映像。

在构建它时,它一直在等待ssh可用。这是我的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"
        }
    ]
}

此设置有任何问题吗?

这是我的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选择自动

d -i netcfg / wireless_wep string

d-i netcfg / disable_autoconfig boolean true

d -i netcfg / dhcp_failed note

d -i netcfg / dhcp_options选择手动配置网络

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时间/区域字符串US / Pacific

d-i clock-setup / ntp boolean true

d-i镜像/国家/地区字符串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选择完成

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

1 个答案:

答案 0 :(得分:0)

首先答:您需要为VNC打开防火墙。

第二个A:你需要配置一个dhcp服务器,或者你必须使用一个静态IP地址,需要在preseed.cfg和打包器模板中配置 ssh_host