Categories
Design

How to pxe boot an ubuntu image from windows server 2008

Applies to

This walkthrough describes how to configure a PXE server to load WindowsВ PE by booting a client computer from the network. Using the Windows PE tools and a Windows 10 image file, you can install Windows 10 from the network.

Prerequisites

  • A deployment computer: A computer with the Windows Assessment and Deployment Kit (WindowsВ ADK) and the Windows PE add-on with ADK installed.
  • A DHCP server: A DHCP server or DHCP proxy configured to respond to PXE client requests is required.
  • A PXE server: A server running the TFTP service that can host Windows PE boot files that the client will download.
  • A file server: A server hosting a network file share.

All four of the roles specified above can be hosted on the same computer or each can be on a separate computer.

Step 1: Copy Windows PE source files

On the deployment computer, click Start, and type deployment.

Right-click Deployment and Imaging Tools Environment and then click Run as administrator. The Deployment and Imaging Tools Environment shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools.

Run the following command to copy the base WindowsВ PE files into a new folder. The script requires two arguments: hardware architecture and destination location. The value of can be x86, amd64, or arm and is a path to a local directory. If the directory does not already exist, it will be created.

For example, the following command copies amd64 architecture files to the C:\winpe_amd64 directory:

The script creates the destination directory structure and copies all the necessary files for that architecture. In the previous example, the following directories are created:

Mount the base WindowsВ PE image (winpe.wim) to the \mount directory using the DISM tool. Mounting an image file unpacks the file contents into a folder so that you can make changes directly or by using tools such as DISM. See the following example.

Verify that “The operation completed successfully” is displayed. Note: To view currently mounted images, type dism /get-MountedWiminfo.

Map a network share to the root TFTP directory on the PXE/TFTP server and create a \Boot folder. Consult your TFTP server documentation to determine the root TFTP server directory, then enable sharing for this directory, and verify it can be accessed on the network. In the following example, the PXE server name is PXE-1 and the TFTP root directory is shared using a network path of \\PXE-1\TFTPRoot:

Copy the PXE boot files from the mounted directory to the \boot folder. For example:

Copy the boot.sdi file to the PXE/TFTP server.

Copy the bootable WindowsВ PE image (boot.wim) to the \boot folder.

(Optional) Copy true type fonts to the \boot folder

Step 2: Configure boot settings and copy the BCD file

Create a BCD store using bcdedit.exe:

Configure RAMDISK settings:

The last command will return a GUID, for example:

Copy this GUID for use in the next set of commands. In each command shown, replace “GUID1” with your GUID.

Create a new boot application entry for the WindowsВ PE image:

Configure BOOTMGR settings (remember to replace GUID1 in the third command with your GUID):

Copy the BCD file to your TFTP server:

Your PXE/TFTP server is now configured. You can view the BCD settings that have been configured using the command bcdedit /store /enum all. See the following example. Note: Your GUID will be different than the one shown below.

If you start the PXE boot process, but receive the error that “The boot configuration data for your PC is missing or contains errors” then verify that \boot directory is installed under the correct TFTP server root directory. In the example used here the name of this directory is TFTPRoot, but your TFTP server might be different.

PXE boot process summary

The following summarizes the PXE client boot process.

Applies to

In this topic, you will learn how to deploy Windows 10 using Microsoft Endpoint Manager deployment packages and task sequences. This topic will walk you through the process of deploying the Windows 10 Enterprise image to a Unified Extensible Firmware Interface (UEFI) computer named PC0001. An existing Configuration Manager infrastructure that is integrated with MDT is used for the procedures in this topic.

This topic assumes that you have completed the following prerequisite procedures:

For the purposes of this guide, we will use a minimum of two server computers (DC01 and CM01) and one client computer (PC0001).

  • DC01 is a domain controller and DNS server for the contoso.com domain. DHCP services are also available and optionally installed on DC01 or another server. Note: DHCP services are required for the client (PC0001) to connect to the Windows Deployment Service (WDS).
  • CM01 is a domain member server and Configuration Manager software distribution point. In this guide CM01 is a standalone primary site server.
    • CM01 is also running WDS which will be required to start PC0001 via PXE. Note: Ensure that only CM01 is running WDS.
  • PC0001 is a client computer that is blank, or has an operating system that will be erased and replaced with Windows 10. The device must be configured to boot from the network.

If desired, PC0001 can be a VM hosted on the server HV01, which is a Hyper-V host computer that we used previously to build a Windows 10 reference image. However, if PC0001 is a VM then you must ensure it has sufficient resources available to run the Configuration Manager OSD task sequence. 2GB of RAM or more is recommended.

All servers are running Windows Server 2019. However, an earlier, supported version of Windows Server can also be used.

All server and client computers referenced in this guide are on the same subnet. This is not required, but each server and client computer must be able to connect to each other to share files, and to resolve all DNS names and Active Directory information for the contoso.com domain. Internet connectivity is also required to download OS and application updates.

No WDS console configuration is required for PXE to work. Everything is done with the Configuration Manager console.

Procedures

Start the PC0001 computer. At the Pre-Boot Execution Environment (PXE) boot menu, press Enter to allow it to PXE boot.

On the Welcome to the Task Sequence Wizard page, type in the password [email protected] and click Next.

On the Select a task sequence to run page, select Windows 10 Enterprise x64 RTM and click Next.

On the Edit Task Sequence Variables page, double-click the OSDComputerName variable, and in the Value field, type PC0001 and click OK. Then click Next.

The operating system deployment will take several minutes to complete.

You can monitor the deployment on CM01 using the MDT Deployment Workbench. When you see the PC0001 entry, double-click PC0001, and then click DaRT Remote Control and review the Remote Control option. The task sequence will run and do the following:

  • Install the Windows 10 operating system.
  • Install the Configuration Manager client and the client hotfix.
  • Join the computer to the domain.
  • Install the application added to the task sequence.

You also can use the built-in reports to get information about ongoing deployments. For example, a task sequence report gives you a quick overview of the task sequence progress.

Monitoring the deployment with MDT.

When the deployment is finished you will have a domain-joined Windows 10 computer with the Adobe Reader application installed as well as the applications that were included in the reference image, such as Office 365 Pro Plus.

Examples are provided below of various stages of deployment:

Applies to

This walkthrough describes how to configure a PXE server to load WindowsВ PE by booting a client computer from the network. Using the Windows PE tools and a Windows 10 image file, you can install Windows 10 from the network.

Prerequisites

  • A deployment computer: A computer with the Windows Assessment and Deployment Kit (WindowsВ ADK) and the Windows PE add-on with ADK installed.
  • A DHCP server: A DHCP server or DHCP proxy configured to respond to PXE client requests is required.
  • A PXE server: A server running the TFTP service that can host Windows PE boot files that the client will download.
  • A file server: A server hosting a network file share.

All four of the roles specified above can be hosted on the same computer or each can be on a separate computer.

Step 1: Copy Windows PE source files

On the deployment computer, click Start, and type deployment.

Right-click Deployment and Imaging Tools Environment and then click Run as administrator. The Deployment and Imaging Tools Environment shortcut opens a Command Prompt window and automatically sets environment variables to point to all the necessary tools.

Run the following command to copy the base WindowsВ PE files into a new folder. The script requires two arguments: hardware architecture and destination location. The value of can be x86, amd64, or arm and is a path to a local directory. If the directory does not already exist, it will be created.

For example, the following command copies amd64 architecture files to the C:\winpe_amd64 directory:

The script creates the destination directory structure and copies all the necessary files for that architecture. In the previous example, the following directories are created:

Mount the base WindowsВ PE image (winpe.wim) to the \mount directory using the DISM tool. Mounting an image file unpacks the file contents into a folder so that you can make changes directly or by using tools such as DISM. See the following example.

Verify that “The operation completed successfully” is displayed. Note: To view currently mounted images, type dism /get-MountedWiminfo.

Map a network share to the root TFTP directory on the PXE/TFTP server and create a \Boot folder. Consult your TFTP server documentation to determine the root TFTP server directory, then enable sharing for this directory, and verify it can be accessed on the network. In the following example, the PXE server name is PXE-1 and the TFTP root directory is shared using a network path of \\PXE-1\TFTPRoot:

Copy the PXE boot files from the mounted directory to the \boot folder. For example:

Copy the boot.sdi file to the PXE/TFTP server.

Copy the bootable WindowsВ PE image (boot.wim) to the \boot folder.

(Optional) Copy true type fonts to the \boot folder

Step 2: Configure boot settings and copy the BCD file

Create a BCD store using bcdedit.exe:

Configure RAMDISK settings:

The last command will return a GUID, for example:

Copy this GUID for use in the next set of commands. In each command shown, replace “GUID1” with your GUID.

Create a new boot application entry for the WindowsВ PE image:

Configure BOOTMGR settings (remember to replace GUID1 in the third command with your GUID):

Copy the BCD file to your TFTP server:

Your PXE/TFTP server is now configured. You can view the BCD settings that have been configured using the command bcdedit /store /enum all. See the following example. Note: Your GUID will be different than the one shown below.

If you start the PXE boot process, but receive the error that “The boot configuration data for your PC is missing or contains errors” then verify that \boot directory is installed under the correct TFTP server root directory. In the example used here the name of this directory is TFTPRoot, but your TFTP server might be different.

PXE boot process summary

The following summarizes the PXE client boot process.

With Ubuntu’s latest release out the door, we thought we’d celebrate by showing you how to make it centrally available on your network by using network boot (PXE).

Overview

We already showed you how to setup a PXE server in the “What Is Network Booting (PXE) and How Can You Use It?” guide, in this guide we will show you how to add the Ubuntu LiveCD to the boot options.

If you are not already using Ubuntu as your number one “go to” for troubleshooting, diagnostics and rescue procedures tool… it will probably replace all of the tools you are currently using. Also, once the machine has booted into the Ubuntu live session, it is possible to perform the OS setup like you normally would. The immediate up shut of using Ubuntu over the network, is that if your already using the CD version, you will never again be looking for the CDs you forgot in the CD drives.

Prerequisites

  • It is assumed that you have already setup the FOG server as explained in our “What Is Network Booting (PXE) and How Can You Use It?” guide.
  • All the prerequisites for the FOG setup guide apply here as well.
  • This procedure has been used to make Ubuntu 9.10 (Karmic Koala) up to and including 11.04 (Natty Narwhal) network bootable. It may work for other Ubuntu like distributions (like Linux Mint) but hasn’t been tested.
  • You will see me use VIM as the editor program, this is just because I’m used to it… you may use any other editor that you’d like.

How does it work?
In general the Ubuntu LiveCD boot process that we all know is like so:

  • You put a CD into the cdrom drive the BIOS knows how to use the cdrom enough to get the boot program on the cdrom (isolinux).
  • Isolinux is responsible for the menu options. Once you select a boot entry like “Start or install Ubuntu”, it calls the kernal + initrd (initial ram disk) files, copies them into memory and passes parameters to them.
  • The now in RAM and in control kernel + initrd start the boot process, while using the parameters that where passed to them to determine things like: should the splash screen be shown? should the output be verbose?.
  • When the inirtrd scripts have finished loading drivers and device information, they look for the Ubuntu liveCD files to continue the boot process. The normal behavior is to look in the local physical cdrom drive.

For network boot:

  • Instead of a local media such as a CD, the client is booted using it’s network card (PXE) and is supplied with PXElinux over TFTP.
  • Just like Isolinux, PXElinux is responsible for the menu options. Once you select a boot entry, it calls the Ubuntu kernal + initrd files, copies them into memory and passes parameters to them.
  • The now in RAM and in control kernel + initrd start the boot process, with our additional information that they should not be looking for the boot files in the client’s local physical cdrom drive, but rather in an NFS share on our FOG server.

