[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.