Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:25:15+00:00 2026-06-13T17:25:15+00:00

I want to set the VM’s hostname (it is a debian squeeze system with

  • 0

I want to set the VM’s hostname (it is a debian squeeze system with open-vm-tools installed) automatically to the VM’s name which I set and see in the vSphere Client..

I tried

    ~# vmtoolsd --cmd "info-get guestinfo.name" 2> /etc/hostname

but the command returns “No value found”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:25:16+00:00Added an answer on June 13, 2026 at 5:25 pm

    Found this on another site. Seems that you have to set the values before you can query them.

    There may be situations where you want to determine the vCenter display name for a VM from within the OS of the VM.

    This could be useful if cloning multiple virtual desktops from a syspreped template to enable the option to set the machine name to be the same as the vCenter display name. It could also be useful in many other scenarios.

    However, by default there is no way to do this using the standard VM tools that are installed into the virtual machine.

    It is possible though to set a custom attribute on the VM object in vCenter and then query this from within the the OS of the virtual machine.

    The following script can be run using the vSphere PowerCLI to set a custom attribute to be the same as the vCenter display name:

    $vServer= “vCenter.server.fqdn”
    $vmName = “VM display name”
    
    If (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
    Add-PSSnapin VMware.VimAutomation.Core
    }
    
    Connect-VIServer $vServer | out-null
    
    $vmSet = GET-VM $vmName | Get-View
    $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $gInfo = New-Object VMware.Vim.optionvalue
    $ginfo.Key=”guestinfo.hostname”
    $gInfo.Value=$vmSet.Name
    $vmConfigSpec.extraconfig += $gInfo
    $vmSet.ReconfigVM($vmConfigSpec)
    
    Disconnect-VIServer $vServer -Confirm:$false | out-null
    

    Once this is set, it is possible to query it within the VM, using the VM tools and the following command:

    vmtoolsd.exe –cmd “info-get guestinfo.hostname”
    

    This can of course, be added to scripts to set this attribute against multiple machines.

    Credit goes to Richard Parmiter!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am creating an application in which i want set different background images in
in my ListBox ItemTemplate i want set TextBlock UnderLine. as fllow: <StackPanel x:Name=TaskContent_SP Orientation=Horizontal
I want set interfaceOrientation in one UIView as LandscapeLeft and Portrait in other UIView.
i want set the visibility to itemized overlay in map view. if the zoom
I want set Listbox background to transparent but not working Is there any idea?
i want set class for repeater when doPostBack for those dataID i wan but
My question is : I have an EditText and I want set a margin
i have a problem, i want set text of a UILabel or UItextView or
i have a multiple marker Google map, it works fine but i want set
I want to set a repeating alarm monthly; but my app resets the alarm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.