wiki:DC3DevelopmentVirtualMachines
Last modified 5 years ago Last modified on 03/05/2012 04:48:37 PM

NOTE: THIS PAGE IS OUT OF DATE; THE VMs ARE NOT MAINTAINED ANY MORE.



DC3 Development with Virtual Machines

Virtual machines, using VMware tools and running CentOS Linux, are a supported platform in DC3. To get started, follow these steps:

Getting started with VMware

  1. Install VMware software
  1. Download a virtual machine image -- that is, a snapshot of a virtual machine:
  1. Unpack the image locally and open it in your virtualization software.
  • VMware may alert you that "The location of this virtual machine's configuration file has changed since it was last powered on." and ask whether you want to change or keep its UUID.

Screen shot of VMware asking whether to create a new UUIDChange UUID dialog from Mac (VMware Fusion)

  • The UUID will determine the new virtual machine's MAC address. Click Moved or Keep to keep the MAC address unchanged -- the network drivers in CentOS 4 can get confused if it changes. Note that if you intend to run the VM in Bridged mode, however, you may need to change it so that it can coexist on the network with other copies of itself.
  1. On first boot, you may encounter Kudzu, the Red Hat hardware management tool. In particular, Kudzu may detect a change in the VM's ethernet card. Don't worry; it's just adjusting to its new physical host. Go along with Kudzu's default actions, which will usually be:
  1. remove the old card
  2. add the new card (which may be indistinguishable from the old card)
  3. if it's an ethernet card, configure TCP/IP; to use DHCP, be sure to press space to select "Use dynamic IP configuration (BOOTP/DHCP)"

Kudzu - welcome to KudzuKudzu - hardware has been removedKudzu - new hardware detectedKudzu - configure TCP/IP

  1. On first boot, the virtual machine will ask you to:
  1. establish a root password
  2. create a user account, which will be added to the lsst group in order to access the LSST tools installed in /lsst
  1. Log in and adjust your environment as you wish.
  1. Once logged in you should get any updates to the LSST software stack. To do this:
    1. Open a terminal window (Applications->Accessories->Terminal)
    2. Install updates by typing "lsstpkg install LSSTPipe".

If you get lsstpkg: command not found, load the LSST environment by typing "source /lsst/stacks/default/loadLSST.sh" (tcsh/csh users source loadLSST.csh). It should be loaded already by default for bash users due to a setting in /etc/profile.d/lsst.sh.

Networking Options

  • The LSST DC3 virtual machine is configured to use VMware's internal NAT, which means it will only be accessible from your VMware host machine.
  • To assign it an externally addressable IP address:
    1. change the virtual machine's settings in your VMware client to "Bridged Networking"
    2. reboot it (or execute service network restart); you may have to manually assign it an address
    3. assign it a DNS entry as if it was just another machine on your network

See FAQ Q.9 below for a note on security implications.

Software Development for DC3

LSST Tools

The virtual machine described above includes all tools, as described here, to do LSST development work:

  • The build system has been in stalled in /lsst/stack
  • /lsst/stack/loadlsst.(sh|csh) has not been executed.

These LSST software development guides describe the next steps to take:

Sharing Files

You can share files between your host computer and the virtual machine in at least two ways: through a network file system, and through VMware's own tools.

  1. Sharing files over a network. The easiest way to access your VM's files from a host machine is probably via SSH, using Fuse or Macfuse. Macfuse, in particular, is easy to install and use.
  1. Sharing files using VMware's tools. Only the paid VMware products support file sharing, though -- notably, Fusion and Workstation.
    1. Make sure that VMware tools are installed (they are pre-installed in the LSST images for Fusion)
    2. In the VM's settings, enable shared folders
    3. Add a shared folder (in Fusion, click the + icon and choose a folder on your host)
    4. Be sure to click the new shared folder's Enabled checkbox
    5. The folder will show up in the VM's file system under /mnt/hgfs.

Frequently Asked Questions

  1. How do I open a terminal in the virtual machine?
Answer
log in, right-click on the desktop, and select "Open Terminal"
  1. How can I ssh to the virtual machine?
