# All VMs have the same hostname ubuntu

**URL:** <https://forum.opennebula.io/t/all-vms-have-the-same-hostname-ubuntu/1281>\
**Category:** Product Support\
**Created:** [October 2, 2015, 12:49pm UTC](https://forum.opennebula.io/t/all-vms-have-the-same-hostname-ubuntu/1281 "2015-10-02T12:49:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmathew](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@pmathew](https://forum.opennebula.io/u/pmathew)\
**Post date:** [October 2, 2015, 12:49pm UTC](https://forum.opennebula.io/t/all-vms-have-the-same-hostname-ubuntu/1281/1 "2015-10-02T12:49:31Z")

</div>

Hi,

I am using the ubuntu 14.04 image in the OpenNebula Marketplace for my vms. However I have observed that all the vms created with this image has the same hostname ubuntu. Is this the expected behavior or is there is a bug in the image?

Thanks & Regards  
Paul

---

<div class="post-metadata">

**Author:** ![DaD](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dad/32/8466_2.png) [@DaD](https://forum.opennebula.io/u/DaD)\
**Post date:** [October 2, 2015, 1:12pm UTC](https://forum.opennebula.io/t/all-vms-have-the-same-hostname-ubuntu/1281/2 "2015-10-02T13:12:05Z")

</div>

pmathew [forum@opennebula.org](mailto:forum@opennebula.org) writes:

> Hi,

Hello,

> I am using the ubuntu 14.04 image in the OpenNebula Marketplace for my  
> vms. However I have observed that all the vms created with this image  
> has the same hostname ubuntu. Is this the expected behavior or is  
> there is a bug in the image?

You should use context[1] to configure per VM hostname[2].

You can use a static value for SET\_HOSTNAME or the name of the VM.

You may want to ask for user input[3].

Regards.

Footnotes:  
[1] [Contextualization Overview — OpenNebula 4.14.2 documentation](http://docs.opennebula.org/4.14/user/virtual_machine_setup/context_overview.html)

[2] [https://github.com/OpenNebula/addon-context-linux/blob/master/base\_deb/etc/one-context.d/05-hostname](https://github.com/OpenNebula/addon-context-linux/blob/master/base_deb/etc/one-context.d/05-hostname)

[3] [Virtual Machine Definition File — OpenNebula 4.14.2 documentation](http://docs.opennebula.org/4.14/user/references/template.html#user-inputs)  
[signature.asc](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/a/aab5754e46437e3695bd24a7695612e1e101da55.asc) (342 Bytes)
