PXE boot in VMWare Fusion using host-only adapter

Recently I’ve done some investigation on how to PXE-boot a system and do automatic installation. To get familiar with the techniques involved, and the software, I decided to try it on my laptop on a VM in VMWare Fusion (yes, it’s on a MAC).

How does PXE-boot work? Put really simple: if PXE-booting is used (it’s in the boot-list in the BIOS of most physical systems, and also the VMWare VM BIOS), it broadcasts it wants to use PXE on the network. A DCHP server can be configured to honour this request and send a PXE image to the machine.

Using the PXE image you can do all kinds of cool stuff, like start an attended or an unattended installation. Yes! This lets you install a linux system without using physical CD’s/DVD and going to the machine. Or even install a linux system without any involvement at all (!!!!), you just need to configure some things in advance.

Back to the MAC. This didn’t work using the host-ony adapter.

Host only adapters are setup using DHCP
This means VMWare setups a DHCP server, and you can use that by selecting the ‘host only’ adapter in the VM settings, and need to set it to DHCP in your VM.

This means that in order to setup PXE booting, we need to alter the VMWare Fusion DHCP Host Only DHCP server.

Where is the host-only vmware fusion dhcp server configuration located?
/Library/Application Support/VMware Fusion/vmnet1/dhcpd.conf

What do we need to add?
We need to add two things:
next-server: the ‘next-server’ directive needs to be pointed to the tftp server serving the PXE image.
filename: the ‘filename’ directive needs to be pointed to the PXE image file.

This is how it looks in my case:

#
# Configuration file for ISC 2.0b6pl1 vmnet-dhcpd operating on vmnet1.
#
# This file was automatically generated by the VMware configuration program.
# If you modify it, it will be backed up the next time you run the
# configuration program.
#
# We set domain-name-servers to make some DHCP clients happy
# (dhclient as configued in SuSE, TurboLinux, etc.).
# We also supply a domain name to make pump (Red Hat 6.x) happy.
#
allow unknown-clients;
default-lease-time 1800; # 30 minutes
max-lease-time 7200; # 2 hours
subnet 192.168.6.0 netmask 255.255.255.0 {
range 192.168.6.128 192.168.6.254;
filename "pxelinux.0";
next-server 192.168.6.129;
option broadcast-address 192.168.6.255;
option domain-name-servers 192.168.6.1;
option domain-name "localdomain";
}

Do not forget the ‘;’ which is needed after every line!

Advertisements
6 comments
  1. Klaas-Jan said:

    Keep in mind dat PXE boot messages are not routable so you need to configure your IP helper adress on your router if you want it across multiple subnets.

  2. Not only PXE boot messages are non-routable, broadcasts (a PXE boot message is a broadcast) are non-routable. This means the PXE broadcast can only be seen by a DHCP server in the same network.

  3. But, this setup is part of a cobbler setup in a VM. Using cobbler, I specify the MAC address of a machine, and connect it to a profile. After done that, I can startup an empty VM, and it will rollout a functioning linux system….how cool is that!

    After making the connection of the VM with a MAC address ALL is done automatically.

    Think what this will mean for a normal company……

  4. Joe said:

    Thanks for this! It works great with Fusion 5.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: