RTmxa
Contributor
Contributor

Vmware tools on Linux without X

Hi,

I want to pass attributes to my Linux VM from the vmx file. I read a way this could be achieved is using vmware tools. I have an entry in my vmx file guestinfo.hypervisor.role = "abc"

I was trying to read this from the VM using the vmtoolsd info-get command.

However I keep getting no value found.

I then checked the VM summary on ESXi and saw that esxi reports that vmtools is not running.

My VM does not run X.

Is there a way to pass attributes to a VM given my configuration?

I am running RHEL 6.2 & ESXi 5.0

Thanks

0 Kudos
5 Replies
eeg3
Commander
Commander

Does checking the service's status inside the guest return that tools are running? What is the exact syntax of the command you're using?

Blog: http://blog.eeg3.net
0 Kudos
RTmxa
Contributor
Contributor

So my vmx file has guestinfo.vm.role = "solr"

and the command I execute on the Linux vm is vmtoolsd --cmd "info-get guestinfo.vm.role"

Also in vSphere I see the VMware tools status as Not Running (Current)

0 Kudos
eeg3
Commander
Commander

Using Workstation instead of ESXi 5.0 and CentOS 6 instead of RHEL, I was able to use your method and get the successful result from that specific vmtoolsd command. It also appears to work with and without tools running so that may not be the issue, but hopefully someone else will have more insight into this issue and be able to help further.

Blog: http://blog.eeg3.net
marchlam
Enthusiast
Enthusiast

Please try this KB:

http://www.vmware.com/support/ws5/doc/ws_newguest_tools_linux.html#wp1118025

Installing VMware Tools from the Command Line with the Tar Installer

The first steps are performed on the host, within Workstation menus:

1.     Power on the virtual machine.

2.     After the guest operating system has started, prepare your virtual machine to install VMware Tools.

Choose VM > Install VMware Tools.

The remaining steps take place inside the virtual machine.

3.     As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.

Note: Some Linux distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.

Some Linux distributions use different device names or organize the /dev directory differently. If your CD-ROM drive is not /dev/cdrom or if the mount point for a CD-ROM is not /mnt/cdrom, you must modify the following commands to reflect the conventions used by your distribution.

mount /dev/cdrom /mnt/cdrom

cd /tmp

Note: If you have a previous installation, delete the previous vmware-distrib directory before installing. The default location of this directory is
/tmp/vmware-tools-distrib.

4.     Untar the VMware Tools tar file:

tar zxf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz

umount /dev/cdrom

Where <xxxx> is the build/revision number of the VMware Workstation release.

Note: If you attempt to install a tar installation over an rpm installation — or the reverse — the installer detects the previous installation and must convert the installer database format before continuing.

5.     Run the .tar VMware Tools installer:

cd vmware-tools-distrib

./vmware-install.pl

Respond to the configuration questions on the screen. Press Enter to accept the default value.

6.     Log off of the root account.

exit

7.     Start X and your graphical environment.

8.     In an X terminal, launch the VMware Tools background application.

vmware-toolbox &

Note: You may run VMware Tools as root or as a normal user. To shrink virtual disks, you must run VMware Tools as root (su -).

(You can also see this session in the same KB)

Installing VMware Tools from the Command Line with the RPM Installer

RTmxa
Contributor
Contributor

Guys,

Thanks for the quick responses.

So apparently the problem was that I was setting this variable while the VM was running. I thought that following this up with vim-cmd vmsvc/reload would load the variables and expose them to the vm. But that did not work

I turned the VM off and everything works.

I saw that there is a vmware-cmd option when using vcli to setguestinfo for setting options without requiring the VM to be turned off. Is there a way to do this in ESXi ?

0 Kudos