This is possible because the Ubuntu creators have enabled networking by integrating, network cards drivers and protocols into the kernel + initrd files. For such an act, we can only say thank you to the Ubuntu team.

Make the Ubuntu files available on the server

The first step is to make the Ubuntu files available on the server. You may opt to simply copy them from the CD drive, or extract them from the ISO, and that will work just fine. With that said, we will make the ISO auto-mounted. While not a must, doing this will enable you to use our “How to Upgrade your Ubuntu ISO Without Re-downloading” guide, to upgrade the Ubuntu version of your network boot without going through all the procedures from scratch or alternatively, replace a single file to update the entire entry.

With the above said, This author likes keeping a couple of past versions around, until the new one has been proven absolutely stable and issues free. That is why we will make a sub-directory and mount point according to version, but know that you could bypass that to have your single point of update.

  1. Copy the ISO into the “/tftpboot/howtogeek/linux” directory
  2. Create the mount point:

sudo mkdir -p /tftpboot/howtogeek/linux/ubuntu/

/tftpboot/howtogeek/linux/ubuntu-11.04-desktop-amd64.iso /tftpboot/howtogeek/linux/ubuntu/11.04 udf,iso9660 user,loop 0 0

Note: Despite representation, this is one unbroken line.
Test that the mount point works by issuing:

ls -lash /tftpboot/howtogeek/linux/ubuntu/11.04/

Create an NFS share

While the boot procedure starts by using PXE, the actual heavy lifting is done by the NFS share on the server. As we are basing this guide on our FOG server, the NFS components and some configurations have already been done for us by the FOG team, and all we have to do is add to them our Ubuntu share.

    Edit the “exports” file to add the new share:

sudo /etc/init.d/nfs-kernel-server restart

PXE menu setup

Edit the “Linux stuff” menu:

sudo vim /tftpboot/howtogeek/menus/linux.cfg

Append to it the following:

LABEL Ubuntu Livecd 11.04
MENU DEFAULT
KERNEL howtogeek/linux/ubuntu/11.04/casper/vmlinuz
APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot= :/tftpboot/howtogeek/linux/ubuntu/11.04 initrd=howtogeek/linux/ubuntu/11.04/casper/initrd.lz quiet splash —

The above may look messy at first glance but all you have to do is replace * with the IP of your server NFS/PXE server.

For a clearer geek understanding, the text above will:

  • Create a new PXE entry in the“Linux” sub-menu called “Ubuntu 11.04”.
  • Because of the “MENU DEFAULT” parameter, this entry will be automatically selected when entering the “Linux” sub-menu.
  • Point the client to take the kernel + initrd files usinf TFTP from the relative path in the “/tftproot” directory of “howtogeek/linux/ubuntu…”
  • Point the initrd scripts to mount the “root” filesystem from the NFS share on the absolute path of “ :/tftpboot/howtogeek…”

Note: I have tried (and failed) to use a DNS name instead of an IP for the “ ”, I’m guessing that at that stage of the boot process there simply still isn’t support for DNS… success stories are welcomed.

Possible procedures

You should now be able to boot a client into Ubuntu from PXE (Usually F12).

At this stage we suggest you take the time to review some of the things you can do with this outstanding tool:

One last thing, If you create your Ubuntu ISO, using this online builder, you will be able to slipstream all of the articles above into your PXE bootable Ubuntu.

Hello,
I have tried these 2 guides on setting up a diskless PC which boots via PXE (the guide on serenux.com is more detailed):

When I try to boot the diskless machine, I receive this message:

Begin: Retrying nfs mount … Begin: Running /scripts/nfs-premount … done
mount: Protocol not supported
done.

[it keeps repeating those for a while, then:]

Begin: Running /scripts/nfs-bottom … done.
done.
Begin: Running /scripts/init-bottom … mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn’t have requested /sbin/init
No init found. Try passing init= bootarg.

[Drop in BusyBox]

I tried doing the guides again from the beginning but still had this problem. Googling for a couple days but found no solutions.

I would appreciate any help.

Hi,
Yeah, the guy you mention was probably me. Actually I struggled with that for a long time and I can conclude that one should not try to solve the problem by googling around because it was really enigmatic, you will never know how and when it will be working.

The easiest method I found is that re-installing ubuntu (it’s OK if you replace old ubuntu by a fresh one by choosing the option ubuntu offers). After that, customize ubuntu as you wish and follow the instruction from the beginning (link in my original post).

Hopes it helps,
Thanh.

You right. It was you! I am almost to the point of using windows to boot ubuntu using this http://www.howtogeek.com/162809/how-to-pxe-boot-an-ubuntu-image-from-windows-server-2008/. I really want to keep an open mind and start to get familiar with Linux but there are SOOOO many freakin builds of it, it is a bit overwhelming but I still feel for what I am trying to accomplish for my client it is the better solution. He wants to boot over 200 diskless clients at the same time and I feel the overhead on Linux is a lot less that Windows.

So your saying re-install the client? It was a fresh install and of the latest build from ubuntu. The only thing I did was apply updates and that was it. You think the issue is with the client and not the configuration on the server?

Hello,
The larger the system, the more Linux is preferred over Windows. It’s not your feeling or intuition, it’s the truth.

To answer your question, re-install Ubuntu on the client (the to-be-diskless-machine). That must be a fresh install (Ubuntu 12.04.3 LST up to this moment), but you need not necessarily update everything in that Ubuntu to the latest. After that, follow the guide from serenux.com (link in my original post)

A few things you should take note for this is from my own experience. When PXE-booting PCs, the diskless client will consume its own hardware resources (processors, RAM), it does not consume those resources of the server. Because PXE-boot is a network-boot, the system will consume the bandwidth like crazy; thus you should use the best cables you have (gigabyte network). The most important thing is to make sure the Switches, which connect the whole system, are config’ed correctly to ensure the server receive the requests from clients (DHCP requests, . ).

