gpt4 book ai didi

ubuntu - 等待 SSH 可用时,packer vmware-iso 本地 ubuntu 构建挂起

转载 作者:行者123 更新时间:2023-12-04 19:00:22 28 4
gpt4 key购买 nike

封隔器版本:打包机 v1.3.3
主机平台: MacOS Mojave 10.14.2 (18C54)
您好,我正在尝试构建一个非常简单的 vmware-iso(本地而非远程)。构建开始,通过前几个步骤,但随后挂起 ==> vmware-iso: Waiting for SSH to become available...直到达到 shh_wait 超时(我尝试了几种不同的等待时间)。如果在 headless 设置为 false 的情况下运行,ubuntu 配置 vm 会显示一个屏幕,在该屏幕中它正在设置驱动器并即将格式化它们。有什么想法会导致 ssh 可用性挂起,即使它看起来在上一步中运行良好?

{
"variables": {},
"builders": [
{
"type": "vmware-iso",
"iso_url": "http://releases.ubuntu.com/bionic/ubuntu-18.04.1.0-live-server-amd64.iso",
"iso_checksum": "188741f61c23d112a2564b0a864e25a3",
"iso_checksum_type": "MD5",
"guest_os_type": "ubuntu-64",
"ssh_username": "dev",
"ssh_password": "dev",
"vm_name": "sqldb-vmware",
"ssh_port": 22,
"ssh_wait_timeout": "10m",
"vmx_data": {
"numvcpus": "2",
"memsize": "2048"
},
"http_directory" : "http",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=ubuntubase<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "20s",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
}
]
}
Packer 调试日志: https://gist.github.com/spstratis/73f4d662fd93917fb7e4a2278a5854f5
这是在等待 SSH 可用时在构建器 VM 上显示的内容。
Display on VM while waiting for SSH

最佳答案

你需要有一个 preseed.cfghttp包含安装程序如何安装 Ubuntu 的说明的目录,请参阅 Preseed wiki有关 Preseed 的更多信息。

关于ubuntu - 等待 SSH 可用时,packer vmware-iso 本地 ubuntu 构建挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54104310/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com