无忧启动论坛

标题: 求个tinypxe下ubuntu用kickstart的写法 [打印本页]

作者: a22124497    时间: 2020-12-22 17:26
标题: 求个tinypxe下ubuntu用kickstart的写法
本帖最后由 a22124497 于 2020-12-22 17:29 编辑

水平在菜,用了论坛里一个兄弟的那个,
rhel的可以用
:rhel7
  initrd http://${next-server}/rhel/7/images/pxeboot/initrd.img
  chain http://${next-server}/rhel/7/images/pxeboot/vmlinuz  initrd=initrd.img ip=dhcp inst.repo=http://${next-server}/rhel/7 ksdevice=link inst.vnc inst.ks=http://${next-server}/rhel/ks7.cfg
  boot


但是怎么弄,ubuntu的都不行,用nfs都不行,
###ubuntu-installer-nfs
  set nfs_path /nfs/Ubuntu/casper
  kernel nfs://${next-server}${nfs_path}/vmlinuz || read void
  initrd nfs://${next-server}${nfs_path}/initrd || read void
  root=/dev/nfs boot=casper netboot=nfs nfsroot=${next-server}:/nfs/ubuntu initrd=initrd  quiet splash --
  boot

各种err,ubuntu的ks文件,我是在乌邦图下完成的,也是各种问题,没有centos的顺,求大佬们支招一下
18还是20都行,现在只求能启了,哎

现在用的http,他直接报
unable to find a medium containing a live file system
###ubuntu-installer-http
  set http_path /ubuntu/Ubuntu/casper
  #set imgargs vmlinuz initrd=initrd boot=casper ip=dhcp auto=true url=http://${next-server}/ubuntu/ubuntu-20.04.1-desktop-amd64.iso
  kernel http://${next-server}${http_path}/vmlinuz   || read void
  initrd http://${next-server}${http_path}/initrd || read void
  imgargs vmlinuz initrd=initrd boot=casper ip=dhcp auto=true url=http://${next-server}/ubuntu/Ubuntu autoinstall ds=nocloud-net;ks=http://${next-server}/ubuntu/ks.cfg
  boot


作者: hkkitlee    时间: 2020-12-22 19:18
redhat系列才用kickstart
Debian系列是用preseed的,所以ubuntu要用preseed方式才可以
作者: a22124497    时间: 2020-12-22 20:01
hkkitlee 发表于 2020-12-22 19:18
redhat系列才用kickstart
Debian系列是用preseed的,所以ubuntu要用preseed方式才可以

看教程也有折腾kickstart成功的,算了,我还是安心搞preseed吧

不过我pxe本地http启ubuntug还没启好呢,大佬可能指导一下
作者: mayi    时间: 2020-12-22 21:52
ubuntu各个版本不同,实现pxe的方法也不一样,不太好搞的18.04和以前的又不一样
作者: a22124497    时间: 2020-12-22 22:03
mayi 发表于 2020-12-22 21:52
ubuntu各个版本不同,实现pxe的方法也不一样,不太好搞的18.04和以前的又不一样

求指导一下,18.4,20.4都行,主要是现在不得要领,烦
作者: hkkitlee    时间: 2020-12-22 23:12
mayi 发表于 2020-12-22 21:52
ubuntu各个版本不同,实现pxe的方法也不一样,不太好搞的18.04和以前的又不一样

沒什麼各版本不同,都是一樣
作者: hkkitlee    时间: 2020-12-22 23:21
a22124497 发表于 2020-12-22 22:03
求指导一下,18.4,20.4都行,主要是现在不得要领,烦

Ubuntu官網直接有pxe詳細教學,細節都寫得清清楚楚

你的ubuntu參數錯誤, 當成live啟動但核心又不支持網絡載入live影像
作者: a22124497    时间: 2020-12-23 10:30
本帖最后由 a22124497 于 2020-12-23 10:39 编辑
hkkitlee 发表于 2020-12-22 23:21
Ubuntu官網直接有pxe詳細教學,細節都寫得清清楚楚

你的ubuntu參數錯誤, 當成live啟動但核心又不支持 ...

https://wiki.ubuntu.com/UEFI/PXE ... 83662672.1608616061


按这个说法,我是要用netboot的那个镜像里的那俩文件linux,initrd.gz来做启动核心

