Windows – How to create bootable Windows 8 iso image in Linux

bootableisomkisofswindows

I have to insert the Autounattend.xml file into a Windows 8 iso image to make the iso install automatically. My system need to run on Linux and only could use Linux shell command, so ISO tools on Winodws such as UltraISO can not be used.

I have tried several methods, but all the created iso could not be booted, just printed

CDBOOT: Cannot boot from CD - Code: 5

A. The first method I tried is: tuto

  1. Mount iso to a folder
  2. Copy the mounted iso content into a new folder
  3. Add my files into the new folder
  4. Use mkisofs command to create a new iso image

    mkisofs -o windows2008_new.iso -b boot/etfsboot.com -no-emul-boot   -boot-load-size 8 -boot-info-table  -V -J -l -D -N -UDF  -relaxed-filenames -V "WINSP"
    

B. The second method I tried:

MS cmd tool named "oscdimg" on Windows to create new Windows iso, it works. So I copy the oscdimg into Linux and use Wine to run it, it can not be run normally.

Does any one know how to make bootable Windows iso image in Linux using pure shell command?

Best Answer

I managed to successfully use genisoimage (a debian fork of mkisofs).

Method:

  1. loopback mount the iso

    mount -o loop <image>.iso /mnt/iso
    
  2. copy to secondary folder for r/w access

    cp -R /mnt/iso/ /mnt/iso2
    
  3. make changes

  4. genisoimage -b <relative boot-img path> -no-emul-boot -boot-load-size 8 -iso-level 2 -udf -joliet -D -N -relaxed-filenames -o <new-image>.iso /mnt/iso2.`
    
Related Question