VMware {code} Community
OnurSimsek
Contributor
Contributor
Jump to solution

How to programmatically exchange data (key-value pairs) with guest OS?

Hi all,

Is there a programmatical way to exchange data (key-value pairs) with the guest OS?

We have an application running inside guest, and we want this application to use this mechanism to exchange data. At this point, the guest might not have network connectivity. One thing that might work for us is to use registry of guest OS. But I am not sure how to manipulate guest Os registry.

We looked into VirtualMachineConfigInfo.extraConfig property, but those key-value pairs are not accessible from the guest (at least that's what i know)

any ideas?

Thanks

Onur

Reply
0 Kudos
1 Solution

Accepted Solutions
Steve_Jin
Expert
Expert
Jump to solution

I think it's better to use a file or environment variable to exchange data with the guest OS. 

http://www.doublecloud.org/2012/03/set-environment-variables-in-guest-operating-system-on-vmware/

http://www.doublecloud.org/2012/03/read-environment-variables-in-guest-operating-system-on-vmware/

If you really want to set registry,

http://www.doublecloud.org/2012/02/run-program-in-guest-operating-system-on-vmware/

http://en.wikipedia.org/wiki/Windows_Registry#Command_line_editing

Good luck!

Steve, Author of Open Source VI Java API, VMware VI and vSphere SDK

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org

View solution in original post

Reply
0 Kudos
2 Replies
stumpr
Virtuoso
Virtuoso
Jump to solution

You should be able to use vmtoolsd.exe --cmd="info-set guestinfo.<key>=<value>" and vmtoolsd.exe --cmd="info-get guestinfo.<key>" to work with the extraConfig values inside the GuestOS.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Steve_Jin
Expert
Expert
Jump to solution

I think it's better to use a file or environment variable to exchange data with the guest OS. 

http://www.doublecloud.org/2012/03/set-environment-variables-in-guest-operating-system-on-vmware/

http://www.doublecloud.org/2012/03/read-environment-variables-in-guest-operating-system-on-vmware/

If you really want to set registry,

http://www.doublecloud.org/2012/02/run-program-in-guest-operating-system-on-vmware/

http://en.wikipedia.org/wiki/Windows_Registry#Command_line_editing

Good luck!

Steve, Author of Open Source VI Java API, VMware VI and vSphere SDK

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos