[Libguestfs] Need Help

Richard W.M. Jones rjones at redhat.com
Mon May 25 19:02:49 UTC 2015


On Mon, May 25, 2015 at 08:03:58AM +0000, Rakesh Agrawal wrote:
> Hi All,
> 
> Can we use libguestfs to somehow uninstall softwares from VMware images?
> The VMware image is of windows 2012 server.

"Probably" is the best answer I can give you.

To access VMware, first read this:

  https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/

The easiest approach would be to use

  virt-customize -a /vmfs/guest-flat.vmdk --firstboot firstboot.bat

where firstboot.bat would be some batch file that uninstalls the
software.

You might consider this to be cheating since it doesn't really
uninstall the software, just schedules it to be uninstalled when the
VM is booted.  In which case, read on.

If you know precisely what software you want to uninstall, you could
instead work out all the changes that have to be made to the
filesystem and Windows Registry.  virt-diff + virt-win-reg will help
greatly here.  Then you can replay these changes on guests using some
custom libguestfs code.

Perhaps reading the code we use to install stuff in Windows during
virt-v2v conversions will either inspire you or frighten you away from
this approach :-)

https://github.com/libguestfs/libguestfs/blob/master/v2v/convert_windows.ml

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list