Create VMware Fusion PXE Boot Environment and Use Kickstart Profiles to Create Ubuntu Virtual Machines

• Updated May 15, 2017

It can be difficult to develop a PXE boot process if you don’t have actual servers to PXE boot. Most of us don’t have a lot of bare metal servers sitting around to use for PXE booting. Luckily, VMware Fusion provides the necessary features to PXE boot virtual machines.

The following steps apply to VMware Fusion 5 and Ubuntu Server 12.04 LTS. Adapting the steps below to different Linux distributions is out of the scope of this post, but it is possible.

From OS X, Create a New PXE Server Virtual Machine and Set Static IP Address

Download the latest Ubuntu Server 12.04 LTS ISO. I will be using ubuntu-12.04.3-server-amd64.iso throughout this post.

Once the ISO is downloaded, create a new virtual machine in VMware Fusion and call it pxe.

Once the virtual machine has finished installing and it has booted, open the virtual machine’s console in VMware Fusion, login and change eth0’s IP address from DHCP to a static IP address outside of the DHCP scope.

Before this can happen though, you need to figure out what DHCP range VMware Fusion is currently using. Open the Terminal application on OS X and run the following command:

grep range /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf

One line should be returned in the format range $STARTING_IP_ADDRESS $ENDING_IP_ADDRESS;.

For example, my output was range;. This is the range VMware Fusions’s DHCP server will pull IP addresses from to assign to new virtual machines. You do not want the PXE server to ever change its IP address, so change its IP address to something outside of the above range.

In my case, I picked an IP address between and is in use by OS X and is also in use as you will see later in the dhcpd.conf file.

Once you have picked an IP address, I picked, go back to the virtual machine’s console in VMware Fusion, login, and change eth0’s IP address from DHCP to a static IP address by doing the following:

sudo vim /etc/network/interfaces

Change everything under # The primary network interface to the following (your address and gateway may be different):

auth eth0
iface eth0 inet static

Save, quit, and restart networking:

sudo /etc/init.d/networking restart

Your virtual machine should now have a new IP address. Use ping to verify the virtual machine can talk to itself, its gateway, and the internet.

From OS X, Configure VMware Fusion’s DHCP Server to PXE Boot

Open the Terminal application on OS X and run the following command to stop all of VMware Fusions’s networking services (DHCP, NAT, etc) on vmnet1 and vmnet8 (your vmnet interfaces could be numbered differently):

sudo /Applications/VMware\ --configure

Now, open /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf with your favorite text editor.

In the subnet {} section of the dhcpd.conf file the following two lines will be added:

next-server $IP_OF_PXE_SERVER;
filename "pxelinux.0";

Replace $IP_OF_PXE_SERVER with the static IP address you set earlier. In my case it was

The dhcpd.conf file should now look like the following (your IP address ranges may be be different):

