Know How - VMware Server
PXE boot of a client of VMware server
This here describes how to setup PXE boot a VMware Client from Host only interface vmnet1.
- VMware Clients are able to boot via PXE if no OS is found.
- To be able to boot via PXE you need to setup DHCP and TFTP.
- VMware comes with a DHCP server on all the internal interfaces.
- You need to install a TFTP server.
Setting up DHCP
Edit
/etc/vmware/vmnet1/dhcpd/dhcpd.conf and add following line to the subnet definiton:
filename "pxelinux.0";
next-server 192.168.68.1;
The IP is the IP of your vmnet1 Interface, see
/sbin/ifconfig vmnet1
For some reason the VMware DHCP server pretends to be on .254, which is different from the interface's IP. So you must give "next-server" in the DHCP reply.
The result looks similar to:
allow unknown-clients;
default-lease-time 1800; # 30 minutes
max-lease-time 7200; # 2 hours
subnet 192.168.68.0 netmask 255.255.255.0 {
range 192.168.68.128 192.168.68.253;
option broadcast-address 192.168.68.255;
option domain-name-servers 192.168.68.1;
option domain-name "localdomain";
filename "pxelinux.0";
next-server 192.168.68.1;
}
To edit dhcpd.conf you have to stop VMware first, so do following:
/etc/init.d/vmware stop
vi /etc/vmware/vmnet1/dhcpd/dhcpd.conf
/etc/init.d/vmware start
Setting up TFTP
Install and configure TFTP like follows
apt-get install tftpd-hpa tftp-hpa
vi /etc/default/tftpd-hpa
vi /etc/inetd.conf
/etc/init.d/openbsd-inetd stop
/etc/init.d/openbsd-inetd start
Note that this will install openbsd-inetd, too. You do not need the tftp-hpa client, but it is a good thing to have for debugging purpose.
More detailed:
/etc/default/tftpd-hpa must look like
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-l -s /var/lib/tftpboot"
This disables a running tftpd as it is more easy to configure this via the good old inetd.
/etc/inetd.conf will look like
192.168.68.1:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpboot
Note the IP number, it is taken from the DHCP subnet. You can find the host's IP number from the command
/sbin/ifconfig vmnet1
Configuring PXE
For a good start try following:
mkdir /tftpboot
cd /tftpboot
wget -np -r http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot/ubuntu-installer/i386/
mv archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot/ubuntu-installer .
rmdir -p archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot
ln -s ubuntu-installer/i386/pxelinux.0 ubuntu-installer/i386/pxelinux.cfg .
Booting PXE
Just start the VM with the interface connected to the host-only interface. If the VM does not find any OS it will boot from network.
-Tino, 2008-09-04