<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 宋体; COLOR: #000000; FONT-SIZE: 10.5pt
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.6001.19298"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>i'm so sorry that i still don't know what to do, i execute the command 
</DIV>
<DIV>but [virt-sysprep: unknown option `--firstboot' ] execption 
happens,</DIV>
<DIV>could you show me the detail? Thanks!</DIV>
<DIV> </DIV>
<DIV>and i have another question: </DIV>
<DIV style="TEXT-INDENT: 2em">now , i use ssh2 api to execute the remote 
virt-XXX(virt-win-reg virt-sysprep ......) command,</DIV>
<DIV style="TEXT-INDENT: 2em">is there java api like guestfs?</DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>

<DIV><SPAN>周涛</SPAN></DIV>
<DIV> </DIV>
<DIV 
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV 
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:rjones@redhat.com">Richard W.M. 
Jones</A></DIV>
<DIV><B>Date:</B> 2012-08-29 16:46</DIV>
<DIV><B>To:</B> <A href="mailto:tao.zhou@neusoft.com">周涛</A></DIV>
<DIV><B>CC:</B> <A href="mailto:libguestfs@redhat.com">libguestfs</A></DIV>
<DIV><B>Subject:</B> Re: Re: libguestfs! help!</DIV></DIV></DIV>
<DIV>
<DIV>On Wed, Aug 29, 2012 at 11:34:51AM +0800, 周涛 wrote:</DIV>
<DIV>> i try it in my environment,it allways throws the exception :</DIV>
<DIV>> com.redhat.et.libguestfs.LibGuestFSException: sh: /bin/sh: Exec format error</DIV>
<DIV>> then i try the following programs, "Exec format error" still happens:</DIV>
<DIV>> String cmd1 = "chkconfig --add tomcat";</DIV>
<DIV>> g.sh(cmd1);</DIV>
<DIV>> String cmd2 = "/sbin/chkconfig --add tomcat";</DIV>
<DIV>> g.sh(cmd2);</DIV>
<DIV>> String[] cmd = new String[] {"/sbin/chkconfig", "--list"};</DIV>
<DIV>> g.command(cmd);</DIV>
<DIV>> but i can execute the command in system, could show me the reason, Thanks!</DIV>
<DIV> </DIV>
<DIV>Well it's something to do with the guest being either a much older or</DIV>
<DIV>much newer version of Linux than the host, or perhaps it's a different</DIV>
<DIV>architecture (32 vs 64 bits?), or not even Linux at all.</DIV>
<DIV> </DIV>
<DIV>The way to solve this is to use a firstboot script:</DIV>
<DIV> </DIV>
<DIV>> From: Richard W.M. Jones</DIV>
<DIV>> Date: 2012-08-28 00:39</DIV>
<DIV>> To: libguestfs@redhat.com</DIV>
<DIV>[...]</DIV>
<DIV>> However to run the command it may be better to run the command using a</DIV>
<DIV>> "firstboot" script.  See:</DIV>
<DIV>> </DIV>
<DIV>>   http://libguestfs.org/guestfs.3.html#running-commands</DIV>
<DIV>>   http://libguestfs.org/virt-sysprep.1.html#firstboot-</DIV>
<DIV>> </DIV>
<DIV>> (Note that the ability to use firstboot scripts was only added very</DIV>
<DIV>> recently to virt-sysprep).</DIV>
<DIV> </DIV>
<DIV>Rich.</DIV>
<DIV> </DIV>
<DIV>-- </DIV>
<DIV>Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones</DIV>
<DIV>virt-df lists disk usage of guests without needing to install any</DIV>
<DIV>software inside the virtual machine.  Supports Linux and Windows.</DIV>
<DIV>http://et.redhat.com/~rjones/virt-df/</DIV></DIV><p>---------------------------------------------------------------------------------------------------<br>
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) <br>
is intended only for the use of the intended recipient and may be confidential and/or privileged of <br>
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is <br>
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying <br>
is strictly prohibited, and may be unlawful.If you have received this communication in error,please <br>
immediately notify the sender by return e-mail, and delete the original message and all copies from <br>
your system. Thank you. <br>
---------------------------------------------------------------------------------------------------</p></BODY></HTML>