我正在尝试从一个虚拟机到另一个虚拟机进行 PXE 安装。在主机上,我使用的是 RHEL。我创建了一个虚拟机(SRV安装)与 RHEL 一起使用virt-manager
.网络是默认的(NAT)并且是隔离的。这很重要,因为我无法将虚拟机连接到网络 atm。
在虚拟机上(SRV安装)我配置了tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
pe_source = 11
cps = 100 2
flags = IPv4
}
并配置/etc/dhcp/dhcpd.conf
.
allow bootp;
allow booting;
deny unknown-clients;
option ip-fowarding false;
option mask-supplier false;
default-lease-time 86400;
max-lease-time 604800;
option time-off-set -18000;
subnet 192.168.122.0 netmask 255.255.255.0 {
range 192.168.122.2 192.168.122.254;
filename "/pxelinux.0";
next-server 192.168.122.2;
interface;
}
host srvinst {
hardware Ethernet 52:54:00:b9:89:a1;
fixed-address 192.168.122.2;
option host-name "srvinst";
}
并更改了默认网络配置/etc/libvirt/qemu/networks/default.xml
,如下pxe 设置。
<network>
<name>default</name>
<bridge name="virbr0" />
<forward/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<tftp root="/tftpboot"/>
<dhcp>
<range start="192.168.122.2" end="192.168.122.254" />
<host mac='52:54:00:53:19:33' name='srvinst' ip='192.168.122.2'/>
<host mac='52:54:00:64:61:c9' name='vm1' ip='192.168.122.3'/>
<bootp file="pxelinux.0"/>
</dhcp>
</ip>
</network>
当我创建另一个虚拟机并在 PXE 上启动时,它找不到SRV安装。
有什么线索吗?