WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: (Solved)How do i change the hostname of tiny core?  (Read 11015 times)

Offline Hadlock

  • Newbie
  • *
  • Posts: 8
Re: (Solved)How do i change the hostname of tiny core?
« Reply #15 on: February 11, 2015, 09:23:36 PM »
For a more indirect approach (needed here as I have a few dozen machines and I can't see editing boot codes for each) you have two primary options:

1) If you have the ability to set up DNS for yourself, set the computer's host name in DNS (preferably by MAC)

2) If DNS isn't an option, the following is all that's needed:
  a) in /opt/bootsync.sh replace the line sethostname= with the preferred host name *preferred
  or
  b) add etc/hostname to /opt/.filetool.lst and edit /etc/hostname to suit (and remove the command in bootsync.sh accordingly)

I've tried both of these options on 6.1RC and it keeps forcing me back to tc@box >:( Suggestions welcome.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: (Solved)How do i change the hostname of tiny core?
« Reply #16 on: February 11, 2015, 09:50:24 PM »
Option #1 - though I don't use this to know how stable:
1) Set the boot code host=MyHostName -- I believe this is in TCL6 as well as older models

If you have opt=(persistent) as a boot code (preferred), you can easily do the following:
1) Create a file /opt/hostname (and inside it, enter your hostname on a single line)
2) Edit /opt/bootsync.sh and replace sethostname box to sethostname `cat /opt/hostname`

If you must rely on "backups" you can
1) Create a file /opt/hostname (and inside it, enter your hostname on a single line)
2) Edit /opt/bootsync.sh and replace sethostname box to sethostname `cat /opt/hostname`
3) Edit /opt/.filetool.lst and make sure opt is listed
4) Run filetool.sh -b as non-root
*) As long as the boot code norestore IS NOT being used, this should work flawlessly

A final desperate method would be to edit (and back up) /opt/bootlocal.sh and add the line:
sethostname hostname &
This applies a little AFTER boot, so it may be invisible to you initially.

Which ever direction you take, when it's finished simply type in hostname at the prompt (or from Terminal if using a desktop) to make sure it "took."

Good luck!