Re: [Libguestfs] libguestfs! help!
On Sun, Aug 26, 2012 at 09:52:23PM -0400, tao zhou wrote:
hello everyone!
first i use libguestfs API to upload a file into my linux VM , and then i want to execute some command(for example : tar xzvf XXX、 chkconfig --add XXX) to config my application by java libguestfs API,what should i do? could you show me an example in java? Thanks!
Attached is a simple example in Java. However to run the command it may be better to run the command using a "firstboot" script. See: http://libguestfs.org/guestfs.3.html#running-commands http://libguestfs.org/virt-sysprep.1.html#firstboot- (Note that the ability to use firstboot scripts was only added very recently to virt-sysprep). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
I realized that this code is missing the call to shutdown the disk and detect write errors. (Sorry about that -- the code was adapted from a read-only example where this is not necessary).
// Unmount everything. g.umount_all ();
After these two lines, add: g.shutdown (); g.close (); 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
thaks for your help! 周涛 From: Richard W.M. Jones Date: 2012-08-28 04:26 To: libguestfs@redhat.com CC: tao.zhou@neusoft.com Subject: Re: [Libguestfs] libguestfs! help! I realized that this code is missing the call to shutdown the disk and detect write errors. (Sorry about that -- the code was adapted from a read-only example where this is not necessary).
// Unmount everything. g.umount_all ();
After these two lines, add: g.shutdown (); g.close (); 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 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
i try it in my environment,it allways throws the exception : com.redhat.et.libguestfs.LibGuestFSException: sh: /bin/sh: Exec format error then i try the following programs, "Exec format error" still happens: String cmd1 = "chkconfig --add tomcat"; g.sh(cmd1); String cmd2 = "/sbin/chkconfig --add tomcat"; g.sh(cmd2); String[] cmd = new String[] {"/sbin/chkconfig", "--list"}; g.command(cmd); but i can execute the command in system, could show me the reason, Thanks! 周涛 From: Richard W.M. Jones Date: 2012-08-28 00:39 To: libguestfs@redhat.com CC: tao.zhou@neusoft.com Subject: Re: libguestfs! help! On Sun, Aug 26, 2012 at 09:52:23PM -0400, tao zhou wrote:
hello everyone!
first i use libguestfs API to upload a file into my linux VM , and then i want to execute some command(for example : tar xzvf XXX、 chkconfig --add XXX) to config my application by java libguestfs API,what should i do? could you show me an example in java? Thanks!
Attached is a simple example in Java. However to run the command it may be better to run the command using a "firstboot" script. See: http://libguestfs.org/guestfs.3.html#running-commands http://libguestfs.org/virt-sysprep.1.html#firstboot- (Note that the ability to use firstboot scripts was only added very recently to virt-sysprep). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Wed, Aug 29, 2012 at 11:34:51AM +0800, 周涛 wrote:
i try it in my environment,it allways throws the exception : com.redhat.et.libguestfs.LibGuestFSException: sh: /bin/sh: Exec format error then i try the following programs, "Exec format error" still happens: String cmd1 = "chkconfig --add tomcat"; g.sh(cmd1); String cmd2 = "/sbin/chkconfig --add tomcat"; g.sh(cmd2); String[] cmd = new String[] {"/sbin/chkconfig", "--list"}; g.command(cmd); but i can execute the command in system, could show me the reason, Thanks!
Well it's something to do with the guest being either a much older or much newer version of Linux than the host, or perhaps it's a different architecture (32 vs 64 bits?), or not even Linux at all. The way to solve this is to use a firstboot script:
From: Richard W.M. Jones Date: 2012-08-28 00:39 To: libguestfs@redhat.com [...] However to run the command it may be better to run the command using a "firstboot" script. See:
http://libguestfs.org/guestfs.3.html#running-commands http://libguestfs.org/virt-sysprep.1.html#firstboot-
(Note that the ability to use firstboot scripts was only added very recently to virt-sysprep).
Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
i'm so sorry that i still don't know what to do, i execute the command but [virt-sysprep: unknown option `--firstboot' ] execption happens, could you show me the detail? Thanks! and i have another question: now , i use ssh2 api to execute the remote virt-XXX(virt-win-reg virt-sysprep ......) command, is there java api like guestfs? 周涛 From: Richard W.M. Jones Date: 2012-08-29 16:46 To: 周涛 CC: libguestfs Subject: Re: Re: libguestfs! help! On Wed, Aug 29, 2012 at 11:34:51AM +0800, 周涛 wrote:
i try it in my environment,it allways throws the exception : com.redhat.et.libguestfs.LibGuestFSException: sh: /bin/sh: Exec format error then i try the following programs, "Exec format error" still happens: String cmd1 = "chkconfig --add tomcat"; g.sh(cmd1); String cmd2 = "/sbin/chkconfig --add tomcat"; g.sh(cmd2); String[] cmd = new String[] {"/sbin/chkconfig", "--list"}; g.command(cmd); but i can execute the command in system, could show me the reason, Thanks!
Well it's something to do with the guest being either a much older or much newer version of Linux than the host, or perhaps it's a different architecture (32 vs 64 bits?), or not even Linux at all. The way to solve this is to use a firstboot script:
From: Richard W.M. Jones Date: 2012-08-28 00:39 To: libguestfs@redhat.com [...] However to run the command it may be better to run the command using a "firstboot" script. See:
http://libguestfs.org/guestfs.3.html#running-commands http://libguestfs.org/virt-sysprep.1.html#firstboot-
(Note that the ability to use firstboot scripts was only added very recently to virt-sysprep).
Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/ --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Wed, Aug 29, 2012 at 05:56:17PM +0800, 周涛 wrote:
i'm so sorry that i still don't know what to do, i execute the command but [virt-sysprep: unknown option `--firstboot' ] execption happens, could you show me the detail? Thanks!
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/c638e1f03d2700560fe32c0889224a... But I don't have the time to translate all that into Java for you. You'll have to ask a local expert.
and i have another question: now , i use ssh2 api to execute the remote virt-XXX(virt-win-reg virt-sysprep ......) command, is there java api like guestfs?
No idea about this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
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/c638e1f03d2700560fe32c0889224a... 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 4、execute the command in this format virt-sysprep -a XXXX.img \ --firstboot XXX.sh 5、startup my VM ________________________________________ 发件人: Richard W.M. Jones [rjones@redhat.com] 发送时间: 2012年8月29日 18:46 收件人: tao.zhou@neusoft.com Cc: libguestfs 主题: Re: Re: libguestfs! help! On Wed, Aug 29, 2012 at 05:56:17PM +0800, 周涛 wrote:
i'm so sorry that i still don't know what to do, i execute the command but [virt-sysprep: unknown option `--firstboot' ] execption happens, could you show me the detail? Thanks!
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/c638e1f03d2700560fe32c0889224a... But I don't have the time to translate all that into Java for you. You'll have to ask a local expert.
and i have another question: now , i use ssh2 api to execute the remote virt-XXX(virt-win-reg virt-sysprep ......) command, is there java api like guestfs?
No idea about this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Wed, Aug 29, 2012 at 12:13:41PM +0000, tao.zhou@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/c638e1f03d2700560fe32c0889224a... 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
:) ________________________________________ 发件人: Richard W.M. Jones [rjones@redhat.com] 发送时间: 2012年8月29日 20:34 收件人: tao.zhou@neusoft.com Cc: libguestfs 主题: Re: 答复: Re: libguestfs! help! On Wed, Aug 29, 2012 at 12:13:41PM +0000, tao.zhou@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/c638e1f03d2700560fe32c0889224a... 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 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
hi Jones! i configured this virsion with the following command : ./configure --disable-ocaml --disable-perl --disable-ruby --disable-haskell --disable-php --with-java-home=no but make command leads to : make[5]: Entering directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' make[5]: `stamp-generator' is up to date. make[5]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' GISCAN Guestfs-1.0.gir /usr/local/lib/libguestfs.so.0: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status linking of temporary binary failed: Command '['bash', '../libtool-kill-dependency_libs.sh', '../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0', '-export-dynamic', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0.o', '-L.', 'libguestfs-gobject-1.0.la', '-pthread', '-Wl,--export-dynamic', '-lgio-2.0', '-lgobject-2.0', '-lgthread-2.0', '-lgmodule-2.0', '-lrt', '-lglib-2.0']' returned non-zero exit status 1 make[4]: *** [Guestfs-1.0.gir] Error 1 make[4]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35' make: *** [all] Error 2 is there something need to be installed? could you help me oncemore. Thanks! 周涛 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On 08/31/2012 01:28 PM, 周涛 wrote:
hi Jones!
i configured this virsion with the following command : ./configure --disable-ocaml --disable-perl --disable-ruby --disable-haskell --disable-php --with-java-home=no
Add --disable-gobject can solve this problem. Thanks, Wanlong Gao
but make command leads to :
make[5]: Entering directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' make[5]: `stamp-generator' is up to date. make[5]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' GISCAN Guestfs-1.0.gir /usr/local/lib/libguestfs.so.0: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['bash', '../libtool-kill-dependency_libs.sh', '../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0', '-export-dynamic', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0.o', '-L.', 'libguestfs-gobject-1.0.la', '-pthread', '-Wl,--export-dynamic', '-lgio-2.0', '-lgobject-2.0', '-lgthread-2.0', '-lgmodule-2.0', '-lrt', '-lglib-2.0']' returned non-zero exit status 1
make[4]: *** [Guestfs-1.0.gir] Error 1 make[4]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35' make: *** [all] Error 2
is there something need to be installed? could you help me oncemore.
Thanks!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 周涛
--------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
does redhat supply an free yum repo for installing the latest version libguestfs? now , i use 163 yum repo, but it's latest version is 1.18.6 周涛 From: Wanlong Gao Date: 2012-08-31 13:35 To: 周涛 CC: rjones; libguestfs Subject: Re: [Libguestfs] compile libguestfs 1.19.35 On 08/31/2012 01:28 PM, 周涛 wrote:
hi Jones!
i configured this virsion with the following command : ./configure --disable-ocaml --disable-perl --disable-ruby --disable-haskell --disable-php --with-java-home=no
Add --disable-gobject can solve this problem. Thanks, Wanlong Gao
but make command leads to :
make[5]: Entering directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' make[5]: `stamp-generator' is up to date. make[5]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' GISCAN Guestfs-1.0.gir /usr/local/lib/libguestfs.so.0: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['bash', '../libtool-kill-dependency_libs.sh', '../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0', '-export-dynamic', '/home/zhoutao/upload/libguestfs-1.19.35/gobject/tmp-introspectoNR7uD/Guestfs-1.0.o', '-L.', 'libguestfs-gobject-1.0.la', '-pthread', '-Wl,--export-dynamic', '-lgio-2.0', '-lgobject-2.0', '-lgthread-2.0', '-lgmodule-2.0', '-lrt', '-lglib-2.0']' returned non-zero exit status 1
make[4]: *** [Guestfs-1.0.gir] Error 1 make[4]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/gobject' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35' make: *** [all] Error 2
is there something need to be installed? could you help me oncemore.
Thanks!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 周涛
--------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
--------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On 08/31/2012 04:31 PM, 周涛 wrote:
does redhat supply an free yum repo for installing the latest version libguestfs? now , i use 163 yum repo, but it's latest version is 1.18.6
You can compile from the source package which can be found here http://libguestfs.org/download/1.19-development/ Thanks, Wanlong Gao
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 周涛
On Fri, Aug 31, 2012 at 04:31:26PM +0800, 周涛 wrote:
does redhat supply an free yum repo for installing the latest version libguestfs? now , i use 163 yum repo, but it's latest version is 1.18.6
Latest is 1.18.7 actually ... We supply several repos. What is your base OS? RHEL? Fedora? Which version? 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
my OS is Fedora release 17 (Beefy Miracle) . I have installed libguestfs1.19.35, and i can execute command (virt-sysprep --firstboot ..........) , but it leads to the following error: [root@libguestfs-dev ~]# virt-sysprep --firstboot /home/zhoutao/addService.sh -a /mnt/vmware/volumes/FC_Storage/zhoutao-linux/zhoutao-linux-flat.vmdk Examining the guest ... Performing "yum-uuid" ... Performing "utmp" ... Performing "udev-persistent-net" ... Performing "sssd-db-log" ... Performing "ssh-userdir" ... Performing "ssh-hostkeys" ... Performing "smolt-uuid" ... Performing "script" ... Performing "samba-db-log" ... Performing "rhn-systemid" ... Performing "random-seed" ... Performing "puppet-data-log" ... Performing "pam-data" ... Performing "package-manager-cache" ... Performing "pacct-log" ... Performing "net-hwaddr" ... Performing "mail-spool" ... Performing "machine-id" ... Performing "logfiles" ... Performing "hostname" ... Performing "firstboot" ... Performing "dovecot-data" ... Performing "dhcp-server-state" ... Performing "dhcp-client-state" ... Performing "cron-spool" ... Performing "blkid-tab" ... Performing "bash-history" ... Performing "abrt-data" ... Performing "lvm-uuids" ... virt-sysprep: symbol lookup error: virt-sysprep: undefined symbol: guestfs_pvchange_uuid_all [root@libguestfs-dev ~]# 周涛 From: Richard W.M. Jones Date: 2012-08-31 16:56 To: 周涛 CC: gaowanlong@cn.fujitsu.com; libguestfs Subject: Re: Re: [Libguestfs] compile libguestfs 1.19.35 On Fri, Aug 31, 2012 at 04:31:26PM +0800, 周涛 wrote:
does redhat supply an free yum repo for installing the latest version libguestfs? now , i use 163 yum repo, but it's latest version is 1.18.6
Latest is 1.18.7 actually ... We supply several repos. What is your base OS? RHEL? Fedora? Which version? 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 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Fri, Aug 31, 2012 at 05:56:06PM +0800, 周涛 wrote:
my OS is Fedora release 17 (Beefy Miracle) .
I have installed libguestfs1.19.35, and i can execute command (virt-sysprep --firstboot ..........) ,
So you compiled libguestfs 1.19.35 from source on Fedora 17? Or you installed libguestfs-1.19.35-1.fc18 onto Fedora 17? Please explain exactly what you're running.
virt-sysprep: symbol lookup error: virt-sysprep: undefined symbol: guestfs_pvchange_uuid_all
This would be a bug, but the error message is very strange indeed. It seems to indicate that you're using a later virt-sysprep binary linked to an earlier libguestfs.so.0. You may have done something like copying the virt-sysprep binary from one machine to another, which won't work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Maybe you compiled libguestfs locally and are running virt-sysprep from the local directory? In that can you have to use the ./run script, ie: ./run ./sysprep/virt-sysprep [..] The README file covers this. 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
i yum install V1.18.6 on Fedora 17, and then compiled libguestfs 1.19.35 from source on the same machine, although the installing is error, the local guestfs version has been changed to 1.19.35,and i can execute [--firstboot] command,so your guess is right。 next monday, i will test as you say, thank you for your patient help ________________________________________ 发件人: Richard W.M. Jones [rjones@redhat.com] 发送时间: 2012年8月31日 19:07 收件人: tao.zhou@neusoft.com Cc: gaowanlong@cn.fujitsu.com; libguestfs 主题: Re: Re: [Libguestfs] compile libguestfs 1.19.35 Maybe you compiled libguestfs locally and are running virt-sysprep from the local directory? In that can you have to use the ./run script, ie: ./run ./sysprep/virt-sysprep [..] The README file covers this. 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 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Fri, Aug 31, 2012 at 11:56:15AM +0000, tao.zhou@neusoft.com wrote:
i yum install V1.18.6 on Fedora 17, and then compiled libguestfs 1.19.35 from source on the same machine, although the installing is error, the local guestfs version has been changed to 1.19.35,and i can execute [--firstboot] command,so your guess is right。 next monday, i will test as you say, thank you for your patient help
Compiling from source is great, but you probably shouldn't try to 'make install', since that will overwrite parts of the already-installed RPM (or else it will install in /usr/local meaning that you've got a confusing mix of two systems installed). Much better to just use ./run and run everything from the local copy, so: ./run ./sysprep/virt-sysprep --firstboot foo.sh -a disk.img (with sudo if it needs to run as root to access the disk). The ./run script sets up environment variables so it always ignores any installed version. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
hi jones! i compile this version from source on a new VM (no libguest is installed) , after excute "./config", "make" lead to the following error, what should i do: ...... make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfs_la-guestfs.lo CC libguestfs_la-actions.lo CC libguestfs_la-appliance.lo CC libguestfs_la-bindtests.lo CC libguestfs_la-dbdump.lo CC libguestfs_la-events.lo CC libguestfs_la-file.lo CC libguestfs_la-filearch.lo CC libguestfs_la-fuse.lo CC libguestfs_la-inspect.lo CC libguestfs_la-inspect-apps.lo CC libguestfs_la-inspect-fs.lo CC libguestfs_la-inspect-fs-cd.lo CC libguestfs_la-inspect-fs-unix.lo CC libguestfs_la-inspect-fs-windows.lo CC libguestfs_la-inspect-icon.lo CC libguestfs_la-launch.lo CC libguestfs_la-launch-appliance.lo CC libguestfs_la-launch-libvirt.lo CC libguestfs_la-launch-unix.lo CC libguestfs_la-libvirtdomain.lo CC libguestfs_la-listfs.lo CC libguestfs_la-match.lo CC libguestfs_la-proto.lo CCLD libguestfs.la make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' Making all in examples make[2]: Entering directory `/home/libguest_test/libguestfs-1.19.35/examples' CCLD create_disk ../src/.libs/libguestfs.so: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status make[2]: *** [create_disk] Error 1 make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/examples' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/libguest_test/libguestfs-1.19.35' make: *** [all] Error 2 Thanks! 周涛 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Tue, Sep 04, 2012 at 06:45:46PM +0800, 周涛 wrote:
hi jones!
i compile this version from source on a new VM (no libguest is installed) , after excute "./config", "make" lead to the following error, what should i do: ...... make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfs_la-guestfs.lo CC libguestfs_la-actions.lo CC libguestfs_la-appliance.lo CC libguestfs_la-bindtests.lo CC libguestfs_la-dbdump.lo CC libguestfs_la-events.lo CC libguestfs_la-file.lo CC libguestfs_la-filearch.lo CC libguestfs_la-fuse.lo CC libguestfs_la-inspect.lo CC libguestfs_la-inspect-apps.lo CC libguestfs_la-inspect-fs.lo CC libguestfs_la-inspect-fs-cd.lo CC libguestfs_la-inspect-fs-unix.lo CC libguestfs_la-inspect-fs-windows.lo CC libguestfs_la-inspect-icon.lo CC libguestfs_la-launch.lo CC libguestfs_la-launch-appliance.lo CC libguestfs_la-launch-libvirt.lo CC libguestfs_la-launch-unix.lo CC libguestfs_la-libvirtdomain.lo CC libguestfs_la-listfs.lo CC libguestfs_la-match.lo CC libguestfs_la-proto.lo CCLD libguestfs.la make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' Making all in examples make[2]: Entering directory `/home/libguest_test/libguestfs-1.19.35/examples' CCLD create_disk ../src/.libs/libguestfs.so: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status
This is approximately the same error as before, and the fix is the same: https://www.redhat.com/archives/libguestfs/2012-August/msg00167.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
thanks! please forgive my forgetfulness ! :) 周涛 From: Richard W.M. Jones Date: 2012-09-04 18:58 To: 周涛 CC: libguestfs Subject: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 06:45:46PM +0800, 周涛 wrote:
hi jones!
i compile this version from source on a new VM (no libguest is installed) , after excute "./config", "make" lead to the following error, what should i do: ...... make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfs_la-guestfs.lo CC libguestfs_la-actions.lo CC libguestfs_la-appliance.lo CC libguestfs_la-bindtests.lo CC libguestfs_la-dbdump.lo CC libguestfs_la-events.lo CC libguestfs_la-file.lo CC libguestfs_la-filearch.lo CC libguestfs_la-fuse.lo CC libguestfs_la-inspect.lo CC libguestfs_la-inspect-apps.lo CC libguestfs_la-inspect-fs.lo CC libguestfs_la-inspect-fs-cd.lo CC libguestfs_la-inspect-fs-unix.lo CC libguestfs_la-inspect-fs-windows.lo CC libguestfs_la-inspect-icon.lo CC libguestfs_la-launch.lo CC libguestfs_la-launch-appliance.lo CC libguestfs_la-launch-libvirt.lo CC libguestfs_la-launch-unix.lo CC libguestfs_la-libvirtdomain.lo CC libguestfs_la-listfs.lo CC libguestfs_la-match.lo CC libguestfs_la-proto.lo CCLD libguestfs.la make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' Making all in examples make[2]: Entering directory `/home/libguest_test/libguestfs-1.19.35/examples' CCLD create_disk ../src/.libs/libguestfs.so: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status
This is approximately the same error as before, and the fix is the same: https://www.redhat.com/archives/libguestfs/2012-August/msg00167.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
after change the source file dbdump.c, "make" leads to : make all-am make[3]: Entering directory `/home/libguest_test/libguestfs-1.19.35/fish' make -C ../generator stamp-generator make[4]: Entering directory `/home/libguest_test/libguestfs-1.19.35/generator' make[4]: `stamp-generator' is up to date. make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CCLD guestfish guestfish-progress.o: In function `progress_bar_init': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:121: undefined reference to `tgetent' guestfish-progress.o: In function `progress_bar_set': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:274: undefined reference to `tgetnum' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `UP' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `tputs' collect2: error: ld returned 1 exit status make[3]: *** [guestfish] Error 1 make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/fish' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/fish' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/libguest_test/libguestfs-1.19.35' make: *** [all] Error 2 周涛 From: Richard W.M. Jones Date: 2012-09-04 18:58 To: 周涛 CC: libguestfs Subject: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 06:45:46PM +0800, 周涛 wrote:
hi jones!
i compile this version from source on a new VM (no libguest is installed) , after excute "./config", "make" lead to the following error, what should i do: ...... make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfs_la-guestfs.lo CC libguestfs_la-actions.lo CC libguestfs_la-appliance.lo CC libguestfs_la-bindtests.lo CC libguestfs_la-dbdump.lo CC libguestfs_la-events.lo CC libguestfs_la-file.lo CC libguestfs_la-filearch.lo CC libguestfs_la-fuse.lo CC libguestfs_la-inspect.lo CC libguestfs_la-inspect-apps.lo CC libguestfs_la-inspect-fs.lo CC libguestfs_la-inspect-fs-cd.lo CC libguestfs_la-inspect-fs-unix.lo CC libguestfs_la-inspect-fs-windows.lo CC libguestfs_la-inspect-icon.lo CC libguestfs_la-launch.lo CC libguestfs_la-launch-appliance.lo CC libguestfs_la-launch-libvirt.lo CC libguestfs_la-launch-unix.lo CC libguestfs_la-libvirtdomain.lo CC libguestfs_la-listfs.lo CC libguestfs_la-match.lo CC libguestfs_la-proto.lo CCLD libguestfs.la make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/src' Making all in examples make[2]: Entering directory `/home/libguest_test/libguestfs-1.19.35/examples' CCLD create_disk ../src/.libs/libguestfs.so: undefined reference to `guestfs___read_db_dump' collect2: error: ld returned 1 exit status
This is approximately the same error as before, and the fix is the same: https://www.redhat.com/archives/libguestfs/2012-August/msg00167.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Tue, Sep 04, 2012 at 07:24:14PM +0800, 周涛 wrote:
after change the source file dbdump.c, "make" leads to : make all-am make[3]: Entering directory `/home/libguest_test/libguestfs-1.19.35/fish' make -C ../generator stamp-generator make[4]: Entering directory `/home/libguest_test/libguestfs-1.19.35/generator' make[4]: `stamp-generator' is up to date. make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CCLD guestfish guestfish-progress.o: In function `progress_bar_init': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:121: undefined reference to `tgetent' guestfish-progress.o: In function `progress_bar_set': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:274: undefined reference to `tgetnum' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `UP' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `tputs' collect2: error: ld returned 1 exit status
This one's quite common -- it should probably be a FAQ. It happens because you have the libtinfo library missing: $ nm -D /usr/lib64/libtinfo.so.5.9 | grep tgetnum 0000003520012350 T tgetnum $ nm -D /usr/lib64/libtinfo.so.5.9 | grep UP 0000003520228e68 B UP This library is part of ncurses. Make sure ncurses-devel is installed (or whatever the equivalent is on your distro, maybe libncurses-dev), and then you *must* rerun ./configure. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
i have installed ncurses-devel, but the libtinfo.so.5.9 path is : /usr/lib/libtinfo.so.5.9 $ nm -D /usr/lib/libtinfo.so.5.9 | grep tgetnum 4cec7ab0 T tgetnum $ nm -D /usr/lib/libtinfo.so.5.9 | grep UP 4cedb884 B UP 周涛 From: Richard W.M. Jones Date: 2012-09-04 19:33 To: 周涛 CC: libguestfs Subject: Re: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 07:24:14PM +0800, 周涛 wrote:
after change the source file dbdump.c, "make" leads to : make all-am make[3]: Entering directory `/home/libguest_test/libguestfs-1.19.35/fish' make -C ../generator stamp-generator make[4]: Entering directory `/home/libguest_test/libguestfs-1.19.35/generator' make[4]: `stamp-generator' is up to date. make[4]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CCLD guestfish guestfish-progress.o: In function `progress_bar_init': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:121: undefined reference to `tgetent' guestfish-progress.o: In function `progress_bar_set': /home/libguest_test/libguestfs-1.19.35/fish/progress.c:274: undefined reference to `tgetnum' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `UP' /home/libguest_test/libguestfs-1.19.35/fish/progress.c:279: undefined reference to `tputs' collect2: error: ld returned 1 exit status
This one's quite common -- it should probably be a FAQ. It happens because you have the libtinfo library missing: $ nm -D /usr/lib64/libtinfo.so.5.9 | grep tgetnum 0000003520012350 T tgetnum $ nm -D /usr/lib64/libtinfo.so.5.9 | grep UP 0000003520228e68 B UP This library is part of ncurses. Make sure ncurses-devel is installed (or whatever the equivalent is on your distro, maybe libncurses-dev), and then you *must* rerun ./configure. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Tue, Sep 04, 2012 at 07:58:59PM +0800, 周涛 wrote:
i have installed ncurses-devel, but the libtinfo.so.5.9 path is : /usr/lib/libtinfo.so.5.9
$ nm -D /usr/lib/libtinfo.so.5.9 | grep tgetnum 4cec7ab0 T tgetnum $ nm -D /usr/lib/libtinfo.so.5.9 | grep UP 4cedb884 B UP
That's OK. /usr/lib64 is a Fedora-ism. Now run ./configure && make Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
the error changed to : make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfsmod_la-guestfs-py.lo In file included from guestfs-py.c:29:0: guestfs-py.h:25:20: fatal error: Python.h: No such file or directory compilation terminated. make[2]: *** [libguestfsmod_la-guestfs-py.lo] Error 1 make[2]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/python' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/libguest_test/libguestfs-1.19.35' make: *** [all] Error 2 周涛 From: Richard W.M. Jones Date: 2012-09-04 20:08 To: 周涛 CC: libguestfs Subject: Re: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 07:58:59PM +0800, 周涛 wrote:
i have installed ncurses-devel, but the libtinfo.so.5.9 path is : /usr/lib/libtinfo.so.5.9
$ nm -D /usr/lib/libtinfo.so.5.9 | grep tgetnum 4cec7ab0 T tgetnum $ nm -D /usr/lib/libtinfo.so.5.9 | grep UP 4cedb884 B UP
That's OK. /usr/lib64 is a Fedora-ism. Now run ./configure && make Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Tue, Sep 04, 2012 at 08:19:47PM +0800, 周涛 wrote:
the error changed to :
make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfsmod_la-guestfs-py.lo In file included from guestfs-py.c:29:0: guestfs-py.h:25:20: fatal error: Python.h: No such file or directory compilation terminated. make[2]: *** [libguestfsmod_la-guestfs-py.lo] Error 1
Python is missing or broken. Install Python? ./configure --disable-python? Did you follow the steps for installing all the dependencies which is in the README file? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
yes, i followed the steps of README, run "./configure" and "make" without any parameters, i think all the dependencies have been installed because of "./configure" could be run successfully. and just now, i rerun "./configure" & "make" for checking, but the error still happened. 周涛 From: Richard W.M. Jones Date: 2012-09-04 20:33 To: 周涛 CC: libguestfs Subject: Re: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 08:19:47PM +0800, 周涛 wrote:
the error changed to :
make[3]: Leaving directory `/home/libguest_test/libguestfs-1.19.35/generator' CC libguestfsmod_la-guestfs-py.lo In file included from guestfs-py.c:29:0: guestfs-py.h:25:20: fatal error: Python.h: No such file or directory compilation terminated. make[2]: *** [libguestfsmod_la-guestfs-py.lo] Error 1
Python is missing or broken. Install Python? ./configure --disable-python? Did you follow the steps for installing all the dependencies which is in the README file? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Tue, Sep 04, 2012 at 08:45:33PM +0800, 周涛 wrote:
yes, i followed the steps of README, run "./configure" and "make" without any parameters, i think all the dependencies have been installed because of "./configure" could be run successfully. and just now, i rerun "./configure" & "make" for checking, but the error still happened.
You need to follow the instructions about how to install dependencies, because you seem to be missing some: https://github.com/libguestfs/libguestfs/blob/2e36adf83ce4a9cbccd313d6f3a88b... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
thanks for your help! i have installed(make install) this version successfully. now, another question, the only way to execute virt-tools command is running "./run ./XXX/virt-XXX", if i want to do that by executing directly "virt-sysprep --[options]" as before, what should i install or what should be config? 周涛 From: Richard W.M. Jones Date: 2012-09-04 20:49 To: 周涛 CC: libguestfs Subject: Re: Re: compile libguestfs 1.19.35 On Tue, Sep 04, 2012 at 08:45:33PM +0800, 周涛 wrote:
yes, i followed the steps of README, run "./configure" and "make" without any parameters, i think all the dependencies have been installed because of "./configure" could be run successfully. and just now, i rerun "./configure" & "make" for checking, but the error still happened.
You need to follow the instructions about how to install dependencies, because you seem to be missing some: https://github.com/libguestfs/libguestfs/blob/2e36adf83ce4a9cbccd313d6f3a88b... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Wed, Sep 05, 2012 at 01:25:18PM +0800, 周涛 wrote:
thanks for your help! i have installed(make install) this version successfully. now, another question, the only way to execute virt-tools command is running "./run ./XXX/virt-XXX", if i want to do that by executing directly "virt-sysprep --[options]" as before, what should i install or what should be config?
It is possible to run 'make install', but we normally do not recommend you do that. To avoid conflicts between other packages, you should build a libguestfs package for your Linux distro, which is not so easy. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Wed, Sep 05, 2012 at 08:07:09AM +0100, Richard W.M. Jones wrote:
It is possible to run 'make install', but we normally do not recommend you do that. To avoid conflicts between other packages, you should build a libguestfs package for your Linux distro, which is not so easy.
Is there a goal at least that if a the group of programs including libvirt and qemu-kvm is built and installed from tar, that it should install with internal consistency regardless of underlying distro? All the distros necessarily lag development here. Sometimes new features are key to a particular deployment. Isn't it a useful goal to produce components such that, if "make install" is used with each of them, the result should be good? Is that the goal of these related projects? Now days, for instance, every distro does a good LAMP stack. But earlier in the development of that stack it was often best to compile it from source, due to versions lagging and distro maintainers making assumptions that weren't well honed. In the first few years of any new stack, shouldn't we expect that many sysadmins will be in the same position? It's best if there's some defined subset of programs whose "make install" options, by default, will produce a coherent stack. Whit
[The context for libvirt users is how to let people do 'make install' without having conflicts with installed copies of packages.] On Wed, Sep 05, 2012 at 07:39:37AM -0400, Whit Blauvelt wrote:
On Wed, Sep 05, 2012 at 08:07:09AM +0100, Richard W.M. Jones wrote:
It is possible to run 'make install', but we normally do not recommend you do that. To avoid conflicts between other packages, you should build a libguestfs package for your Linux distro, which is not so easy.
Is there a goal at least that if a the group of programs including libvirt and qemu-kvm is built and installed from tar, that it should install with internal consistency regardless of underlying distro?
All the distros necessarily lag development here. Sometimes new features are key to a particular deployment. Isn't it a useful goal to produce components such that, if "make install" is used with each of them, the result should be good? Is that the goal of these related projects?
Now days, for instance, every distro does a good LAMP stack. But earlier in the development of that stack it was often best to compile it from source, due to versions lagging and distro maintainers making assumptions that weren't well honed. In the first few years of any new stack, shouldn't we expect that many sysadmins will be in the same position?
It's best if there's some defined subset of programs whose "make install" options, by default, will produce a coherent stack.
I'm not sure how special libvirt & qemu are. You could try installing to a local prefix (I sometimes use "./configure --prefix=$HOME/gnu"). Then you have to sort out the environment variables that need setting. I don't think libvirt or libguestfs or qemu document what environment variables should be set to run an internally consistent local copy of the entire libvirt/KVM stack from your home directory. libguestfs has the "./run" script which can be modified. Anyone got any thoughts? I think it is a genuine concern. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On Wed, Sep 05, 2012 at 12:46:26PM +0100, Richard W.M. Jones wrote:
[The context for libvirt users is how to let people do 'make install' without having conflicts with installed copies of packages.]
On Wed, Sep 05, 2012 at 07:39:37AM -0400, Whit Blauvelt wrote:
On Wed, Sep 05, 2012 at 08:07:09AM +0100, Richard W.M. Jones wrote:
It is possible to run 'make install', but we normally do not recommend you do that. To avoid conflicts between other packages, you should build a libguestfs package for your Linux distro, which is not so easy.
Is there a goal at least that if a the group of programs including libvirt and qemu-kvm is built and installed from tar, that it should install with internal consistency regardless of underlying distro?
All the distros necessarily lag development here. Sometimes new features are key to a particular deployment. Isn't it a useful goal to produce components such that, if "make install" is used with each of them, the result should be good? Is that the goal of these related projects?
Now days, for instance, every distro does a good LAMP stack. But earlier in the development of that stack it was often best to compile it from source, due to versions lagging and distro maintainers making assumptions that weren't well honed. In the first few years of any new stack, shouldn't we expect that many sysadmins will be in the same position?
It's best if there's some defined subset of programs whose "make install" options, by default, will produce a coherent stack.
I'm not sure how special libvirt & qemu are. You could try installing to a local prefix (I sometimes use "./configure --prefix=$HOME/gnu").
Then you have to sort out the environment variables that need setting.
I don't think libvirt or libguestfs or qemu document what environment variables should be set to run an internally consistent local copy of the entire libvirt/KVM stack from your home directory. libguestfs has the "./run" script which can be modified.
Anyone got any thoughts? I think it is a genuine concern.
And DevStack is doing something similar for OpenStack developers ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Wed, Sep 05, 2012 at 12:46:26PM +0100, Richard W.M. Jones wrote:
[The context for libvirt users is how to let people do 'make install' without having conflicts with installed copies of packages.]
On Wed, Sep 05, 2012 at 07:39:37AM -0400, Whit Blauvelt wrote:
On Wed, Sep 05, 2012 at 08:07:09AM +0100, Richard W.M. Jones wrote:
It is possible to run 'make install', but we normally do not recommend you do that. To avoid conflicts between other packages, you should build a libguestfs package for your Linux distro, which is not so easy.
Is there a goal at least that if a the group of programs including libvirt and qemu-kvm is built and installed from tar, that it should install with internal consistency regardless of underlying distro?
All the distros necessarily lag development here. Sometimes new features are key to a particular deployment. Isn't it a useful goal to produce components such that, if "make install" is used with each of them, the result should be good? Is that the goal of these related projects?
Now days, for instance, every distro does a good LAMP stack. But earlier in the development of that stack it was often best to compile it from source, due to versions lagging and distro maintainers making assumptions that weren't well honed. In the first few years of any new stack, shouldn't we expect that many sysadmins will be in the same position?
It's best if there's some defined subset of programs whose "make install" options, by default, will produce a coherent stack.
I'm not sure how special libvirt & qemu are. You could try installing to a local prefix (I sometimes use "./configure --prefix=$HOME/gnu").
Then you have to sort out the environment variables that need setting.
I don't think libvirt or libguestfs or qemu document what environment variables should be set to run an internally consistent local copy of the entire libvirt/KVM stack from your home directory. libguestfs has the "./run" script which can be modified.
Anyone got any thoughts? I think it is a genuine concern.
libvirt will search for QEMU binaries in $PATH. So if you install QEMU to a custom location, just make sure that location comes first in $PATH. WRT to libvirt.so <-> libvirtd, the socket path is based on the install prefix, so if you install libvirt to a non-standard location, you need to make sure you are using the matched libvirt.so and libvirtd. The easiest way todo this is just again make sure $PATH reflects your new install location, and set LD_LIBRARY_PATH so that libguestfs finds the custom libvirt.so too Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
hi jones! is there any way to modify running VM's image using libguestfs? i want to install some softwares onto the running vm. Thanks! 周涛 --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On 09/06/2012 03:58 PM, 周涛 wrote:
hi jones!
is there any way to modify running VM's image using libguestfs? i want to install some softwares onto the running vm.
Use libguestfs on a running VM may cause security problems, it may corrupt your data in the VM. Don't do this! Thanks, Wanlong Gao
Thanks! ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 周涛
Thanks! 周涛 From: Wanlong Gao Date: 2012-09-06 16:03 To: 周涛 CC: rjones; libguestfs Subject: Re: [Libguestfs] modify running VM's image On 09/06/2012 03:58 PM, 周涛 wrote:
hi jones!
is there any way to modify running VM's image using libguestfs? i want to install some softwares onto the running vm.
Use libguestfs on a running VM may cause security problems, it may corrupt your data in the VM. Don't do this! Thanks, Wanlong Gao
Thanks! ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 周涛
--------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Thu, Sep 06, 2012 at 04:07:23PM +0800, 周涛 wrote:
Thanks!
Wanlong Gao is correct that using libguestfs on a running VM will (not maybe, *will*) cause disk corruption. However you might want to look at libguestfs-live, which involves installing a daemon in the VM that libguestfs talks to: https://rwmj.wordpress.com/2011/07/06/libguestfs-live/ https://rwmj.wordpress.com/tag/libguestfs-live/ (Currently this only works for Linux VMs) Also, if the VM is switched off, you can install a firstboot script (as previously discussed). This script runs when the guest boots, and can install software etc. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
However you might want to look at libguestfs-live, which involves installing a daemon in the VM that libguestfs talks to: https://rwmj.wordpress.com/2011/07/06/libguestfs-live/ https://rwmj.wordpress.com/tag/libguestfs-live/ (Currently this only works for Linux VMs)
Also, if the VM is switched off, you can install a firstboot script (as previously discussed). This script runs when the guest boots, and can install software etc.
thanks! i will study libguestfs-live. as you said, currently these methods only work for Linux VMs, and what about the future? will windows VM be supported? 周涛 From: Richard W.M. Jones Date: 2012-09-06 18:25 To: 周涛 CC: gaowanlong@cn.fujitsu.com; libguestfs Subject: Re: Re: [Libguestfs] modify running VM's image On Thu, Sep 06, 2012 at 04:07:23PM +0800, 周涛 wrote:
Thanks!
Wanlong Gao is correct that using libguestfs on a running VM will (not maybe, *will*) cause disk corruption. However you might want to look at libguestfs-live, which involves installing a daemon in the VM that libguestfs talks to: https://rwmj.wordpress.com/2011/07/06/libguestfs-live/ https://rwmj.wordpress.com/tag/libguestfs-live/ (Currently this only works for Linux VMs) Also, if the VM is switched off, you can install a firstboot script (as previously discussed). This script runs when the guest boots, and can install software etc. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------
On Fri, Sep 07, 2012 at 10:09:37AM +0800, 周涛 wrote:
However you might want to look at libguestfs-live, which involves installing a daemon in the VM that libguestfs talks to: https://rwmj.wordpress.com/2011/07/06/libguestfs-live/ https://rwmj.wordpress.com/tag/libguestfs-live/ (Currently this only works for Linux VMs)
Also, if the VM is switched off, you can install a firstboot script (as previously discussed). This script runs when the guest boots, and can install software etc.
thanks! i will study libguestfs-live. as you said, currently these methods only work for Linux VMs, and what about the future? will windows VM be supported?
When someone does the work ... It used to work at one point in the (long ago) past, but because no one cared about it, it bit-rotted. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Fri, Aug 31, 2012 at 01:28:49PM +0800, 周涛 wrote:
hi Jones!
i configured this virsion with the following command : ./configure --disable-ocaml --disable-perl --disable-ruby --disable-haskell --disable-php --with-java-home=no but make command leads to : make[5]: Entering directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' make[5]: `stamp-generator' is up to date. make[5]: Leaving directory `/home/zhoutao/upload/libguestfs-1.19.35/generator' GISCAN Guestfs-1.0.gir /usr/local/lib/libguestfs.so.0: undefined reference to `guestfs___read_db_dump'
This is a bug. I have pushed a fix upstream: https://github.com/libguestfs/libguestfs/commit/4e6bf1ed653540a8954a6a11fe5a... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (6)
-
Daniel P. Berrange -
Richard W.M. Jones -
tao.zhou@neusoft.com -
Wanlong Gao -
Whit Blauvelt -
周涛