How can I change the hostname in a chroot environment permanently?











up vote
0
down vote

favorite












I can not change the hostname in the chroot environment (Ubuntu) I tried hostnamectl set-hostname but it says:



Failed to create bus connection: Could not find file or folder



Then I tried changing it with hostname and edited the /etc/hostname file and put my name in it. Thought it worked but when I burned the finished remastered “.iso on a stick” and booted from it, it didn't work.










share|improve this question









New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
    – ctrl-alt-delor
    yesterday










  • Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
    – kcdk
    yesterday












  • Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
    – ctrl-alt-delor
    yesterday










  • I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
    – ctrl-alt-delor
    yesterday










  • I changed it in the chroot environment. But it did not effected the root enviroment of my main system
    – kcdk
    23 hours ago















up vote
0
down vote

favorite












I can not change the hostname in the chroot environment (Ubuntu) I tried hostnamectl set-hostname but it says:



Failed to create bus connection: Could not find file or folder



Then I tried changing it with hostname and edited the /etc/hostname file and put my name in it. Thought it worked but when I burned the finished remastered “.iso on a stick” and booted from it, it didn't work.










share|improve this question









New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
    – ctrl-alt-delor
    yesterday










  • Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
    – kcdk
    yesterday












  • Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
    – ctrl-alt-delor
    yesterday










  • I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
    – ctrl-alt-delor
    yesterday










  • I changed it in the chroot environment. But it did not effected the root enviroment of my main system
    – kcdk
    23 hours ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I can not change the hostname in the chroot environment (Ubuntu) I tried hostnamectl set-hostname but it says:



Failed to create bus connection: Could not find file or folder



Then I tried changing it with hostname and edited the /etc/hostname file and put my name in it. Thought it worked but when I burned the finished remastered “.iso on a stick” and booted from it, it didn't work.










share|improve this question









New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I can not change the hostname in the chroot environment (Ubuntu) I tried hostnamectl set-hostname but it says:



Failed to create bus connection: Could not find file or folder



Then I tried changing it with hostname and edited the /etc/hostname file and put my name in it. Thought it worked but when I burned the finished remastered “.iso on a stick” and booted from it, it didn't work.







chroot hostname






share|improve this question









New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 5 hours ago









ctrl-alt-delor

9,87031954




9,87031954






New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









kcdk

31




31




New contributor




kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






kcdk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
    – ctrl-alt-delor
    yesterday










  • Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
    – kcdk
    yesterday












  • Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
    – ctrl-alt-delor
    yesterday










  • I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
    – ctrl-alt-delor
    yesterday










  • I changed it in the chroot environment. But it did not effected the root enviroment of my main system
    – kcdk
    23 hours ago


















  • It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
    – ctrl-alt-delor
    yesterday










  • Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
    – kcdk
    yesterday












  • Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
    – ctrl-alt-delor
    yesterday










  • I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
    – ctrl-alt-delor
    yesterday










  • I changed it in the chroot environment. But it did not effected the root enviroment of my main system
    – kcdk
    23 hours ago
















It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
– ctrl-alt-delor
yesterday




It is hard to know what you are asking. It seems that you are using chroot, to create a file-system for copying to an ISO. It also seems that you have changes the file /etc/hostname, but this change was lost. (this is the right thing to do, hostnamectl will not be the right thing: you don't want to change the hostname of the machine that you are working on.
– ctrl-alt-delor
yesterday












Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
– kcdk
yesterday






Hmm.. what am I doing wrong than or is it not even possible to change the hostname and have it final on the remastered iso? I used this instruction gtkdb.de/index_34_1259.html
– kcdk
yesterday














Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
– ctrl-alt-delor
yesterday




Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.
– ctrl-alt-delor
yesterday












I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
– ctrl-alt-delor
yesterday




I am wondering did you change the host-name of the installer or of the installed. Did the file change in ether of these?
– ctrl-alt-delor
yesterday












I changed it in the chroot environment. But it did not effected the root enviroment of my main system
– kcdk
23 hours ago




I changed it in the chroot environment. But it did not effected the root enviroment of my main system
– kcdk
23 hours ago










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.






share|improve this answer





















  • What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
    – kcdk
    yesterday






  • 1




    Both of them are directories: You need an editor, not cd.
    – ctrl-alt-delor
    yesterday










  • Yes I edited them with nano and saved them. With cd I just went into the folders
    – kcdk
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






kcdk is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481912%2fhow-can-i-change-the-hostname-in-a-chroot-environment-permanently%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.






share|improve this answer





















  • What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
    – kcdk
    yesterday






  • 1




    Both of them are directories: You need an editor, not cd.
    – ctrl-alt-delor
    yesterday










  • Yes I edited them with nano and saved them. With cd I just went into the folders
    – kcdk
    yesterday















up vote
0
down vote













Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.






share|improve this answer





















  • What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
    – kcdk
    yesterday






  • 1




    Both of them are directories: You need an editor, not cd.
    – ctrl-alt-delor
    yesterday










  • Yes I edited them with nano and saved them. With cd I just went into the folders
    – kcdk
    yesterday













up vote
0
down vote










up vote
0
down vote









Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.






share|improve this answer












Editing one file is like editing another. So if the change did not stick, then ether you made a mistake, or have a file editing problem.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









ctrl-alt-delor

9,87031954




9,87031954












  • What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
    – kcdk
    yesterday






  • 1




    Both of them are directories: You need an editor, not cd.
    – ctrl-alt-delor
    yesterday










  • Yes I edited them with nano and saved them. With cd I just went into the folders
    – kcdk
    yesterday


















  • What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
    – kcdk
    yesterday






  • 1




    Both of them are directories: You need an editor, not cd.
    – ctrl-alt-delor
    yesterday










  • Yes I edited them with nano and saved them. With cd I just went into the folders
    – kcdk
    yesterday
















What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
– kcdk
yesterday




What I exactly did in the chroot environment is: cd /etc/hosts -> filled in my name and saved cd /etc/hostname -> filled in my name saved When I do hostname it actually shows what I want. Seems right or not?
– kcdk
yesterday




1




1




Both of them are directories: You need an editor, not cd.
– ctrl-alt-delor
yesterday




Both of them are directories: You need an editor, not cd.
– ctrl-alt-delor
yesterday












Yes I edited them with nano and saved them. With cd I just went into the folders
– kcdk
yesterday




Yes I edited them with nano and saved them. With cd I just went into the folders
– kcdk
yesterday










kcdk is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















kcdk is a new contributor. Be nice, and check out our Code of Conduct.













kcdk is a new contributor. Be nice, and check out our Code of Conduct.












kcdk is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481912%2fhow-can-i-change-the-hostname-in-a-chroot-environment-permanently%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt