Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Currently my dhcp-log displays my Pi with the name xbmc-e0cb. Can I change this to a more sensible name?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

You can find the file in

/etc/hostname

Change the name, and it will change on nerwork-restart (or full reboot ofcourse).

share|improve this answer
1  
Thanks. I found out that my dhcp would need to be reconfigured if I wanted the Pi also be getting this as a name in my net. –  towi Dec 10 '12 at 10:58
    
When I changed the file's contents, and attempted to overwrite the file, I was told that the Pi Can't open file to write. How can I fix this? –  xxmbabanexx Mar 25 '13 at 18:22
    
Did you edit it as root or as normal user? Try putting sudo in front of your edit-command. –  René Wolferink Mar 26 '13 at 8:53
    
I did that, and now every time I use sudo it says sudo: unable to resolve host and the new name, before it runs the command. –  Patrick yesterday
    
Ah, found it. Needed to update /etc/hosts as well. –  Patrick yesterday
add comment

do this
http://forum.stmlabs.com/showthread.php?tid=7180

sudo nano /opt/xbmc-bcm/xbmc-bin/share/xbmc/addons/script.raspbmc.settings/resources/lib/nm_util.py
share|improve this answer
add comment

Additionally you can change the hostname on the fly by issuing the commang sysctl kernel.hostname=NEW_HOSTNAME. But that is no permanent solution. @René Wolferink already posted the only permanent way.

hth

share|improve this answer
    
Nonetheless, thank you for completing the picture and not requiring a reboot. Useful tip way beyond just raspbmc. –  Fergal Moran Sep 21 '13 at 22:48
add comment

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.