You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04.2 Server Packer自动安装卡在subiquity/meta/status_get且SSH无法连接的问题求助

Ubuntu 22.04.2 Server Packer自动安装卡在subiquity/meta/status_get且SSH无法连接的问题求助

大家好,我最近在把Ubuntu镜像从20.04迁移到22.04.2时遇到了个头疼的问题:用Packer做自动安装时,cloud-init启动后走到subiquity/meta/status_get这一步就直接卡住挂掉了,后续连SSH也登不上。折腾了好一阵,下面是我的详细情况,希望能得到大家的帮助——哪怕只是告诉我怎么获取更多排查日志也行。

我的环境配置

  • 目标系统:Ubuntu 22.04.2 Live Server amd64
  • Packer版本:1.9.1
  • Packer核心配置参数:
    cd_files = [
      "./http/meta-data",
      "./http/user-data"
    ]
    cd_label = "cidata"
    boot_wait = "2s"
    boot_command = [
      "<enter><wait><f6><wait><esc><wait>",
      "linux /casper/vmlinuz ",
      "<wait><enter>",
      "initrd /casper/initrd",
      "<wait><enter>",
      "autoinstall",
      "<wait><enter>",
      "boot"
    ]
    
  • 极简版user-data内容:
    #cloud-config
    autoinstall:
      version: 1
      identity:
        hostname: tf-edu-ubuntu
        realname: builduser
        username: builduser
        password: "encrypted"
    

遇到的具体问题

  1. 自动安装流程卡在subiquity/meta/status_get阶段直接失败;
  2. 尝试用user-data里配置的账号密码,或是vSphere里的配置登录SSH,全都没法连上;
  3. 开启Packer日志后看到报错:
    2023/07/21 09:12:13 packer-builder-vsphere-iso plugin: [INFO] Waiting for SSH, up to timeout: 2h46m40s
    ==> vsphere-iso.this: Waiting for SSH to become available...
    2023/07/21 09:12:13 packer-builder-vsphere-iso plugin: [DEBUG] Error getting SSH config: SSH_AUTH_SOCK is not set
    

找到的解决方法

后来在犄角旮旯里挖到了可行的方案,修改boot_command为下面这样后,cloud-init终于正常工作了,问题也解决了:

boot_command = [
  "<down><down><down><end>",
  " autoinstall ds=nocloud;",
  "<F10>"
]

有没有朋友遇到过类似的问题?或者能帮忙解释下为什么原来的boot_command行不通,修改后的配置就能正常运行呀?

备注:内容来源于stack exchange,提问作者Scott Johnstone

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 08:23:00