求助帖:ubuntu22.10 auto install user-data配置了为何还需要选择语言键盘(如何全自动)---done(因要连外网检测apt源)

0-现象:配置好autoinstll的PXE与user-data文件安装过程仍然要人工选语言、键盘等,非全自动;——


1.硬件环境:x86_64机器 + U盘(/dev/sda);
2.软件环境:DHCP+PXE启动做好grub与pxe的autoinstall相关文件:

3.user-data文件为人工安装一遍后获取的响应文件——/var/log/installer/autoinstall-user-data

  • #cloud-config
    autoinstall:
    apt:
    disable_components: []
    geoip: true
    preserve_sources_list: false
    primary:
    - arches:
    - amd64
    - i386
    uri: Index of /ubuntu/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
    - arches:
    - default
    uri: Index of /ubuntu-ports
    drivers:
    install: false
    identity:
    hostname: teamol
    password: $6$6GNI6HlrvEIhotl6$44incWozQaCm.HAnAI1onwZ42cLt1n/rNOHoUdzbtUjg6.utJq1.1FeBhBlgod1M7YgRts5vnmmP4RK1sg59i1
    realname: teamol
    username: teamol
    kernel:
    package: linux-generic
    keyboard:
    layout: us
    toggle: null
    variant: ''
    locale: en_US.UTF-8
    network:
    ethernets:
    enx00e04c6803e3:
    dhcp4: true
    enx4ec197e4f6ae:
    dhcp4: true
    enxe2015072449b:
    critical: true
    dhcp-identifier: mac
    dhcp4: true
    version: 2
    source:
    id: ubuntu-server
    search_drivers: false
    ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
    storage:
    config:
    - ptable: gpt
    serial: USB_SanDisk_3.2Gen1_0101025e7ed32c68c0797f41acfb4a5b9fb7c1daaf35c7ca0750772f90e0d081e4ea000000000000000000001a55885c0002530091558107952a45ec-0:0
    path: /dev/sda
    wipe: superblock-recursive
    preserve: false
    name: ''
    grub_device: false
    type: disk
    id: disk-sda
    - device: disk-sda
    size: 1127219200
    wipe: superblock
    flag: boot
    number: 1
    preserve: false
    grub_device: true
    offset: 1048576
    type: partition
    id: partition-0
    - fstype: fat32
    volume: partition-0
    preserve: false
    type: format
    id: format-0
    - device: disk-sda
    size: 2147483648
    wipe: superblock
    number: 2
    preserve: false
    grub_device: false
    offset: 1128267776
    type: partition
    id: partition-1
    - fstype: ext4
    volume: partition-1
    preserve: false
    type: format
    id: format-1
    - device: disk-sda
    size: 58253639680
    wipe: superblock
    number: 3
    preserve: false
    grub_device: false
    offset: 3275751424
    type: partition
    id: partition-2
    - name: ubuntu-vg
    devices:
    - partition-2
    preserve: false
    type: lvm_volgroup
    id: lvm_volgroup-0
    - name: ubuntu-lv
    volgroup: lvm_volgroup-0
    size: 29125246976B
    wipe: superblock
    preserve: false
    type: lvm_partition
    id: lvm_partition-0
    - fstype: ext4
    volume: lvm_partition-0
    preserve: false
    type: format
    id: format-2
    - path: /
    device: format-2
    type: mount
    id: mount-2
    - path: /boot
    device: format-1
    type: mount
    id: mount-1
    - path: /boot/efi
    device: format-0
    type: mount
    id: mount-0
    updates: security
    version: 1
### Ubuntu 20.04 自动安装概述 对于希望简化部署流程或者批量部署Ubuntu系统的用户来说,自动安装是一个非常有用的工具。通过预配置文件(preseed file),可以实现无人值守的自动化安装过程。 #### 创建Preseed 文件 为了执行自动化的Ubuntu安装,需要创建一个名为`preseed.cfg` 的预配置文件。该文件包含了整个安装过程中所需的各种参数设定。可以通过编辑器手动编写此文件或将已有的模板作为起点来修改[^1]。 ```bash nano preseed.cfg ``` #### 准备启动介质 将制作好的ISO镜像与准备完毕的preseed文件一同放置于可引导媒体中,比如USB闪存驱动器。确保在BIOS/UEFI设置里调整启动顺序使计算机优先从外部设备启动。 #### 修改GRUB 菜单以支持Autoinstall 当使用带有自定义preseed文件的Live CD/DVD或USB进行安装时,在grub菜单界面按 'e' 键编辑默认选项,并添加如下命令行参数: ```text linux /casper/vmlinuz auto=true priority=critical url=http://yourserver/preseed.cfg --- initrd /casper/initrd.lz ``` 这里的关键部分是`auto=true`, `priority=critical` 和指定远程服务器上的preseed文件位置(`url=...`)。如果是在本地存储,则可以直接指向路径而不是URL[^2]。 #### 开始自动安装 保存更改并继续启动后,系统会读取提供的preseed文件中的指令来进行全自动化的安装操作而无需人工干预直到完成。 #### 完成后的首次登录 一旦安装结束并且机器重新启动,默认情况下第一个账户将是root;因此建议立即创建一个新的标准用户账号以及更改管理员密码以增强安全性[^3]。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值