Tag Archives: environment variable

Set Environment Variables in Guest Operating System on VMware

While reading my last post on reading environment variables from a guest operating system, you may wonder how to set environment variables. Don’t be disappointed if I tell you that there is NO direct support for setting an environment variable.

However, you have a workaround – use a command directly. Unlike reading variables, there is no standard ways to do it for different operating systems. You have to first figure out what type of operating system and then run different commands. For example, if you are targeting Windows family of operating systems, you simply run the following:

Posted in Software Development, vSphere API | Also tagged , , , | Leave a comment

Read Environment Variables in Guest Operating System on VMware

My last post explained how to run, kill, and list programs in guest operating system on VMware. In that post, I mentioned that you can actually use the same API, GuestProgramDirector in particular, to read environment variables. I think the explanation is detailed enough for an implementation.

Still, a good sample provides more details. That is why I decided to write a quick sample just to show how to read environment variables. While trying the sample by myself, I did find more that I will discuss after the sample code.

Posted in Software Development, vSphere API | Also tagged , , , | 14 Responses

    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.