【发布时间】:2017-09-14 07:03:05
【问题描述】:
我正在尝试使用 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 字符串 en_US
d-i 控制台设置/ask_detect boolean false
d-i 控制台设置/布局代码字符串我们
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 字符串
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options 选择手动配置网络
d-i netcfg/get_ipaddress 字符串 172.22.1.74
d-i netcfg/get_netmask 字符串 255.255.252.0
d-i netcfg/get_gateway 字符串 172.22.64.1
d-i netcfg/get_nameservers 字符串 172.22.64.1
d-i netcfg/confirm_static boolean true
d-i base-installer/kernel/override-image string linux-server
d-i 时钟设置/utc-auto boolean true
d-i 时钟设置/UTC 布尔真
d-i 时间/时区字符串美国/太平洋
d-i 时钟设置/ntp boolean true
d-i 镜像/国家字符串 US
d-i 镜像/http/代理字符串
d-i pkgsel/install-language-support boolean false
tasksel tasksel/第一个多选标准,ubuntu-server
d-i partman-auto/方法字符串正则
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto/choose_recipe 选择原子
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 用户
d-i 密码/用户名字符串 ubuntu
d-i passwd/user-password密码root123
d-i passwd/user-password-再次密码root123
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i 完成安装/reboot_in_progress 说明
【问题讨论】:
-
提供您的
preseed.cfg。 -
您指定了
"guest_os_type": "Ubuntu-64",但随后您使用了 i386 ISO,这可能不是您想要的。 -
我需要更改 precced.cfg 中的任何内容吗?
-
#d-i passwd/root-password 密码 root123 #d-i passwd/root-password-again 密码 root123
-
d-i passwd/root-login boolean false 我应该把它设为 true 吗?