How to Change the hostname of your google computer engine

When running an instance of Google compute engine, you’ll soon discover how almost impossible it is to change the hostname, simply adding a hostname to /etc/hostname  just doesn’t work. For you guys who have been pulling your hairs out, here is a simply work-around:


1. edit rc.local

vi /etc/rc.d/rc.local

2. add your hostname to the rc.local file


3. Modify the permission on the rc.local file (This is very important, your changes may not work if you skip this step)

chmod +x /etc/rc.d/rc.local


About Matthias 33 Articles
I am a Software Engineer from Houston, TX who love to write codes that brings great ideas to live. In my professional life, I have created software for different industries including Oil & Gas, Finance, Service Provider, Cloud Computing and Embedded Systems. When not writting codes, i enjoy travelling, good music and photography. You can reach me at

Be the first to comment

Leave a Reply

Your email address will not be published.