Hopes you can work it out.
Thanh.

Hello,
make sure you have set up DHCP, TFTP and NFS correctly. Refer to this guide:
https://help.ubuntu.com/community/PXEInstallMultiDistro

That guide only guides you to PXE-boot the Ubuntu Live CD. The guide at this site:

shows you how to create YOUR OWN UBUNTU IMAGE. The 2 images are completely different. The Live CD boots Ubuntu by ‘casper’ thing, and you MUST set that image to read-only. The customized image looks like when you type “ls /” in the Terminal because you copy the whole Operating system from the client to the NFS server; you MUST set this image to read-write.

Do NOT use remastersys or any program to create your image. Follow the 2 guides (I put 2 links above) strictly and you will see the difference.

One more thing, you may wonder why Live CD image must be set to read-only and why customized image must be writable. It’s a very long story so I won’t post to confuse you. Actually it’s a part of my Thesis.

Hopes it helps,
Thanh.

Thanks but I downgraded to Ubuntu 10 and did both the remastersys method and serenux method and both of them booted successfully. Something is up with 12.4 and I am not enough of a linux guy to tell you what or how to fix it. Until that happens I am just going to use 10 for my pxe boots.

I hope I can keep alive this thread, coz this guide very useful. I’ve tryed both method. Both of them are booted succesfuly, but unfortunaetly the remastersys version is too slow at boot. With a useable distro, the squashfs file is min 1gb and I got only 100Mb lan for those workstation where I want to use.

With the serenux method I got a permision problems. I don’t realy understand the last step: “chmod 777 /var/tftp”.
The hole filesystem in the nfsroot folder. In the tftp only the kernel and the image (why need the kernel 777 perm?). And with this method the boot is stuck at the middle of the process with ‘cant write to xy folder’ When copy the filsystem files to the nfsroot I got error messages to all files, that can’t keep owner and group. So all files in the nfs folder are created with nobody nogroup 700 permisions. If I run the ‘chown -R 777 ‘ the os booted, but nothing works. Can’t login etc, beacause of the permisions. The real UID-s are not the same wich are in the /nfsshare/etc/passwd, which is used by the dikless os.
Sorry for bad english. I hope it’s understandable.

Are you using 10 or 12.4?

I am still using 10.

In the end I used a Windows Server 2012 and setup an NFS file share and used that for the pxe boot server.

I followed this post: http://www.howtogeek.com/162809/how-to-pxe-boot-an-ubuntu-image-from-windows-server-2008/

One issue I ran into was when copying the files from the main boot copy using serenux’s method to the windows box the permissions were all screwed up on the windows side and I couldn’t correct them using any tool I tried.

So now I have a Windows server 2012 box with DHCP and hosts the pxelinux.cfg and a linux ubuntu nfs file share hosting the files for the client. So the clients are booting from the windows box and the cfg file is pointed to the NFS share on the ubuntu server.

The main issue is if you boot multiple clients from the nfs share using serenux all the clients are sharing the same files. If you fire up two of them and shut one down via the shutdown command it crashes the entire share.

I built this for a client testing diskless pcs. So I put the nfs share ubuntu box on a vm and now they boot 100s of laptops and desktops to the nfs share and just hard shut down the machines. If they screw up and shutdown on through linux then I restore the snapshot back to when it worked and everything starts working again.

Not to elegant but they are flying through machines testing them now.

smashedbotatos

