Results 1 to 7 of 7

Thread: Changing Live CD hostname

  1. #1
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Beans
    108
    Distro
    Xubuntu 14.04 Trusty Tahr

    Changing Live CD hostname

    Hi guys,

    I have a persistent live Ubuntu environment booting off a USB. I need to change the hostname but the usual method (editing /etc/hostname or something like that) does not work. On reboot, it is still "ubuntu".

    How can I change the hostname of my live USB? I found some instructions in the manual but it was very confusing and seemed to be above what I actually needed to do.
    ThinkPad X201 - i5-520M - 8GB DDR3 RAM - Intel HD Graphics - 1GB GeForce 560 Ti eGPU - Xubuntu 14.04/Windows 8 Pro
    Gaming PC - i5-4670 - 16GB DDR3 RAM - 3GB Radeon R9 280X - Windows 8 Pro

  2. #2
    Join Date
    Sep 2007
    Beans
    45

    Re: Changing Live CD hostname

    Quote Originally Posted by Pas_sa View Post
    editing /etc/hostname
    You can edit the hostname on a full install via System->Administration->Networking or by editing BOTH
    /etc/hostname and /etc/hosts. It should work the same for a live USB, especially one that's persistent.

  3. #3
    Join Date
    Feb 2011
    Beans
    3

    Re: Changing Live CD hostname

    I have the exact same problem!

    Used the easy usb creator on windows from pendrivelinux.com with ubuntu 10.10. Edited /etc/hostname on the machine, rebooted, and now it's back to "unbuntu". Tried multiple times with no success.

    Probably should post this on pendrivelinux forums, but saw this thread and figured I would add in my frustration

  4. #4
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Changing Live CD hostname

    Quote Originally Posted by ezwrighter View Post
    Edited /etc/hostname on the machine, rebooted, and now it's back to "unbuntu".
    Quote Originally Posted by Keiran230 View Post
    You can edit the hostname on a full install via System->Administration->Networking or by editing BOTH
    /etc/hostname and /etc/hosts. It should work the same for a live USB, especially one that's persistent.
    @ezwrighter, I've enlarged the critical word in the quote from Keiran230's post. Did you edit both?
    Ubuntu 18.04 Desktop Guide - Ubuntu 20.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  5. #5
    Join Date
    Mar 2006
    Location
    Cambodia
    Beans
    88
    Distro
    Ubuntu 6.06 Dapper

    Cool PARTIALLY SOLVED Re: Changing Live CD hostname

    I confirm - changing BOTH files by hand, and issuing the command 'sudo hostname <yourdesiredname>' for good measure doesn't stay, keeps coming back as '@ubuntu' on a persistence-enabled pendrive.

    Same applies for the /etc/init/tty[1-6].conf files BTW.

    This is the furthest and closest I've got, from user efflandt

    http://ubuntuforums.org/showpost.php?p=9664198&postcount=8

    For a live/install iso the system boots before persistent data is mounted, so you might need to copy those /etc/hostname and /etc/hosts to the home directory of the default ubuntu user, edit how you want them, then add these lines to .profile of ubuntu user:
    sudo cp /home/ubuntu/hostname /etc/hostname
    sudo cp /home/ubuntu/hosts /etc/hosts
    Makes sense...

    The above solution does set the name - before you actually log in, and even in the .profile file of user 'ubuntu' when you log as another user.

    what does NOT work is to simply add 'hostname <yourname>' in the .profile file. Also, I only did with the /etc/hosname file, not the /etc/hosts file

    I still have that TTY problem, too: the consoles stays ubuntu@ubuntu, no way to change that at startup yet.
    Last edited by Peacepunk; June 3rd, 2011 at 11:39 AM. Reason: adding details
    Hamlet - O, from this time forth, my thoughts be bloody, or be nothing worth !
    Shakespeare "Hamlet" Act IV, Scene 4
    Registered Linux user number 418565

  6. #6
    Join Date
    Jul 2011
    Beans
    7

    Re: Changing Live CD hostname

    I've found the real fix. https://help.ubuntu.com/community/Li...29%20Autologin

    You need to follow the directions for extracting and editing the "casper/initrd.lz" file. Once done, repackage the initrd.lz, and replace the existing initrd.lz with the new modified one. You need to modify the file within the initrd.lz which is "etc/casper.conf". Hope this helps!

  7. #7
    Join Date
    Feb 2006
    Location
    USA
    Beans
    681

    Lightbulb Re: Changing Live CD hostname

    This I suppose this is off topic, however I do understand what remastersys is attempting to do. Every almost single build I have done starting from Edgy Eft on. I have had to re-write all the things they change. I have never personally used remaster's system to build one of my incarnations. I have used reconstructor in the past as a dev.

    Ubuntu has hard coded a ton of info into the O/S. This is slowly diminishing & they finally agree that it is considered a bug. I can do anything I want as far as building an O/S minus upgrading the kernel. I do everything by hand. I have found a few breadcrumbs in my journey to excellence. casper filesystem involved across both initrd.lz, .disk and in /etc/casper.conf in the squashfs is the cause of the situation. Learn, Learn, Learn

    They claim it is now history in percise. I would not know it is too unstable to run currently.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •