在VirtualBox上测试一个自动安装的ubuntu桌面,我有一个路由器,dhcp,tftp,http服务器。
这是我的pxelinux.cfg/default:
UI menu.c32
LABEL Ubuntu
MENU LABEL Ubuntu
KERNEL ubuntu/casper/vmlinuz
INITRD ubuntu/casper/initrd
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url=/dev/null url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds='nocloud-net\;s=http://192.168.1.1/' ---但是自动安装不起作用。我还是拿到了安装表格..。
我在我的http服务器上使用最小的自动安装user-data和空meta-data:
#cloud-config
autoinstall:
version: 1
identity:
hostname: test
password: $6$TgOD2MaHJ5/yy6s4$J7QZMZe/lUqOboU6M3B/MqXEnovVil2n4N1OkfDgP7.RcBXUPGxehSPF6Vy8fPt9yHf61LAGkIL8zLjFVN88i.
username: test在/var/log/apache2/access.log上,pxe引导只请求ubuntu。但是在实时环境中,我可以用wget下载用户数据和元数据文件。
用journalctl | grep autoinstall我得到
Jan 12 11:08:49 ubuntu kernel: Command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd
Jan 12 11:08:49 ubuntu kernel: Kernel command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd
Jan 12 11:08:49 ubuntu kernel: Unknown kernel command line parameters "autoinstall --- BOOT_IMAGE=ubuntu/casper/vmlinuz ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null", will be passed to user space.
Jan 12 11:08:49 ubuntu kernel: autoinstall
Jan 12 11:09:06 ubuntu /usr/libexec/gdm-x-session[1506]: Kernel command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd我用ubuntu服务器22.04、UEFI和BIOS测试了ds参数的引号和反斜杠,但它们似乎都不起作用。
发布于 2023-01-13 09:21:03
我犯了两个错误:
cloud-config-url应该是而不是/dev/nullds=nocloud-net s=工作,不需要引号或转义序列。感谢虚拟用户和安德鲁?洛瑟,你的回答都是必要的。
发布于 2023-01-12 12:10:16
欢迎,服务器找不到您的user-data文件。您需要稍微更改APPEND行
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url= url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net s=请用您的值替换和。
https://askubuntu.com/questions/1449916
复制相似问题