PXE使用我的kickstart文件的一部分

时间:2014-10-19 13:57:33

标签: linux ubuntu

我尝试部署更简单的方法来配置我的计算机。

我使用Ubuntu Server作为DHCP和tftp服务器来管理PXE安装。

我找到ubuntu netbootubuntu PXE install server

的帮助

一切都很好,直到我的未来安装好的计算机上的菜单。

它试图连接到ubuntu镜像..这是一个很大的问题,因为它没有互联网连接!

我已经在我的Ubuntu服务器上安装了Ubuntu Trusty的图像(感谢Apache)并且我的链接可用。

这是我的代码

DEFAULT vesamenu.c32
timeout 100
display boot.msg
menu background splash.png
menu title Welcome to my awesome installer

label Install new computer
  kernel ubuntu-installer/amd64/linux
  append ks=http://ip.local.server/ks.cfg vga=normal initird=ubuntu-installer/amd64/initrd.gz

当我决定选择"安装新计算机"它似乎工作但最后安装程序安装网络工具(配置IP v4,搜索dhcp,配置IP v6)并尝试连接到Ubuntu镜像时失败。但我不希望它连接到镜像,因为文件已经下载到我的Ubuntu服务器上(http://ip.local.server/ubuntu-trusty)。

我似乎不明白我的ks.cfg就在这里(http://ip.local.server/ks.cfg)。

ks.cfg

#Generated by Kickstart Configurator
#platform=x86

#Install OS instead of upgrade
install
#Use Web installation
url --url http://192.168.3.1/ubuntu-trusty


#### Mirror settings ###

d-i mirror/country          string fr
d-i mirror/http/hostname    string http://192.168.3.1
d-i mirror/http/directory   string /ubuntu-trusty
d-i mirror/suite            string trusty
#d-i mirror/country          string fr

#System language
lang fr_FR
#Language modules to install
langsupport fr_FR
#System keyboard
keyboard fr
#System mouse
mouse
#System timezone
timezone Europe/Paris
#Root password
rootpw --disabled
#Initial user
user myuser --fullname "MyUser" --iscrypted --password $1$tDwZTgoh$a25ayXUItWDWxdQlUg0Tk1
#Reboot after installation
reboot
#Use text mode install
text
#Use interactive kickstart installation method
interactive

#System bootloader configuration
bootloader --location=mbr 
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel 
#Disk partitioning information
part swap --size 4000 
part / --fstype ext4 --size 1 --grow 
#System authorization infomation
auth  --useshadow  --enablemd5 
#Network information
network --bootproto=static --ip=192.168.3.222 --netmask=255.255.255.0 --nameserver=192.168.3.1 --gateway=192.168.3.1
#Firewall configuration
firewall --disabled
#X Window System configuration information
#xconfig --depth=32 --resolution=2048x1536 --defaultdesktop=GNOME --startxonboot

ks.cfg文件是直接从system-config-kickstart生成的。

修改

我已经在ks.cfg上设置了静态IP,并且在我的服务器上设置了tcpdump我可以通过此IP查看请求。这意味着我的ks.cfg文件已被阅读,但我仍然不知道为什么它会在网上搜索镜像,而不是在我的服务器上搜索。

有没有人知道我的PXE安装失败的镜像研究?

提前谢谢你。

2 个答案:

答案 0 :(得分:1)

首先让我问你是否打开了你的HTTP服务器?在您的情况下, ks.cfg 文件将通过来自

的http传输进行检索
http://ip.local.server/ks.cfg

接下来,对于ks文件中的镜像参数,您必须添加类似

的内容
(Ubuntu)
#### Mirror settings.
preseed         mirror/country string manual
preseed         mirror/http/hostname string thinkmate5.ma.utexas.edu
preseed         mirror/http/directory string /mirror/precise/ubuntu
preseed         apt-setup/security_host string thinkmate5.ma.utexas.edu
preseed         apt-setup/security_path string /mirror/precise/ubuntu

(Debian)
#### Mirror settings.

d-i mirror/country          string fr
d-i mirror/http/hostname    string http://ip.local.server
d-i mirror/http/directory   string /ubuntu
d-i mirror/suite            string trusty
#d-i    mirror/http/proxy   string 

您还可以在"追加"添加镜像设置。像

一样
mirror/country=manual mirror/http/hostname=aaa.bbb.ccc.ddd mirror/http/directory=/directoryXX mirror/http/proxy=""

答案 1 :(得分:0)

使用kickstart启动有多个层,并非所有信息都从一个层发送到下一个层。

即使您的DHCP服务器已将ip和有关启动文件的信息发送到加载程序(通常是syslinux或pxelinux),此信息也不会在启动时发送到操作系统。只有在系统启动并且安装程序启动后才会读取kickstart文件(通常是anaconda)。

我认为你需要在追加行的某处传递ip = dhcp。在我的设置中,我在此行上也有keymap = dk lang = en_US来设置语言和键盘设置。