Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What exactly is the hostid? Is it equivalent to the Hwaddr / MAC address or is it a unique identifier that is derived from the Hwaddr addresses?

I am trying to activate the Maple mathematical software but it gives me an error stating that the software was unable to determine the hostid. I have followed all the instructions listed in the following help page from Maplesoft but with no luck so far.

http://www.maplesoft.com/support/faqs/detail.aspx?sid=32610

When I enter hostid into Teminal it outputs “007f0101” which is probably incorrect. I read that a hostid is supposed to produce a unique identifier for each unix like machine but I have tried hostid on two different Ubuntu 12.04 installations and they both return the same “007f0101” sequence. Something is amiss I would reckon unless I have misunderstood what a hostid is.

Oh, this Ubuntu installation was done with the WUBI installer so it is technically on a virtual disc which resides in the Windows partition from what I gather. I have a feeling that may be a problem but that doesn' change the fact that the hostid was the same on two different computers, one of which was a standard installation.

Does anyone have any idea what the issue might be with regards to the hostid?

Thanks!

share|improve this question

2 Answers 2

I have three physical machines all three 12.04 (2 desktop, 1 server), all three AMD64, all three with the same hostid "007f0101".

It seems in the glibc implementation of gethostid (see man gethostid), the hostid is stored in the file /etc/hostid, which is by default absent in 12.04. If this file is non-existent, it then uses the localhost ipv4 address to generate the hostid. If you use DHCP, in the hosts file, localhost is mapped to 127.0.0.1 on all machines, resulting in non-unique hostid's.

You could create the /etc/hostid file with random content to get a unique hostid.

share|improve this answer

hostid is your IP address in hex, byteswapped.

For example:

01234567 -> 23.01.67.45

Or in your case:

007f0101 -> 7f.00.01.01  = 127.0.1.1

Which is found in /etc/hosts. That's normal if your machine was installed using a DHCP assigned address.

A quick hack is to vi /etc/hosts and put in your IP address instead of 127.0.1.1. But that is a hack... if your IP address changes at the next boot, your hostid will no longer match your IP.

The bottom line is that hostid sucks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.