VServer Development Scripts Charles Shapiro 5 Oct 2003 What Is This Stuff? This is a small collection of scripts to make developing on a linux virtual server platform easier. It is designed to allow multiple developers who each need multiple independent machines to work on the same physical box without interfering with each other. I assume that the machine you're using is running VServer kernel ctx-13 or better, and has the vserver-admin 0.20 or better rpm (or its equivalent) installed. For information on installing and running VServer, see the VServer web pages. These scripts are written on the assumption that your development vservers are isolated to their own class C IP network; as shipped this is "10.0.25.*". Setup Create an account on your VServer server and untar the distribution tar file into its root (e.g. "/home/vsmaker"). Move the "dotbash_profile" and "dotenvfile" files to the appropriate names, as: cd /home/vsmaker mv dotbash_profile .bash_profile mv dotenvfile .envfile You may wish to edit the .bash_profile file to conform to local custom (if, for example, you automatically log in to a cvs system). Edit the /etc/sudoers file on the vserver server and add the appropriate privilages for your vsmaker user. I have included an example sudoers file in the distribution as "sudoers.example". Now create a "vsroot" vserver with the vserver script, as: vserver vsroot build This is the root vserver from which vsmaker/bin/mkVS.sh will build all new vservers. You can prune as much from /vservers/vsroot as necessary to cut down on the amount of disk space each new vserver will consume. The vbuild.params directory is where the "bin/mkVS.sh" script keeps its current ip and MAC addresses. Each time you run mkVS.sh, it will increment those numbers. addresses. The "current.ip.num" file contains the current IP address, and the "current.mac.num" file contains the current MAC number. The scripts will edit the new /etc/vservername.conf file to bind the new vserver to the correct IP address, but they'll only put the new MAC address in its /tmp/ directory as "/tmp/fakeMACAddress.txt". It's your application's responsibility to spoof it from there as necessary. The "help.sh" script documents the scripts shipped. To Do * Make the MAC address and IP address generation track which addresses are being used instead of blindly incrementing each time a server is created * Figure out ways to use other vserver features, such as vunify. * Add More Cool Scripts Happy Hacking!