On Wed, Aug 29, 2012 at 12:13:41PM +0000, tao.zhou(a)neusoft.com wrote:
>Well as I said, the --firstboot option was only added very
recently.
>You could try to copy what this option does by looking at the source
>code:
>https://github.com/libguestfs/libguestfs/blob/c638e1f03d2700560fe32c0889224ac29bd52334/sysprep/firstboot.ml
>But I don't have the time to translate all that into Java for you.
>You'll have to ask a local expert.
thanks for your help,at last,is the following right?
1、update my local libguest envirment to recent virsion
2、create a shell to execute my command(for example : chkconfig --add tomcat)
3、upload the shell to vm
You don't need to upload the shell script. The --firstboot
option uploads it for you.
4、execute the command in this format
virt-sysprep -a XXXX.img \
--firstboot XXX.sh
5、startup my VM
Yes.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v