How to build a WormBase Virtual Machine

From WormBaseWiki
Revision as of 16:28, 24 September 2007 by Tharris (talk | contribs) (New page: === Establishing the Virtual Machine === === Installing the OS === === Preparing the system for a WormBase installation === === Installing the WormBase core files === === Preparing a V...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Establishing the Virtual Machine

Installing the OS

Preparing the system for a WormBase installation

Installing the WormBase core files

Preparing a VMX for release

1. Start the guest OS.

2. In the guest, purge things like access logs, tarballs, etc

3. Shrink the disk in the disk by first zeroing empty space

 sudo dd if=/dev/zero of=/empty_file
 rm /empty_file

4. Set the VMX to graphical runlevel 5 (/etc/inittab)

5. Shutdown the guest

6. Copy the current wormbase-live to a directory named by release:

cp -r wormbase-live wormbase-WSXXX.YYYY.MM.DD

7. In the console, set the version and release date

      WormBase (WSXXX; DD Feb YYYY)

8. Defragment the disk from the VMWare console:

   Edit options > Hard Disk > Defrag the disk

9. In the VMWare console, set networking to NAT (assume desktop usage) and restart the guest.

10. Start the new VMX.

11. Reset the MAC address

12. Finish shrinking the disk using the vmware-toolbox:

 $ vmware-toolbox (select shrink)

13. When complete, shut down the VMX

14. Package

tar czf wormbase-WSXXX.YYYY.MM.DD.tgz

15. Symlink to make it available via http

cd /usr/local/wormbase/html/vmx ln -s /usr/local/vmx/wormbase-WSXXX.YYYY.MM.DD.tgz wormbase-WSXXXX.YYYY.MM.DD.tgz

16. Upload the new VM to BitTorrent

17. Update the [[Virtual_Machines Virtual Machines] page on the Wiki

Configuring VMXs as hosted frozen releases

To use a Virtual Machine as a server, a few small modifications need to be made.

1. From the VMWare Server console, launch the virtual machine

2. Set a static IP (must be assigned!)

In this example, the guest OS IP is 143.48.220.208. This should be changed to whatever your assigned IP address is.

ifconfig eth0:0 143.48.220.208 netmask 255.255.255.0 broadcast 143.48.220.255 route add -host 143.48.220.208 dev eth0

You can also do this from the GUI if you prefer, under System Settings -> Network. Double click on the network adaptor.

Address:  Your assigned IP address
Subnet mask: 255.255.255.0
Default gateway: 143.48.220.254
Broadcast host:  143.48.220.255 (not explicitly set in the GUI)

3. Reset the MAC ID of the guest

System Tools > Network

Double click on the network adaptor and select the "Hardware" tab. Click on "Probe", then "OK"

4. Add the following lines to /etc/resolve.conf for DNS

search cshl.edu
nameserver 143.48.1.1
nameserver 143.48.1.20

5. Set the hostname

This can be done either in the GUI under the Network panel, or using the following command line terms.

If you have a static IP address, then /etc/hosts is configured as follows:

127.0.0.1	           localhost.localdomain      localhost
143.488.220.44 mybox.mydomain.com	mybox

After updating the /etc/hosts file correctly, the "hostname" command should be run as follows to set your hostname:

hostname mybox.mydomain.com

6. Edit /usr/local/wormbase/conf/localdefs.pm and httpd.conf with the appropriate hostname

7. Place the VM into console mode:

sudo emacs /etc/inittab

Make sure that the following lines are commented as indicated:

#id:5:initdefault:
 id:3:initdefault:
 

Or via the command line:

$ sudo perl -p -i -e 's/id:5:initdefault:/#id:5:initdefault:/' /etc/inittab
$ sudo perl -p -i -e 's/#id:3:initdefault:/id:5:initdefault:/' /etc/inittab

8. Shutdown the virtual machine and copy it as a backup

I append "server" to the name to indicate that it is configured as a server

  tar czf wormbase-WS100.2003.05.13-server.tgz wormbase-WS100.2003.05.13