怎么弄,都没有从我想要指定的lan内的服务器来下文件,再试试吧

ubuntu-installer-http
  kernel http://${next-server}/ubuntu/linux
  initrd http://${next-server}/ubuntu/initrd.gz
  imgargs linux initrd=initrd.gz ks=http://${next-server}/ubuntu/ks.cfg   live-installer/net-image=http://${next-server}/ubuntu/Ubuntu/casper/filesystem.squashfs


现在ks.cfg,应该是生效了,不过好像网络有点问题,一直是ens33在查找网络

作者: hkkitlee    时间: 2020-12-23 13:38
a22124497 发表于 2020-12-23 10:30
https://wiki.ubuntu.com/UEFI/PXE ... 83662672.1608616061

你到底是要網絡安裝ubuntu;還是網絡啟動個Live來用?

建議你從最基礎沒參數啟動;之後理解核心參數,再考慮需不需要加上去。

沒從你伺服下載就是你下達的命令核心不明白了
作者: a22124497    时间: 2020-12-23 21:28
hkkitlee 发表于 2020-12-23 13:38
你到底是要網絡安裝ubuntu;還是網絡啟動個Live來用?

建議你從最基礎沒參數啟動;之後理解核心參數, ...

通过网络来安装,然后批量的布,所以才会要用ks之类的东西,
ks.cfg生效了,因为网络启动后,他没有要求我输什么机器名之类的, 现在是到了ens33那报错
我从主机上ping那个pxe的客户机,一会在,一会不在,切换了网络,他通了,也是在报错,不知道是不是要搞preseed那个文件再来指定个啥,有点乱
作者: guyouhua    时间: 2021-1-12 14:09
这个我弄成功过。
通过网络也安装成功过。
作者: guyouhua    时间: 2021-1-12 14:10
你得先找到tinypxe的官方帮助文档

作者: guyouhua    时间: 2021-1-12 14:13
本帖最后由 guyouhua 于 2021-1-12 14:15 编辑

先得添加变量:
   set boot-url http://${next-server}
   isset ${ip} || dhcp



作者: guyouhua    时间: 2021-1-12 14:14
本帖最后由 guyouhua 于 2021-1-12 14:16 编辑

添加相应的启动子菜单:
:start
  item ubuntu               Ubuntu 20.04 Lts desktop x64_Net!
作者: guyouhua    时间: 2021-1-12 14:14
本帖最后由 guyouhua 于 2021-1-12 14:17 编辑

添加相应的引导项:
:ubuntu
  kernel ${boot-url}/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${dhcp-server}:/ubuntu ip=dhcp ro
  initrd ${boot-url}/casper/initrd
  boot

作者: guyouhua    时间: 2021-1-12 14:18
本帖最后由 guyouhua 于 2021-1-12 14:24 编辑

在PxeServer所在的目录下netboot\casper的子目录中添加相应的调用文件! vmlinuz   initrd  光盘映像的casper目录里就有。
作者: guyouhua    时间: 2021-1-12 14:21
本帖最后由 guyouhua 于 2021-1-12 14:22 编辑

创建相应的NFS服务器,把它的光盘映射到NFS目录中取名字为ubuntu确保能被调用得到。也就是nfsroot=${dhcp-server}:/ubuntu有效!
作者: a22124497    时间: 2021-1-21 22:22
guyouhua 发表于 2021-1-12 14:21
创建相应的NFS服务器,把它的光盘映射到NFS目录中取名字为ubuntu确保能被调用得到。也就是nfsroot=${dhcp-s ...

自动安装 用preseed,可否给个例子呢
作者: 2012=2012    时间: 2023-3-30 20:13
已搞定20.4.3 ipxe网络启动自动安装,使用的cloud-init做配置文件
作者: 10310179@qq.com    时间: 2023-11-16 18:06
2012=2012 发表于 2023-3-30 20:13
已搞定20.4.3 ipxe网络启动自动安装,使用的cloud-init做配置文件

能分享一下吗
作者: QuadAndroid    时间: 2023-12-5 23:04
2012=2012 发表于 2023-3-30 20:13
已搞定20.4.3 ipxe网络启动自动安装,使用的cloud-init做配置文件

额?你的20.04.3 是server版的吧
作者: ljy931116    时间: 2023-12-29 09:59
感谢大佬分享哈




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3