gpt4 book ai didi

linux - Ubuntu 18.04/20.04 的预置文件卡在格式化磁盘屏幕上

转载 作者:行者123 更新时间:2023-12-04 18:44:07 24 4
gpt4 key购买 nike

我正在尝试创建一个工作预置文件以通过打包程序自动安装 ubuntu VM 版本 18.04 或 20.04。
packer build -var-file variables.json ubuntu_buildtemplate.json
问题是它确实启动了选择不同选项的设置,但是:

  • 在 Ubuntu 18.04 上,在“文件系统设置”屏幕上,它在“否”上循环
    弹出窗口:确认破坏性 Action 选择继续
    下面将继续安装过程并导致丢失
    选择要格式化的磁盘上的数据。
  • 在 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 做了一个工作预种子?
    我错过了什么?
    谢谢您的帮助

    最佳答案

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

    关于linux - Ubuntu 18.04/20.04 的预置文件卡在格式化磁盘屏幕上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61500905/

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