Bizarre hostname question

Issues related to configuring your network
Post Reply
tessmonsta
Posts: 2
Joined: 2007/07/27 13:54:43
Contact:

Bizarre hostname question

Post by tessmonsta » 2007/07/27 14:03:37

Greetings all.

I have CentOS 4.2 installed in a VMWare image. I intend to use it for software training purposes, but I've always had one problem. Since all my students are using a copy of the same image, thus the same hostname, they can't really see each other on the network.

What I would like to do is to create a shell script that would randomly reset the hostname the first time the image is booted. I've thought about incorporating the MAC address from ifconfig, but I'm not quite sure how to do that from within a shell script (a perl script, maybe).

The biggest problem I have with this idea is just where in the init scripts should I stuff this? My guess is that it should be something like /etc/rc0.d/K89RandomHostname, so it would run just prior to the network. I could have my students manually set it, it's just a hassle I'd rather be without.

Any suggestions?

huw-l
Posts: 7
Joined: 2006/09/09 07:01:24
Contact:

Re: Bizarre hostname question

Post by huw-l » 2007/08/02 20:12:41

The way we handle this issue is to assign each VM a static MAC address in it's VMX file and then when they boot they query DHCP to get their hostnames. The disk image for all the Virtual machines is a copy of the original Centos4.5 image that I installed manually.

User avatar
toracat
Forum Moderator
Posts: 7445
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Bizarre hostname question

Post by toracat » 2007/08/10 16:44:18

This page might be helpful for assigning a Mac address in vmware:

http://virtrix.blogspot.com/2007/04/vmware-configuring-static-mac-address.html

Post Reply

Return to “CentOS 4 - Networking Support”