Member
  • Feb 6, 2012
  • #41
  • Active Member
    • Feb 6, 2012
  • #42
  • cyabro

    Well-Known Member
    • Feb 7, 2012
  • #43
  • Just working my way through the doc and found that I had to use this location for the FOG download using the sudo wget command:

    Also I noticed that you call the fog setup directory a couple of different names:
    setupfog & fog-setup so you may want to tidy that up.

    Edit: OK so have got the basic setup working! Tested network booting on a Dell Netbook and get the FOG menu.
    So I started going through the menu customisation but am stuck with the WinSCP transfering of files. Whenever I try to upload a file back to the server it can’t do it and says there is a permission error. What am I doing wrong?

    smashedbotatos

    Member
    • Feb 7, 2012
  • #44
  • Just working my way through the doc and found that I had to use this location for the FOG download using the sudo wget command:

    Also I noticed that you call the fog setup directory a couple of different names:
    setupfog & fog-setup so you may want to tidy that up.

    Edit: OK so have got the basic setup working! Tested network booting on a Dell Netbook and get the FOG menu.
    So I started going through the menu customisation but am stuck with the WinSCP transfering of files. Whenever I try to upload a file back to the server it can’t do it and says there is a permission error. What am I doing wrong?

    Totally going to fix that stuff hehe thanks you fpr the heads up.

    When you transfer files with WinSCP they have to go to the /home/ / folder you can’t write to anywhere else, and you can’t use WinSCP as sudo.

    cyabro

    Well-Known Member
    • Feb 7, 2012
  • #45
  • Ah thanks for that.

    I’ve come across another issue.
    The Ubuntu/FOG server is the DHCP server and it is giving out IPs and DNS OK but not the gateway.
    Where do I check to see if this is set correctly?
    The Ubuntu/FOG server itself has the correct gateway and can access the internet.

    smashedbotatos

    Member
    • Feb 7, 2012
  • #46
  • I think your problem lies in the dhcpd.conf. I was under the assumption that FOG already automatically set the correct gateway for the DHCP server to give to the clients.

    Check this guide here

    In the dhcpd.conf file there is a line that is “option router” line that is what tell the clients what the Gateway is, this may be either wrong or missing.

    “option routers: Tells the DHCP server the gateway address it should assign to requesting clients. In our case the gateway is 192.168.0.1.
    If you are not sure about your personal network settings (network, netmask, broadcast address, etc.), visit www.subnetmask.info where you can calculate your settings.”

    to edit dhcpd.conf use this command

    sudo nano /etc/dhcp3/dhcpd.conf

    Look and see if that line is correct.

    cyabro

    Well-Known Member
    • Feb 7, 2012
  • #47
  • Strange, there is no dhcpd.conf file in that folder.

    There is however /etc/dhcp/dhcpd.conf and that looks like it has the correct setup for what I setup during the install.
    The line for the Option Router is commented out and has x.x.x.x so I’ll change that and try again.

    smashedbotatos

    Member
    • Feb 7, 2012
  • #48
  • type this command

    if you said it is giving out addresses there must be a conf file somewhere.

    if it doesn’t exist you may need to reinstall the dhcp server portion, and you can do that with this command.

    sudo apt-get install dhcp3-server

    Slaters Kustum Machines

    Well-Known Member
    • Feb 8, 2012
  • #49
  • type this command

    if you said it is giving out addresses there must be a conf file somewhere.

    if it doesn’t exist you may need to reinstall the dhcp server portion, and you can do that with this command.

    sudo aptget install dhcp3-server

    cyabro

    Well-Known Member
    • Feb 8, 2012
  • #50
  • So it was the file in /etc/dhcp/ and not /etc/dhcp3/.

    It’s all working now.
    Now to look at customising the menu!

    Active Member
    • Feb 12, 2012
  • #51
  • Been a while but I now have Bitdefender and AVG working.
    Thanks
    Trying to get trinity working but get an error at this point

    [email protected]:/tftpboot/av/trinity/trk3$ sudo ./mkpxelinux
    sudo: ./mkpxelinux: command not found

    the file is there:-
    [email protected]:/tftpboot/av/trinity/trk3$ ls -al
    total 137012
    drwxrwxr-x 4 acs acs 4096 2012-02-12 20:16 .
    drwxrwxr-x 5 acs acs 4096 2012-02-12 20:16 ..
    drwxrwxr-x 2 acs acs 4096 2012-02-12 20:16 captive
    -rw-rw-r– 1 acs acs 1020 2010-01-20 06:45 mkpxelinux
    .

    smashedbotatos

    Member
    • Feb 13, 2012
  • #52
  • Active Member
    • Feb 13, 2012
  • #53
  • Thanks for that..
    tried chown but still get.

    [email protected]:/tftpboot/av/trinity/trk3$
    [email protected]:/tftpboot/av/trinity/trk3$ sudo ./mkpxelinux
    sudo: ./mkpxelinux: command not found

    [email protected]:/tftpboot/av/trinity/trk3$ ./mkpxelinux
    -bash: ./mkpxelinux: Permission denied

    [email protected]:/tftpboot/av/trinity/trk3$ sudo chown acs /tftp boot/av/trinity/trk3

    [email protected]:/tftpboot/av/trinity/trk3$ sudo ./mkpxelinux sudo: ./mkpxelinux: command not found

    [email protected]:/tftpboot/av/trinity/trk3$ ./mkpxelinux -bash: ./mkpxelinux: Permission denied

    [email protected]:/tftpboot/av/trinity/trk3$ ls -al
    total 137012
    drwxrwxr-x 4 acs acs 4096 2012-02-12 20:16 .
    drwxrwxr-x 5 acs acs 4096 2012-02-12 20:16 ..
    drwxrwxr-x 2 acs acs 4096 2012-02-12 20:16 captive
    -rw-rw-r– 1 acs acs 1020 2010-01-20 06:45 mkpxelinux
    drwxrwxr-x 3 acs acs 4096 2012-02-12 20:16 share
    -rw-rw-r– 1 acs acs 22576 2008-03-01 23:28 syslinux
    -rw-rw-r– 1 acs acs 24576 2008-04-08 13:12 syslinux.e xe
    -rw-rw-r– 1 acs acs 134811648 2011-04-12 09:49 trkramfs
    -rw-rw-r– 1 acs acs 1934764 2008-04-14 09:13 trspack-1_ 0.exe
    -rw-rw-r– 1 acs acs 1739852 2008-04-14 09:14 trsrun-1_0 .exe
    -rw-rw-r– 1 acs acs 1739312 2008-04-14 09:14 trsrun-1_0 -nq.exe
    [email protected]:/tftpboot/av/trinity/trk3$

    =====
    Will leave trinity for the moment and move on to next section.
    Thanks

    Here is a step-by-step (how-to) guide for deploying Ubuntu 8.04.1 LTS 32-bit (Hardy Heron) from a Windows Server running WDS (Windows Deployment Services)

    Part 1 – Stage the Ubuntu Setup files on your Server

    Note: If you really wan’t to do Ubuntu deployments with style, you should of course skip downloading the alternate ISO’s and instead create a local mirror of the real Ubuntu dist mirrors. You’ll find optional instructions on how to do this further down in the guide (Part 3 to be exact), but for now we simply use the Ubuntu Alternate CD (32-bit) to speed up the process.

    1. Download the 32-bit Alternate Install CD’s from http://releases.ubuntu.com/hardy/ubuntu-8.04.1-alternate-i386.iso
    2. Install IIS (web server) on your server and create a virtual directory named Ubuntu (in this example from the D:\Ubuntu folder): Configure the MIME Settings for the virtual Ubuntu directory by adding a .* wildcard extensions for the “text/plain” mime type (In the HTTP Headers Tab of the Virtual Directory Properties). This is for supporting wget downloading files (which the Ubuntu install engine is using).
    3. Copy the contents of the iso image to D:\Ubuntu. Be warned though, The Ubuntu CD Image team (in their infinite wisdom) choosed to use the Rock Ridge extensions to ISO 9660 which supports filenames up to 255 characters. Problem is most Windows software (including vmware) doesn’t support this when running Windows as a guest OS. However, MagicISO does, so download and install MagicISO from http://www.magiciso.com/download.htm and use it to extract the iso to theD:\Ubuntu folder.
    4. Create another virtual directory, this time named Kickstart (in this example from the D:\Kickstart folder). Configure the MIME Settings for the virtual Ubuntu directory by adding a .cfg extensions for the “text/plain” mime type (In the HTTP Headers Tab of the Virtual Directory Properties).
    5. Download and extract the sample kickstart file (Ubuntu version of unattend.txt) found at this link http://www.deployvista.com/Portals/0/kickstartscript.zip and save it in the D:\Kickstart folder. The encrypted password in thekickstart script is ubuntu

    Part 2 – Configure WDS to support Ubuntu

    1. From the D:\Ubuntu\install\netboot\ubuntu-installer\i386 folder, copy the initrd.gz and linux files to D:\RemoteInstall\Boot\x86\Hardy\32
    2. Download and extract syslinux from http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.71.zip (it contains pxelinux)
    3. Copy the syslinux-3.71\com32\menu\vesamenu.c32 to your WDS Server, D:\RemoteInstall\Boot\x86
    4. Copy the syslinux-3.71\core\pxelinux.o to your WDS Server, D:\RemoteInstall\Boot\x86, rename it to pxelinux.com
    5. Download a nice background image (http://www.deployvista.com/Portals/0/DeploymentBackground.png), and save it in D:\RemoteInstall\Boot\x86
    6. In the D:\RemoteInstall\Boot\x86 folders, make a copy of pxeboot.n12 and rename it to pxeboot.0
    7. Configure WDS to use the pxelinux.com boot file (Server properties, Boot tab)
    8. In the D:\RemoteInstall\Boot\x64 or D:\RemoteInstall\Boot\x86 folders, create a subfolder called pxelinux.cfg
    9. In the D:\RemoteInstall\Boot\x64\pxelinux.cfg or D:\RemoteInstall\Boot\x86\pxelinux.cfg folders, create a file named default with the following settings

    DEFAULT vesamenu.c32
    PROMPT 0
    NOESCAPE 0
    ALLOWOPTIONS 0
    # Timeout in units of 1/10 s
    TIMEOUT 300
    MENU WIDTH 40
    MENU MARGIN 0
    MENU ROWS 12
    MENU TIMEOUTROW 14
    MENU HSHIFT 5
    MENU VSHIFT 2
    MENU COLOR BORDER 30;44 #00000000 #00000000 none
    MENU COLOR TABMSG 1;36;44 #00000000 #00000000 none
    MENU COLOR TITLE 1;36;44 #00000000 #00000000 none
    MENU COLOR SEL 30;47 #40000000 #20ffffff
    MENU BACKGROUND DeploymentBackground.png

    MENU TITLE PXE Boot menu
    MENU WIDTH 80
    MENU MARGIN 18
    MENU ROWS 4

    LABEL wds
    MENU DEFAULT
    MENU PASSWD [email protected]
    MENU LABEL Windows Deployment Services
    KERNEL pxeboot.0

    LABEL local
    MENU LABEL Boot from Harddisk
    LOCALBOOT 0

    LABEL hardyubuntudesktop32
    MENU PASSWD [email protected]
    MENU LABEL Deploy Ubuntu Desktop 8.04.1 32 bit
    KERNEL /hardy/32/linux
    append vga=769 initrd=/hardy/32/initrd.gz ksdevice=eth0 ks=http://demosrv001/kickstart/Ubuntu_Desktop_32.cfg

    Part 3 – What next…

    if you really wan’t to do Ubuntu deployments with style, you should of course skip downloading the alternate ISO’s and instead create a local mirror of the real Ubuntu dist mirrors, giving you access to the latest security updates, drivers, support for multiple architectures etc… However, they are really big… Even a single dist like Hardy is about 36 GB (i386 and amd64)

    To create a local mirror of the hardy dist I recommend using apt-mirror which will run just fine in Windows, as long as you run it in Cygwin.

    Download cygwin from http://cygwin.com/ and run setup, make sure to select the wget package in addition to the default packages.

    Then download apt-mirror from http://apt-mirror.sourceforge.net/ and then, in cygwin, create a file named /etc/apt/mirror.list with the following content

    # begin mirror.list
    # apt-mirror configuration file

    ##
    ## The default configuration options (uncomment and change to override)
    ##
    # Store data on the d:\staging
    # Note: Create the following folders
    # d:\staging
    # d:\staging\skel
    # d:\staging\skel\var
    # d:\staging\mirror
    set base_path /cygdrive/d/tmp
    #set mirror_path $base_path/mirror
    #set skel_path $base_path/skel
    #set var_path $base_path/var
    #
    # set defaultarch
    set nthreads 2
    #

    # Ubuntu 8.04 “Hardy” i386
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy main restricted universe multiverse
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy-updates main restricted universe multiverse
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy-security main restricted universe multiverse

    # Ubuntu 8.04 “Hardy” amd64
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy main restricted universe multiverse
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy-updates main restricted universe multiverse
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy-security main restricted universe multiverse

    # Support for network based installations i386
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy main main/debian-installer
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy restricted restricted/debian-installer
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy universe universe/debian-installer
    deb-i386 http://ftp.acc.umu.se/ubuntu hardy multiverse multiverse/debian-installer

    # Support for network based installations amd64
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy main main/debian-installer
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy restricted restricted/debian-installer
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy universe universe/debian-installer
    deb-amd64 http://ftp.acc.umu.se/ubuntu hardy multiverse multiverse/debian-installer

    ##
    ## Cleaner configuration example
    ##
    #
    # set cleanscript $var_path/clean.sh
    #

    In cygwin run: perl apt-mirror (it will now create a local mirror of the selected dists and packages)

    Snippets from my private “Intelligence” Wiki

    Posts here are mostly step-by-step guides on how to replicate something I have set up in the past. Read over my About page to see how I show commands/output and read the disclaimer.

    There are several rescue utilities out there that run in the form of a bootable ISO, but what if you already have a functioning PXE server and don’t have a CD? There is a way to load it over the network.

    This guide is intended for ISOs that have no PXE boot option. Do not try to serve something like an Ubuntu ISO using this method! Most if not all Linux distributions have a separate PXE configuration that does not require this workaround.

    You will need a PXE server configured similar to my guide on creating an Ubuntu deployment server. If you are creating a PXE server for this guide’s purpose, you only need to complete the Ubuntu deployment server guide up to Checkpoint Two.

    Once you have the PXE server setup, you will need to also have memdisk in the TFTP boot folder. Memdisk is part of syslinux, and can be downloaded here.

    This is the source, so we need to compile it after we install a couple dependencies.

    Now lets copy over the memdisk binary.

    Also, take the ISO that you are looking to PXE boot in that same directory ( /var/lib/tftpboot/other/ ). After I saved my ISO to that same directory, my directory structure looked like this.

    In the file /var/lib/tftpboot/pxelinux.cfg/default , add this menu entry. Replace the ISO and menu labels accordingly.

    In my case, I am attempting to PXE boot machines into a recovery disk provided by Symantec without having to burn the disk.

    Now any machine can be booted to this ISO. Simple!

    Share this:

    • Reddit
    • Google
    • LinkedIn
    • Facebook

    About Andrew Wells

    I have been developing on the LAMP stack since about 2006. I run Ubuntu XFCE on my desktop and have a history of managing Ubuntu and CentOS servers. I code web applications mostly in PHP but have experience with other languages as well. When I’m not working, I can be found working in my home lab or out snowboarding, hiking, camping, or biking depending on the season.

    16 thoughts on “ PXE Boot any ISO Image ”

    Hi, why do you need the memdisk ? Could I just leave it out ?
    Also, what does the
    root (hd0,0)
    do ?
    thanks

    1. Andrew Wells Post author March 31, 2015 at 5:44 pm

    I suppose you don’t need the memdisk option, but it’s good to have to make sure the environment works before adding the variable of an ISO image.

    The root parameter is related to the local disk and I believe is not required in this case.

    hello,
    this way was able to UEFI model?

    Hi Andrew, I came across your stie while looking for a howto for pxe booting isos. I’ve followed your two guides and i’m currently at this stage when I boot from pxe…..

    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    C. —-
    B. —-
    A. Boot from local disk
    A. Boot from local disk
    A. Boot from local disk
    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    PXEBS (net1 type 128)… ok
    Next server: 192.168.15.254
    Filename: pxelinux.0
    tftp://192.168.15.254/pxelinux.0… No such file or directory (http://ipxe.org/2
    d12603b)

    Installing dnsmasq didn’t create the folder /var/lib/tftpboot I had to do that manually. I only have one iso file that I want to be able to boot from.

    Got a bit further now it says

    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    C. —-
    B. —-
    A. Boot from local disk
    A. Boot from local disk
    A. Boot from local disk
    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    PXEBS (net1 type 128)… ok
    Next server: 192.168.15.254
    Filename: pxelinux.0
    tftp://192.168.15.254/pxelinux.0… ok

    I’ve now got this on the pxe server

    Sep 19 22:07:46 apu dnsmasq-tftp[2397]: sent /srv/tftp/pxelinux.cfg/default to 192.168.15.119

    but the client just hangs?

    Great, thanks a lot for this article – helped me a lot…

    Thanks for your guide. By PXE, I can install a ISO which is customized by my self. But I encounter a problem. The size of my ISO file is 1.5G, when a low memory PXE client boots from the ISO, an error which shows NOT enough memory will appear. Could you give me some advice? Thanks.

    1. Andrew Wells Post author November 25, 2015 at 3:41 pm

    Yes, this procedure can be a problem with larger ISO images. What are you trying to boot to?

    Many, Many Thanks to you Andrew!

    Hi Andrew please could you drop me an email as I would like a quick hand with pxe boot, there will be beer tokens 😉

    Thanks for the tutorial, but I’m now confronting some special issues. I’m trying to boot a Sophos UTM 9 installation over PXE, it is distributed via ISO too. The installation will stop since you haven’t got everything mounted (install.tar in particular, maybe the whole /install directory too), and this happens with a USB drive too. Solution with a USB drive is to mount the drive via console that is provided during the installation.

    Do you have any solution to this, how could I provide a whole directory via PXE to be mounted on the running software. Or is it impossible?

    Thanks for the tip. I had been spending most of the night trying to boot a server to ESXi hypervisor, but the CD drive was bad, and no amount of USB booting would work. This did the trick.

    Can you do something like this with a Windows Server 2008 PXE server setup? So you can pxe boot to other bootable images other than Windows .wim files?

    Is it valid doing your own ISO? How could I do it?
    I tried with a Debian ISO without luck, not works.

    am looking to make a pxe boot iso that will work off dhcp, connect to say an ftp server, then show a menu that offers up several install options for Centos, Debian or Mint, sort of thin. Because of other systems on the network i cant pxe boot and am hoping to be able to boot from iso or usb to install onto local hd.
    Is the above possible using your boot environment?

    #1 diddy

  • Tutorial Writer
  • 78 posts
  • New draft completed – available here

    Draft v2 includes instructions for using grub4dos as the PXE boot loader/file.

    Setting Up A Windows XP PXE Server (DRAFT v2)

    Guide covers –

    • Install Windows 2000/XP/2003 (RIS)
    • Install Windows Vista/2008/7 from a network share
    • Boot disk images
    • Boot WinPE (XP/2003 based – e.g. LiveXP, PEBuilder)
    • Boot WinPE 2.*/3.0
    • Boot Linux (Parted Magic example included)

    Includes download link for an offline version of the guide (in .htm format). Some scripts are included (in the offline download) for automating various sections.

    Feedback welcome – please remember it is still in draft.

    • tonikas likes this

    #2 allanf

  • .script developer
  • 1256 posts
  • Thanks for the guide.

    I have been trying to PXE Boot WinPE 2.1 (bootfile pxeboot.n12) in VirtualBox with little success – a ‘Windows failed to start. \Boot\BCD. 0xc0000001″ screen.

    Researching the matter, I came across a message by Bubble here relating to the problem with Boot Manager entry names, i. e. “Ramdisk options” for all entries.

    The solution? Delete ‘‘s description, something like:

    > Bcdedit /store /deletevalue description

    And now, the boot entries have no description to inherit, and so display their own.

    I haven’t tried it, so can’t vouch for it – just stumbled across it and recalled the note in your guide.

    Also, I can’t seem to locate your batch files in the downloadable version of the guide. In particular, I was wanting to look at your 4a_WinPE.cmd and 4b_WinPE.cmd. How do I find them?

    #3 was_jaclaz

  • Advanced user
  • 7101 posts
    • Location: Gone in the mist
    • Italy

    Researching the matter, I came across a message by Bubble here relating to the problem with Boot Manager entry names, i. e. “Ramdisk options” for all entries.

    Just for the record, it seems that different versions of BOOTMGR behave differently:
    http://www.msfn.org/. 32-t125543.html
    http://www.msfn.org/. dd-t114711.html

    #4 cdob

  • Expert
  • 1469 posts
  • Yes, Windows 7 bootmgr list description, if available.

    http://diddy.boot-la. files/winpe.htm
    remove /d “Ramdisk options”
    Or use different always.
    Set description to both ramdiskoptions and OSLOADER section.
    This should work at all different bootmgr.

    #5 itcrew

    Greate Guide, there is no cmd scripts though. Please can you update

    #6 Tense

  • Members
  • 24 posts
    • United States

    #7 diddy

  • Tutorial Writer
  • 78 posts
  • Sorry for the mix up with the scripts.

    I’ve re-uploaded the guide – scripts are included this time.

    p.s. Child commitments continue to keep me busy so appologies for lack of responses over the past few months.

    #8 Sha0

  • Developer
  • 1682 posts
    • Location: reboot.pro Forums
    • Interests: Booting
    • Canada

    A very nice guide. The RIS “INF file XXX is corrupt or missing, status 21.” error has been addressed in Syslinux 3.83, so anything newer should be fine.

    #9 Aviad Raviv

    ok, i don’t wanna sound rood and trash all your hard work.

    but all of this has been done before into a very well working virtual appliance call UDA.

    the creator has incorporated a lot of the stuff you show in your guide into a Linux free VM that can be used using a simple webGUI.

    with that said, both I (as a long time user of this product) and its creator have moved on because we found two things to be true:

    1. if your going to install windows with a flat install over the network (witch both of us no longer recommend) your better off using MSs RIS\WDS as reverse engineering the process doesn’t bring anything new to the table, and doing it just gets harder with every new release and you can implement the additions done with PXElinux like boot ubuntu and acronis just fine on a server thats hosting WDS\RIS with a regular MS server.

    2. flat installs are a thing of the past. images are way easier to get running with less effort and take a fraction of the time to deploy.

    i have moved from the UDA project to the FOG one because of these two reasons and i have added to it all the additions i have done to UDA in my youtube films.

    Over the past few years with the advent of low cost USB drives, CD Drives have basically become legacy devices. For that matter, most new computers don’t even have one. With that said, there are lots of tools we typically use that boot from CD and yes these tools can be made to boot from USB, however the purpose of this article is to detail the steps required to effectively boot any .iso over PXE. To preface this article, we are going to assume you’ve already read our article Enable PXE on Windows 2008 R2 or that you are fairly familiar with the PXE stack whether on Windows or Linux. For the purpose of this article we will boot Macrium Reflect 6.0 over PXE.

    Once everything is in place, network boot a machine and you should see that the .iso boots as if it were a CD.

    14 thoughts on “ PXE Boot Almost Any ISO Image ”

    Hey I have some questions!

    I placed the iso file in my tftp root directory, yet this doesn’t work.

    I see a message flashin g a t the bottom of the menu when selecting the option I created. It’s fast but it says something about that it can’t find the iso file. “No such file or directory”.

    Anyway, like I said, I put the file in there yet it doesn’t load it. Why might this be happening?
    I kind of know the tftp server is working, since I have been successful loading oses using other methods, such as nfsroot and specifying the actual kernel and initrd image extracted from the iso.

    However I would really like to be able to just specify the iso to boot basically.

    Also does this boot the grub present in the iso?

    Also, does the kernel used matter by a lot?

    The version of pxelinux is critical using this setup. Please use the version specified in the article.

    I build an ISO from my LINUX MINT system using SystemBack and it boot up from an USB stick.

    I have a working PXE environment on my Synology NAS.
    Serveral Life DVD’s are bootable without any problem.
    Linux Mint ISO’s and HirenBootCD.

    I copied the ISO file to the same directory on the NAS where the others are sitting.
    The menu shows the entry for my Mint ISO.

    But when I choose it nothing happens. A short flash on the screen and it returns to the menu.

    How to trouble shoot this?

    Is a log file maybe somewhere?

    @Girts In case this is still actual. You can find ldlinux.c32 with the following command

    sudo find / -type f -name ldlinux.c32

    if ldlinux.c32 is somewhere on your drives, then it will output the path of it.
    Then, knowing the path to ldlinux.c32 you can copy your servers tftp root (the same directory where pxelinux.0 is).
    For example the command could look like

    cp /path/to/ldlinux.c32 /path/to/tftp-root

    After this pxelinux.0 should be able to load ldlinux.c32 at boottime.

    Thanks Hoin. You can also retrieve all the needed files from the syslinux package linked in the article.

    OK
    I figured it out
    I was using version 6
    =====

    Apparently this is due to a recent change in syslinux library modules. Not sure if its a bug Unetbootin can fix or any other package related bug.

    But the solution is simple.

    copy the below files from /usr/lib/syslinux/bios/ to the root of USB drive and then boot with the USB device.