【问题标题】:Preseed file for Ubuntu 18.04 / 20.04 hanging on formatting disk screenUbuntu 18.04 / 20.04 的预置文件挂在格式化磁盘屏幕上
【发布时间】:2020-08-13 11:43:43
【问题描述】:

我正在尝试创建一个可用的预置文件,以通过打包程序自动安装 ubuntu VM 版本 18.04 或 20.04。

packer build -var-file variables.json ubuntu_buildtemplate.json

问题在于它确实会选择不同的选项来启动设置,但是:

  • 在 Ubuntu 18.04 上,在“文件系统设置”屏幕上,它会在“否”上循环 弹出窗口:确认破坏性操作选择继续 下面将继续安装过程并导致丢失 选择要格式化的磁盘上的数据。

  • 在 Ubuntu 20.04 上卡在“引导式存储配置”
    屏幕使用整个磁盘被选中,但没有弹出验证

这是json文件:

{
    "builders": [
      {
        "type": "vsphere-iso",

        "vcenter_server": "{{user `vsphere_server`}}",
        "username":       "{{user `vsphere_username`}}",
        "password":       "{{user `vsphere_password`}}",

        "insecure_connection": "true",

        "vm_name": "T-ubuntu",
        "datastore": "{{user `vsphere_datastore`}}",
        "folder": "{{user `vsphere_folder`}}",
        "host":     "{{user `vsphere_host`}}",
        "convert_to_template": "true",
        "network": "{{user `vsphere_network`}}",
        "boot_order": "disk,cdrom",

        "guest_os_type": "ubuntu64Guest",

        "CPUs":             1,
        "RAM":              2048,
        "RAM_reserve_all": false,

        "disk_controller_type":  "pvscsi",
        "disk_size":        80000,
        "disk_thin_provisioned": false,

        "network_card": "vmxnet3",


        "ssh_username": "{{user `ssh_username`}}",
        "ssh_password": "{{user `ssh_password`}}",

        "iso_paths": [
          "[datastore1] ISO/Linux/ubuntu-18.04.4-live-server-amd64.iso"
        ],

        "boot_command": [
            " d-i auto-install/enable boolean true<wait>",
            " d-i debconf/priority select critical<wait>",

            " d-i debian-installer/locale string en_US.UTF-8<wait>",
            " d-i localechooser/supported-locales multiselect en_US.UTF-8<wait>",
            " d-i console-setup/ask_detect boolean false<wait>",
            " d-i keyboard-configuration/xkb-keymap select GB<wait>",

            " d-i /choose_interface select auto<wait>",
            " d-i netcfg/get_hostname string unassigned-hostname<wait>",
            " d-i netcfg/get_domain string unassigned-domain<wait>",
            " d-i hw-detect/load_firmware boolean true<wait>",


            " d-i mirror/country string manual<wait>",
            " d-i mirror/http/hostname string archive.ubuntu.com<wait>",
            " d-i mirror/http/directory string /ubuntu<wait>",
            " d-i mirror/http/proxy string<wait>",


            " d-i passwd/root-login boolean true<wait>",
            " d-i passwd/root-password-crypted password !!<wait>",
            " d-i passwd/make-user boolean false<wait>",


            " d-i clock-setup/utc boolean true<wait>",
            " d-i time/zone string UTC<wait>",
            " d-i clock-setup/ntp boolean true<wait>",
            " d-i clock-setup/ntp-server string ntp.ubuntu.com<wait>",

            " d-i preseed/early_command string umount /media || true<wait>",

            " d-i grub-installer/only_debian boolean true<wait>",
            " d-i grub-installer/with_other_os boolean true<wait>",

            " d-i partman-efi/non_efi_system boolean true<wait>",
            " d-i partman-auto/disk string /dev/sda<wait>",
            " d-i partman-auto/init_automatically_partition select biggest_free<wait>",
            " d-i partman-auto/method string regular<wait>",
            " d-i partman-auto/choose_recipe select atomic<wait>",

            " d-i partman/confirm_write_new_label boolean true<wait>",
            " d-i partman/choose_partition select finish<wait>",
            " d-i partman/confirm boolean true<wait>",
            " d-i partman/confirm_nooverwrite boolean true<wait>",
            " d-i partman-auto/confirm boolean true<wait>",

            " d-i base-installer/install-recommends boolean true<wait>",
            " d-i base-installer/kernel/image string linux-generic<wait>",
            " d-i debconf debconf/frontend select Noninteractive<wait>",

            " d-i apt-setup/restricted boolean true<wait>",
            " d-i apt-setup/universe boolean true<wait>",
            " d-i apt-setup/backports boolean true<wait>",
            " d-i apt-setup/use_mirror boolean false<wait>",
            " d-i apt-setup/services-select multiselect security, updates<wait>",
            " d-i apt-setup/security_host string security.ubuntu.com<wait>",
            " d-i apt-setup/security_path string /ubuntu<wait>",


            " d-i tasksel/first multiselect none<wait>",
            " d-i pkgsel/include string openssh-server python<wait>",
            " d-i pkgsel/upgrade select full-upgrade<wait>",
            " d-i pkgsel/update-policy select unattended-upgrades<wait>",


            " d-i pkgsel/include string openssh-server vim git tmux build-essential open-vm-tools telnet wget curl python<wait>",


            " d-i debian-installer/splash boolean false<wait>",
            " d-i cdrom-detect/eject boolean true<wait>",

            " d-i finish-install/reboot_in_progress note<wait>",
            " d-i debian-installer/exit/poweroff boolean true<wait>"
        ]
      }
    ],


    "provisioners": [
      {
        "type": "shell",
        "inline": ["echo 'Template build complete'"]
      }
    ]
}

有没有人为 ubuntu 做了一个工作预种子? 我错过了什么? 谢谢你的帮助

【问题讨论】:

    标签: linux ubuntu packer


    【解决方案1】:

    我遇到了同样的问题。根据https://github.com/geerlingguy/packer-ubuntu-1804/issues/7,似乎实时发布根本不起作用,切换到非实时发布对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-28
      • 2018-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多