Answer
The virtual machine runs under NAT by default, and is only reachable from the host. To determine its IP address, open a terminal in the virtual machine and run ifconfig.
  1. How can I give the virtual machine an externally reachable IP address?
Answer
Change from NAT to Bridged networking in VMware:
  1. In VMware software, change the settings on the virtual machine: change Network to be Bridged instead of NAT.
  2. Either restart the virtual machine or run service network restart in a terminal.
  3. Assign DNS normally.
  4. If you want to assign a static address instead of DHCP, in your virtual machine run system-config-network and change eth0 to use a static address instead of DHCP.
  1. Can I still use my desktop development tools?
Answer
This can be an excellent way to work. You will need to find a way to share files with the virtual machine (see #SharingFiles, above). Also consider running the virtual machine in text mode (see below), to free up CPU cycles on your host.
  1. How can I change the screen size of my virtual machine? 800x600 is too small. Can I make it dynamically adapt to the size of the VMware window?
Answer
Run vmware-config-tools.pl in your virtual machine and choose to change your X resolution. Unfortunately, it can't adapt dynamically, due to limitations of X Windows on the virtual machine.
  1. Can I run the virtual machine in text mode?
Answer
Yes, and you can save significant CPU cycles on your host machine, if you don't need local graphics in the VM. Edit /etc/inittab, changing the line that says id:5:initdefault: to id:3:initdefault:.
  1. A little window is telling me that there are new packages available. Should I do automated updates to the operating system?
Answer
We recommend that you do keep your system up to date by installing updates as advised by the Update Manager icon. This should not affect your LSST software stack; however, if we become aware of issues related to OS updates, we will let you know via this page.
  1. Are there any security issues I should be worried about while using this VM?
Answer
The VM comes using so-called "NAT" networking. This means that you can from inside the VM get out to the outside world (e.g. via a browser, the lsstpkg tool, etc.), but you and others cannot get into the machine from the outside. This is because your machine does not have its own IP address. This makes the VM more secure than a real workstation or laptop. There are still the usual concerns about downloading viruses (to which Linux is historically less prone) and getting caught by phishing scams.

Troubleshooting

My virtual machine doesn't have network access. (You may have seen a message about a mismatched MAC address.)

  1. In your virtual machine, run system-config-network as root.
  2. Delete your existing ethernet device (you may have to Deactivate it first).
  3. Create a New network device (New -> Ethernet Connection -> Forward x3 -> Apply
  4. Activate the new Ethernet device

I switched to Bridged Networking, but something isn't working right.

You may be having a problem with your or switch; some are configured to only allow one computer per port, but with Bridged Networking, your host computer is pretending to be two different devices, each with its own MAC address. You will have to configure your networking equipment to allow multiple MAC addresses per port.

Some VMware services running inside the VM are failing to start up during boot. Is this a problem? How can I fix it?

After a kernel upgrade, usually thanks to yum, the VMware tools installed inside the virtual machine, which allow for file sharing and better performance, need to be updated as well. To update them, as root, run vmware-config-tools.pl.

How these VMs were built

Installed Software

  • gcc 4.3.3 as default compiler (OS-provided gcc removed before LSST stack installed)
  • Current LSST software stack as of release date
    • built with gcc 4.3.3
    • installed under /lsst/stacks/default
    • set to automatically initialize via /etc/profile.d/lsst.sh
    • Packages
      • umbrella package LSSTPipe (includes ctrl_dc3pipe, ap, sdqa, afw, etc.)
      • Sun Java installed as an optional package
      • activemq & jython installed as external packages
      • in future plan to install ctrl_evmon when it is available

Settings

  • VMware virtual machine version 4 (created with VMware Server)
  • 512MB RAM (32-bit), 768MB RAM (64-bit)
  • 40GB hard disk
  • 1 cpu
  • Before release
    • run VMware Shrink Disk to reclaim unused space
    • switch networking to NAT
    • trigger firstboot (via /root/bin/reset-firstboot.sh)

And finally, thanks to Mike Freemon for his VM distribution procedure.

Attachments