Figured it out.

The generated script had CRLF line termination. When we have removed the \r from the end if line everything started to work.

Thanks for the help.

Regards,
Peter
On 14 Mar 2017, at 17:00, Richard W.M. Jones <rjones@redhat.com> wrote:

On Tue, Mar 14, 2017 at 04:46:41PM +0200, Keresztes Péter-Zoltán wrote:
We are enforcing #!/bin/bash at the beginning of the scripts and bash is installed in every guest. 

No idea in that case.  Suggest using guestfish on the guest
after virt-customize has run to check that the files are
really being installed in the right places and have the
right permissions etc.

Rich.

Regards, 
Peter


2017. márc. 14. dátummal, 16:14 időpontban Richard W.M. Jones <rjones@redhat.com> írta:

On Tue, Mar 14, 2017 at 03:45:34PM +0200, Keresztes Péter-Zoltán wrote:
I am running libguestfs version 1.34.2

As far as I know, this version should contain all the fixes for Debian
firstboot issues, in particular the ones related to
https://bugzilla.redhat.com/1019388

The issue is the following. When I start the vm with virt-log I see this:

Mar 13 17:33:30 multi6 firstboot.sh[358]: /usr/lib/virt-sysprep/firstboot.sh start
Mar 13 17:33:30 multi6 cron[359]: (CRON) INFO (Running @reboot jobs)
Mar 13 17:33:30 multi6 firstboot.sh[358]: Scripts dir: /usr/lib/virt-sysprep/scripts
Mar 13 17:33:30 multi6 firstboot.sh[358]: === Running /usr/lib/virt-sysprep/scripts/0001--utilities-1041-startup-sh ===
Mar 13 17:33:30 multi6 firstboot.sh[358]: /usr/lib/virt-sysprep/firstboot.sh: 35: /usr/lib/virt-sysprep/firstboot.sh: /usr/lib/virt-sysprep/scripts-done/0001--utilities-1041-startup-sh: not found

I wonder if it's because the script contains a hash-bang path to a
non-existing interpreter.  IOW if the script starts with `#!/bin/bash'
then you would have to install bash in the guest.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top