allow unknown-clients;
default-lease-time 1800;                # default is 30 minutes
max-lease-time 7200;                    # default is 2 hours
subnet netmask {
    option broadcast-address;
    option domain-name-servers;
    option domain-name localdomain;
    default-lease-time 1800;                # default is 30 minutes
    max-lease-time 7200;                    # default is 2 hours
    option netbios-name-servers;
    option routers;
    filename "pxelinux.0";
host vmnet8 {
    hardware ethernet 00:50:56:C0:00:08;
    option domain-name-servers;
    option domain-name "";
    option routers;

Lastly, start up all of VMware Fusions’s network services with the following command:

sudo /Applications/VMware\ --start

Configure PXE Server Virtual Machine

Log in to your new PXE server virtual machine.

Install the apache2 package:

sudo apt-get install apache2

Install the tftpd-hpa package:

sudo apt-get install inetutils-inetd tftpd-hpa

Copy the Ubuntu Server 12.04 LTS ISO you downloaded earlier on OS X to your PXE server virtual machine using scp, rsync, or some other method.

Mount the Ubuntu Server 12.04 LTS ISO:

sudo mount -o loop ubuntu-12.04.3-server-amd64.iso /mnt

Copy the necessary tftp boot files:

sudo cp -r /mnt/install/netboot/* /var/lib/tftpboot/

Create a folder in the public web directory for the Ubuntu Server 12.04 LTS ISO contents:

sudo mkdir -p /var/www/ubuntu-12.04.3-server-amd64

Copy the Ubuntu Server 12.04 LTS ISO contents to the public web directory:

sudo cp -r /mnt/* /var/www/ubuntu-12.04.3-server-amd64/

Unmount the Ubuntu Server 12.04 LTS ISO:

sudo umount /mnt

During installation, the installer always throws the following Debootstrap warning:

Debootstrap warning Packages was corrupt

The installer is still running when this appears. To fix it, create a Packages file:

sudo touch /var/www/ubuntu-12.04.3-server-amd64/dists/precise/restricted/binary-amd64/Packages

Create the Kickstart Profile in the public web directory:

sudo vim /var/www/ks.cfg

Put the following contents in /var/www/ks.cfg and be sure to change $PASSWORD, $IP_OF_PXE_SERVER, $USERNAME, and Full Name Here to values that match your environment:


url --url http://$IP_OF_PXE_SERVER/ubuntu-12.04.3-server-amd64

lang en_US.UTF-8
keyboard us

network --device eth0 --bootproto dhcp

timezone --utc UTC

clearpart --all --initlabel
bootloader --location=mbr

part /boot --fstype=ext3 --size=256 --asprimary
part pv.01 --size=1024 --grow --asprimary
volgroup vg_root pv.01
logvol swap --fstype swap --name=lv_swap --vgname=vg_root --size=1024
logvol / --fstype=ext4 --name=lv_root --vgname=vg_root --size=1024 --grow

auth --enableshadow --enablemd5

# $PASSWORD will be in plain text. Should use --iscrypted with a hashed password
rootpw --iscrypted $PASSWORD
# $PASSWORD will be in plain text. Should use --iscrypted with a hashed password
user $USERNAME --fullname "Full Name Here" --password $PASSWORD

firewall --disabled





# Uncomment to add user to sudoers
#usermod -aG sudo $USERNAME

# The url parameter above overwrites the default apt source list, this puts it back
cat <<'EOP'
deb precise main restricted universe
deb precise-security main restricted universe
deb precise-updates main restricted universe
) > /etc/apt/sources.list
apt-get update

Finally, start the apache2 and tftpd-hpa services:

sudo service apache2 start

sudo service tftpd-hpa start

From OS X, To Kickstart New Ubuntu Virtual Machines…

Go to VMware Fusion > File > New…

Click Continue without disc

Choose Create a custom virtual machine

Configure the new virtual machine to your liking.

Start up the virtual machine and let it PXE boot.

You should be presented with the Ubuntu logo with options to Install, Command-line install, etc.

Use the up and down arrows to highlight Install, hit Tab, and the boot options should appear.

Append the following to the boot options and be sure to change $IP_OF_PXE_SERVER and $HOSTNAME (can be short name or FQDN) to values that match your environment:

ks=http://$IP_OF_PXE_SERVER/ks.cfg hostname=$HOSTNAME

Hit Enter to begin the Kickstart process.

If everything worked, you should have a newly kickstarted Ubuntu Server 12.04 LTS virtual machine ready to go in 5 to 10 minutes.


If you found this post useful and would like to help support this site - and get something for yourself - sign up for any of the services listed below through the provided affiliate links. I will receive a referral payment from any of the services you sign-up for.

Get faster shipping and more with Amazon Prime: About to order something from Amazon but want to get more value out of the money you would normally pay for shipping? Sign-up for a free 30-day trial of Amazon Prime to get free two-day shipping, access to thousands of movies and TV shows, and more.

Thanks for reading and take care.