WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Re: changing hostname in a chroot [was: changing settings]

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Re: changing hostname in a chroot [was: changing settings]
From: Charles Duffy <cduffy@xxxxxxxxxxx>
Date: Thu, 05 Jan 2006 15:06:34 -0600
Delivery-date: Thu, 05 Jan 2006 21:12:59 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <acb757c00601051258o261e5027ge29fea574752fc44@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <acb757c00601051258o261e5027ge29fea574752fc44@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
Anand wrote:
mount -o loop centos.img /mnt/disk

Now i did a chroot to /mnt/disk and executed hostname -v xyz.test.com <http://xyz.test.com> and exited from it.

The hostname changed inside the image, however it also changed for the host machine. I am confused here, after doing a chroot, shouldn't the hostname change only inside the chrooted image ? and not on the host machine ? Any help would be appreciated.

The hostname command doesn't make any changes to the disk; rather, it only tells the running system what its hostname is.

Since you're using the same system (the same kernel) whether or not you're in the chroot, running hostname inside a chroot is going to have the same impact as running hostname outside your chroot.

If you want to actually change the hostname for your CentOS image, find the configuration files in /etc used by CentOS to store the hostname, and change those with the editor of your choice.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>