Auto Install ZENworks Image Engine on USB using UNetbootin

over 9 years ago

Install ZENworks Image Engine on USB using UNetBootin

Quick tool to install the bootcd.iso (ZENworks 11.1), using Unetbootin, onto a USB Pen Drive.

UNetbootin is an excellent tool to create bootable USB Pen Drives. In this guide I use UNetbootin to put the bootcd.iso file onto a USB Pen Drive and then use this instead of using a CD.

Out of the box this installation script will create a bootable USB, with UNetbootin launching the ZENworks Imaging engine. From this you can pull images from a Proxy Server, launch a preboot script and pull images from the local USB Pen Drive.

Read the settings.txt and PrebootscriptUSB.s files (attached) to see more.

This only takes about 5-10 minutes, all depending on how much you want to do from the USB Pen Drive. Reading this will probably take longer than the execution

Things you need:

The files attached (

Bootcd.iso: from your own environment or get the latest Imaging Driver Update from

(the Bootcd.iso attached to this, is from the ZCM11.1 sept. driver update. So if you are on this version, no need to replace it)

A Windows PC with PowerShell 2.0

Software used: UNetbootin: free download from

Inspiration found at:

Novell ZENworks 7/11 documentation.

Warning, I can't guarantee this works on all USB pen drives. And do remember that under this process the drive will be cleaned, so backup any data you may have on it before starting.

All the files in this guide are located in C:\USBIMAGE\

Step one

Extract the attached files to "C:\" (Very important the path is "C:\USBIMAGE\")

Step two

If needed, paste your own bootcd.iso file to "C:\USBIMAGE\"

(tested with iso files from 10.3.3, 11.1a, 11.2)

If you want to edit the settings.txt file, use the file (template) from "C:\USBIMAGE\setting\". I've edited this, so it works with local imaging from the USB Device.

You can then manually add it to the bootcd.iso, using eg. MagicISO. Or just leave it in the setting folder, the file, from "C:\USBIMAGE\setting\", will automatically be copied to the USB during installation.

Step three

Add, if any, your own images and/or prebootscripts.

If you want to pull images from the USB, you can use the "PrebootScriptUSB.s" script file as your template. If you want to pull images from a PROXY, just active the PROXY part.

Place your images (.zmg files) in the folder "C:\USBIMAGE\IMAGES\IMG\"

If you use addon-images, you could place them in the addon folder. All depending on how you want the structure. I place mine in this folder, as you can se in the attached example of a preboot script.

Place your preboot-script (.s file) in the folder "C:\USBIMAGE\Scripts\PreBoot\"

Feel free to use my example and modify it so it fits your demands.

Step four

Connect the USB Pen Drive to your PC.

Warning! You must only connect one USB device to the PC. All content on it will be erased.

Step five

Run the installation.


Execute the file: C:\USBIMAGE\RunScript.bat

This will run a PowerShell script. This formats the drive, runs UNetbooting and copies the edited and needed files.

Just follow the few instructions on the screen

The windows should look like this:

When the window is closed your done.

Now your USB Pen Drive is ready.


Note: if you experience any problems with the detection of the USB Pen Drive during boot, you should look into the syslinux.cfg file and change this part so it fits your device:

install=hd:/dev/sdb1 root=/dev/sdb1

(Could instead be "install=hd:/dev/sdb root=/dev/sdb")

Any ideas of enhancement regarding this tool is welcome.



How To-Best Practice
Comment List
  • eroemer, you are exactly on the right track with your thinking. I actually accomplished this using the Suse Linux Enterprise Desktop default install and the Partitioner tool available through Yast. I simply shrunk the fat32 partition down to 1GB (could go smaller but I might put other tools in here), and then created an ext3 partition to fill the rest of the disk.

    In settings.txt I changed this portion to create another folder and mount the second partition.
    # Mount your USB Pen Drive, so your script and images can be located. Don't mind the errors at the linux promt on imaging.
    mkdir /usbhd
    mount /dev/sdb1 /usbhd
    mkdir /usbhd2
    mount /dev/sdb2 /usbhd2

    In the PrebootScriptUSB.s I made the following changes.

    #Because we reimage existing computers to upgrade to Windows 7
    WSNAME=`zisview ComputerName`


    #Because we have all DELL laptops and desktops
    ### Add-on Image ###

    MODEL=`hwinfo --bios | grep Product`
    case $MODEL in
    echo "Unknown model ($MODEL) aborting..."
    exit 1

    #Portion for local imaging
    # I use the shortened commands with a dash "-" because they are the only ones that have worked for me consistently when typing or scripting commands. Depending how you install Windows (XP or 7) you may not need the -size=100 or -pc2 commands, those create the System boot partition that Windows 7 uses by default.

    #Deletes all existing partitions
    img -pd-all
    #Creates a boot partition of 100MB
    img -pc1 -type=ntfs -size=100
    #Makes the boot partition active aka bootable
    img -pa1
    #Creates a Windows partition on the rest of the disk (size is overridden by what's in your image)
    img -pc2 -type=ntfs
    #Applies all the partitions from a Windows image to the newly created partitions
    img -rl /usbhd2/Win7-Base-Clean-MAK.ZMG
    #Applies the model specific addon file containing drivers etc.
    img -rl /usbhd2/$ADDON
    #Applies an unattend.xml addon for sysprep customization.
    img -rl /usbhd2/Win7-Addon-SOS-unattend-sr0.xml.ZMG
    #Applies an addon that contains the Zenworks Adaptive Agent
    img -rl /usbhd2/Win7-Addon-ZenworksAdaptiveAgent-x64.zmg

    One thing I've noticed is I feel like this whole Unetbootin process may not be using the Tuxera enhanced NTFS driver, even though I specified to use the tntfs_bootcd.iso for the script and it appears to have put the tntfs.ko in the addin folder. This might require an extra module loaded that doesn't get called, but I haven't had time to dig into it yet.
  • I get a digital signature error from CreateUSB.ps1 and the process then fails.
  • Hi eroemer

    It would be nice if it could run on one of these file systems... but since that's not the case, we are limited by the file size FAT16/32 supports.

  • Sure it would proparbly works just fine... the reason why I did not create a "grep" function is that I wanted to make a fully automatically method. If you want, I'll see to make a new version and make it a little more changeable ;)

    The last part, I've not seen before... Does it crash before getting to the prompt part?

  • I am not real familiar with various file systems for boot devices---is there a reason the boot partition on the USB device is formatted using FAT32 and not NTFS or EXT4? Can a USB device be bootable if it is NTFS or EXT4?
  • I tried that method a few times, but for some reason never have been able to get a bootable disk. Your automated method is the only method I have had any success with.

    I was going to try and use the automated method on an 80 GB USB HD, but can't get it to run with a HD, only with a flash drive. I then wanted to use a 32GB USB flash drive. I was thinking I could use the automated method on the 32GB flash drive, then use Gparted to resize the FAT32 partition and add an EXT4 partition for the images. I would then likely have to modify some boot file so it would mount the EXT4 partition. Any suggestions?
  • Thank you for the help. I ended up playing around and putting another keyboard pause in before anything would be formatted or written. I was able to hard code it to do my memory key without over-writing my hard drivers.

    It would be wonderful if the script simply prompted you to type in the drive letter. The Powershell script could still display what drives were available and then just prompt for input of the drive letter.

    As a side note, I'm forgetting something on the "bootcd" configuration, the USB key keeps prompting to create the zen partition and it can't be bypassed to get to a shell prompt and run img commands. I commented out the partition size in the settings.txt file, I guess I've forgotten my zenfu over the years. Our bootcds don't require us to create zen partitions but just go to a manual prompt, any suggestions?

    Thanks again,
  • Hi

    Now haven't tested it yet, but it should work. If you change the variable "$diskdrive" to the right driveletter, it would go through the hole script. It's the $diskdrive that's used when the files are copied etc. The format should be "X:".
    If you can wait, I'll be happy test on monday ;-)
  • Great project and thank you for doing this for the community.

    Is there any way to convince you to modify the script to allow one to specify the drive letter to use? I have multiple external USB 3.0 hard drives on my management system and can't unhook them to create a bootable USB. I looked at the PowerShell code but I'm not familiar with it.

    It looks like I might be able to change
    $wmi = Get-WmiObject -Class win32_volume -Filter "driveletter = '$diskdrive'"
    $wmi = "g:"

    But I'm a little nervous to experiment on a live system
Related Discussions