hypriot / image-builder-odroid-c1

Build SD card image for ODROID C1 and C1+
http://blog.hypriot.com/post/how-to-get-docker-working-on-your-favourite-arm-board-with-hypriotos/
MIT License
15 stars 6 forks source link

How to change host name in HypriotOS for Odroid C1 #36

Closed al-sabr closed 7 years ago

al-sabr commented 7 years ago

Good day everyone,

I would like to change the hostname of my boards and unfortunately it doesn't work, I tried this tutorial and no success... am I missing something with hostname renaming?

https://www.howtogeek.com/50631/how-to-change-your-linux-hostname-without-rebooting/

docbobo commented 7 years ago

HypriotOS uses device-init for those things:

HypriotOS/arm64: pirate@black-pearl in ~
$ device-init
device-init allows you to configure various aspect of your devices.
This ranges from configuration as simple as setting a hostname to
more complex stuff as configuring WiFi access.

Usage:
  device-init [flags]
  device-init [command]

Available Commands:
  cluster-lab manage cluster-lab settings
  docker      This command allows to do Docker related stuff
  hostname    Set or show hostname
  wifi        set or show WiFi settings

Flags:
  -c, --config string[="/boot/device-init.yaml"]   config file (default is /boot/device-init.yaml)
  -h, --help                                       help for device-init

Use "device-init [command] --help" for more information about a command.
al-sabr commented 7 years ago

Ok I did this :

sudo device-init hostname set "bambuserver.1"

It does the job but it is not permanent

When I restarted the device and the computer name is still black-pearl

docbobo commented 7 years ago

In that case, you should just manually edit /boot/device-init.yml

al-sabr commented 7 years ago

Correct it seems to override everything from the beginning.

Now that I have commented the hostname line it is all working.

Thank you!

georgkreimer commented 5 years ago

FYI seems like it's "/boot/user-data" nowadays

alexgorbatchev commented 4 years ago

FYI seems lit it's cloud-init nowadays (not device-init)

alexgorbatchev commented 4 years ago

I finally found how to change host name on a running instance. These instructions worked for me: https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/

pve commented 4 years ago

Raspi-config worked for me. Also on hypriot.

mkmojo commented 4 years ago

I finally found how to change host name on a running instance. These instructions worked for me: https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/

Confirmed that this works for me as well. I have a cluster of pi 4, running HypriotOS.