How to create a Windows bootable CD with mkisofs

Generally, the only reason for which you may need to create a bootable Windows CD is when you have updated the operating system installation files with the latest Service Pack (slipstream). Even in this case, chances are that most users will rather use standard windows software to create the bootable CDs than mkisofs under Linux, but, even for this extremely rare case, here is how to accomplish this task.

For the following operation the Linux native mkisofs version 2.01 (or genisoimage), which is shipped with Fedora (and with every other Linux distribution), was used.

The Windows port of mkisofs and, generally, the Win32 binaries of all the utilities included in the cdrtools package can be found in the Cdrtools: Win32 Binaries page. Please note that the page also includes a Win32 binary version of the latest (unstable) version of cdrtools. It is highly recommended to use the latest stable version.

So, change to the directory that contains the Windows installation files and issue the following command:

mkisofs \
    -b cdboot/msboot.img -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 \
    -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames \
    -V "WINSP" \
    -o ../winsp.iso .

The above command ends with a dot (.).

All of the above flags seem to be necessary in order to relax many of the ISO restrictions. For more information about each of them please refer to the mkisofs (or genisoimage) manual page (man 8 mkisofs).

This tip assumes that the boot image which is used in the Microsoft bootable CDs is available and that it has been placed in a cdboot/ subdirectory under the windows installation files root dir:

.
    cdboot/msboot.img
    other_dir/some_other_file
    file1
    file2

I admit that this is a nasty workaround, but I didn’t have enough time to investigate why the -b option caused that much trouble. The path to the boot image which is supplied with the -b option is supposed to be a relative path to the path of the root directory of the windows files, which is our current directory, aka (.). But, everytime I placed the msboot.img outside the win files directory and used -b ../msboot.img, mkisofs complained with the following pesky error message:

mkisofs: Uh oh, I cant find the boot image '../msboot.img' !

It didn’t make any sense, so I did not bother any more with it. If you have any info on this or if I miss anything, which is rather possible since I have spent very little time with this, your feedback is appreciated.

The above command will produce an image of a bootable Windows CD, which will also contain the boot image. But, this should not be a problem in any case.

Note that the ISO image will be saved in the parent directory of the one that holds the Windows files.

Note: How to integrate a service pack into a Windows OS is beyond the scope of this document. There are numerous guides out there that cover this topic in great detail.

How to create a Windows bootable CD with mkisofs by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Permissions beyond the scope of this license may be available at Licensing Information.
Copyright © 2007 - Some Rights Reserved

George Notaras avatar

About George Notaras

George Notaras is the editor of G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.

7 responses on “How to create a Windows bootable CD with mkisofs

  1. Nuno Brito Permalink →

    Hi, good guide.

    On the last part you question why doesn’t the -b switch gives error. It is indeed expecting the boot loader to be inside the folder and if you intend to place on a subfolder, the path needs to use something like this: -b -b “Boot/etfsboot.com” for recent Windows PE boot disks.

  2. Sam Permalink →

    Hey George,

    Great guide, I am trying to create a bootable Windows ISO on linux, I’ve got a windows install cd iso as a source and I want to make a copy of it that I can modify for an unattended install and re-roll into an iso with mkisofs. There is no msboot.img on my source iso, there is boot/etfsboot.com which I think serves the same purpose? This is how I created the ISO, but the resulting ISO was not bootable :( Any ideas?

    mkisofs \
    -b boot/etfsboot.com \
    -no-emul-boot -boot-load-seg 1984 \
    -boot-load-size 4 -iso-level 2 -J -l -D -N \
    -joliet-long -relaxed-filenames \
    -V “WINSP” \
    -o /opt/Windows.iso \
    /opt/WindowsCD/

  3. zuargo Permalink →

    man, you make my day, thank you so much!!

  4. LordX Permalink →

    mkisofs -bboot/etfsboot.com -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V “WINSP” -o /opt/Windows.iso /opt/WindowsCD/

    should work, it’s strange that the -b cannot have a space between -b and -b won’t work, but -b will

    1. Adam Permalink →

      Hi,

      I am using command
      genisoimage -bboot/etfsboot.com -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V “Win2012” -o /win2012.iso and it produces an ISO file but it hangs just after start without booting.
      Any ideas?

  5. will Permalink →

    This works for me

    genisoimage -bboot/etfsboot.com -no-emul-boot -iso-level 2 -udf -J -l -D -N -joliet-long -relaxed-filenames -o win81.iso extracted