Page 1 of 1

How to find VM name from CentOS 6.5 guest?

Posted: 26. Jan 2014, 11:10
by softlexicon
Hi there,

Sorry, if this is a repeated question. I tried searching about this topic but couldn't find anything solid yet. I want to get the VM name from CentOS 6.5 guest. Please let me know if this is even possible.

Thanks.

Re: How to find VM name from CentOS 6.5 guest?

Posted: 26. Jan 2014, 14:18
by mpack
The names of all registered VMs is listed in the GUI.

Re: How to find VM name from CentOS 6.5 guest?

Posted: 26. Jan 2014, 14:33
by softlexicon
Hi mpack,

Thank you for your response.

I know we can find the VM names from the GUI but I actually like to script the host name configuration on newly cloned VM. I have setup a template image with Guest Additions and other required packages for my environment. So now whenever I get a request to spin up a VM then I just clone the template. I have created a script (attached here) to configure the host name manually but if I can get the VM name from CentOS guest (maybe using VBoxControl or something) then I should be able to automate that too.

Thanks.
updateHostname.txt
Bash Script to Update Host Name in CentOS
(943 Bytes) Downloaded 289 times