Configuring a CCM Laboratory Machine

This document is a step by step set of instructions for setting up a new Ubuntu machine in the lab. If simply doing an upgrade (and not an install) from a previous version, the necessary configurations should not change, and you will probably not need to perform any extra steps.

(These directions may not apply nor work to all distros of Linux, though they probably provide a good place to start with distros other than Ubuntu)

1. Opening Notes

These instructions have been tested on several machines of different age, and have worked in all cases thus far. However, there is the possibility that these instructions will not work in every case, and any problems (and their solutions) should be appended as they are found.

These instructions bring together and update many of the previous installation posts found in this wiki.

2. Before You Begin

There are several things you should do and know about before performing a fresh install of the operating system.

First and foremost, our lab does not use DHCP, and instead relies on static hostnames and addresses that are checked at the server. To obtain these, contact Dr. Athanas. Generally, if the system is already in our lab, the current settings can be carried over on a re-install, but double check anyway. If the machine is brand new, you will definitely have to make these arrangements.

Secondly, if you are reinstalling the OS on an existing lab machine, it must be approved by one of the lab professors, and all members of the lab should be notified well in advance of the install. This is to allow everyone to back up any data that may have been stored on the local disk(s). In general, there shouldn't be much, as the /home directories are maintained at the server, but make sure to check.

Finally, if you have never installed Linux before, there are a couple things you should know:

  • If the machine is brand new, you may be in for a painful experience, as you may need to seek out drivers and other pieces of the installation on your own. Ubuntu generally does a good job of this, but if a part is brand new, you may be out of luck finding a driver. You may not be able to get everything working in the end (sound, video, and add-on cards are the usual culprits).
  • Stable releases are much preferred over beta versions, as they will require less maintenance, and are in general easier to use on a day-to-day and user-to-user basis.

3. Choose Your Distro

As of February 2009, Ubuntu is the distribution of choice within our lab, and the most common version you'll find on our machines is Ubuntu 8.04 LTS (Hardy Heron). While there are more recent releases, the LTS (long term support) version is generally preferred, as individual updates will be produced for these versions for several years to come, which means that complete OS upgrades will need to happen less often. Ubuntu can be downloaded at www.ubuntu.com and burned to a CD.

As was mentioned above, these instructions have been tested by installing Ubuntu 8.04 LTS on several lab machines. If you would prefer to install another distribution, please consult Dr. Athanas first, as many of our machines are used by several people who may or may not be as familiar with Linux as you are. Once again, there are no guarantees that these instructions will work verbatim for all distributions, so be prepared to ad lib if necessary (documenting what you do for that distro might not be a bad idea, in case someone else wants to repeat the process in the future). Should you be considering a different distribution, you may want to look at www.distrowatch.com for a run-down of the major players before making your choice.

4. Begin the Install

  1. I recommend disconnecting everything but the monitor, keyboard and mouse from the machine. This puts the machine in its simplest configuration for the install, and any extra parts or configurations can be added on later. I'd also make sure the ethernet cord is unplugged.
  2. These days most distributions, Ubuntu included, come as a "Live" CD, from which the computer should boot. To do this, insert the CD and reboot the machine. Depending on the settings of that computer, the machine might automatically boot from the CD drive first (you'll see the drive light flashing a lot), in which case you can skip the next step.
  3. If you find the machine to be booting normally, you will need to restart again, and this time force the machine to boot from the CD. Usually there is a specific key to press (one of the function keys) to choose where to boot from, but if this is not readily apparent, you can change the boot order in the BIOS, which can be reached by pressing F2 when prompted on most computers.
  4. When given a screen of options, choose to install Ubuntu

5. Installation Dialog

  1. On one of the first screens after choosing to install, you will be prompted for the default language. You should choose English here.
  2. The current city should be New York, as it is in the same time zone as us, and has the same rules for daylight savings as we do. Don't worry if the time displayed isn't correct; once connected to the internet, it will correct itself.
  3. For the keyboard layout choose USA for both the country and keyboard layout. If you prefer a different layout for your own personal use, you can change it later in your preferences. However, USA should be chosen here as the default.
  4. On the disk space prompt, if there is only one drive in your system (the most likely configuration), choose Guided - use entire disk. This rewrites the entire disk with the new operating system. If you are looking to dual boot, if there are multiple drives, or anything else that might make that installation special, you're own your own to configure things the way you want them.
  5. The next page prompts you for a name, login, and password. This is entirely for setup of the system, and you can choose anything for now. Later you'll be authenticating to the server, and these will be deleted. I would recommend choosing a different name than you use to log onto the server, as this will make it easy to spot when you cut off the local access.
  6. The same page also prompts for the host name, which was given to you by Dr. Athanas. The server requires it to match exactly, so be sure to get it right.
  7. Finally, the next screen summarizes all of your choices. If you want to read it, that's fine, but if you followed these directions it should do exactly what is needed. Don't be bothered by the two partitions that it will format, even if you said to re-write the whole drive. Ubuntu needs the swap space, and ext3 is its default file system. This is all normal.
  8. When you're ready, click to install. Depending on your machine it may take a little while (it took ~20 minutes on a P4 with an 80GB drive). After it is done, it will restart, and you'll need to remove the CD from the drive. (Don't plug in the ethernet yet)

6. First Items of Business

  1. Log in. You should use the username and password chosen in the installation dialog step. If you type it in correctly, you should be greeted by the standard desktop.
  2. Talk to Dr. Athanas about if he wants you to set up a root password for that machine (for E-textile machines, Dr. Martin). They may want it set up to be a specific password, or may want it set up, but you to not know about it. Either way, the process to set it up is to open a terminal window by going to the top panel and going to Applications > Accessories > Terminal and type the following sequence of commands:
          sudo su
          <enter your password>
    At this point, you should see that the prompt on the left has changed from your username to "root"
          passwd
          <enter root password>
          <enter root password again>
    If you've matched the two passwords, it will say that the password update was successful. You can close the terminal.
  3. On the top panel, launch "Network" from System > Administration > Network. This will allow you to set up the network settings of the machine
  4. Click on Unlock and the machine will prompt for your password. This should un-gray parts of each tab.
  5. On the Connections tab, click on Wired connection and then Properties
  6. Uncheck Enable Roaming Mode and assign the following (fill in your assigned IP address where I've left x's):
    Configuration: Static IP address
    IP address: 10.0.x.x
    Subnet mask: 255.255.0.0
    Gateway address: 10.0.0.1
  7. Click on the DNS tab and add 10.0.0.1 to the DNS Servers and ccm.ece.vt.edu to the Search Domains. Make sure that these are correct, or you will run into problems down the road. You should now be able to close this window.
  8. Plug in the ethernet cord and test it out. I use two tests: ping another machine in the lab (open a terminal and type ping -c 3 10.0.x.x, and use the other machine's IP address), and then either ping or visit a website like Google.
  9. Update the OS by launching the Update Manager from System > Administration > Update Manager, and click on Check. The computer will go out and find any updates for software you have, and will suggest their installation. This will ensure that your system is up to date with all its software. Depending on when you created your Live CD, and when that disk image was updated on the download site, you may have only a few or several hundred updates to install, and this could take a while. Since you have a new system, most of the updates will be for integral components of the OS or its standard applications, so I generally install them all. You can choose to only download a few, but it might be more hassle to go through and pick out which ones you want. Afterward, the machine should prompt you to restart.

7. Configuring the Machine

  1. Log back in after restart (same as last time). We need to download a few packages to make the system work with the server. You can do this any number of ways, but I prefer using the Synaptic Package Manager from System > Administration > Synaptic Package Manager. Specifically you'll want to find these 5 packages:
          autofs
          nis
          minicom
          openssh-client
          openssh-server
          nfs-common
    Some of these may already be installed, but make sure anyway. Any of these may require other packages to work, which you should also download. When you've found them all, click Apply and after a quick prompt to make sure you're downloading what you want, it will download and install all of them.
  2. During install, NIS will put up a prompt to the screen asking for your NIS domain. Type in towerofpower and click to continue.
  3. If you have experience trouble connecting to the NIS server, try uninstalling the network manager sudo apt-get remove network-manager network-manager-gnome to ensure that DHCP does not attempt to assign an IP address. This is often required after upgrading to a new distribution version.

Now we will get into the modifying some of the configuration files themselves. You'll do a bit of work from the terminal, but in general I'll give you a command that launches a GUI to make it a little less intimidating (though if you're comfortable with something like vi, by all means go ahead and use it instead). I started off attempting these changes while being logged in to my local account, but the server configurations may cause it to get confused (and lock you out). To get around this, use su to log in as root, and you'll be able to make all of the necessary changes without a problem. I assume you'll be logged in as root. If not, you may need to add sudo before many of these commands, if the machine will even let you. Don't close the terminal between commands.

  1. Use the command gedit /etc/passwd to open the passwd file. Scroll towards the bottom and delete the line that has your current local username. Then, at the bottom, add the following line:
          +::0:0:::
    Save the file and exit.
  2. Use gedit /etc/group to open the group file. Again, scroll towards the bottom and remove the line that starts with your username (you can leave other ones that may have your username in it, but not at the beginning). To the bottom of this file add:
          +::0:
    Save this file and exit.
  3. Use gedit /etc/shadow to open the shadow file. In this file, simply remove the line that has your current local username. Save and exit.
  4. Use gedit /etc/nsswitch.conf to open the Name Service Switch configuration file. Edit it so that it looks like this:
          # /etc/nsswitch.conf
          #
          # Example configuration of GNU Name Service Switch functionality.
          # If you have the `glibc-doc-reference' and `info' packages installed, try:
          # `info libc "Name Service Switch"' for information about this file.
       
          passwd:         nis compat
          group:          nis compat
          shadow:         nis compat
       
          hosts:          nis files mdns4_minimal [NOTFOUND=return] dns mdns4
          networks:       files
       
          protocols:      db files
          services:       db files
          ethers:         db files
          rpc:            db files
       
          netgroup:       nis
          automount:      nis
  5. Use gedit /etc/fstab and add this line to the bottom:
          ccmvault:/opt/labvault/system /opt/system nfs defaults 0 0
    Again, save and exit.
  6. Finally, use cd /etc/rc2.d to go to that folder. Type ls to see a list of files in the folder. Take specific note of three (numbers will be in the blanks):
          S__hal
          S__nis
          S__autofs
    These are scripts that will start the execution of each of these processes. They will execute in alphanumeric order, so the order that you see them in the directory is their current order. We want to specify the order of these three scripts. HAL should go first of the three, then NIS, then autofs. On my machine, I started with the following:
          S18nis
          S19autofs
          S24hal
    Rather than moving both NIS and autofs later, I chose to move HAL earlier. You can use the mv command to rename a file, where you can change the numbers. I did this:
          mv S24hal S13hal
    Now, after this, when I do another "ls" the three files in question are now:
          S13hal
          S18nis
          S19autofs
    This satisfies my need for the order of execution, so I'm done. You may have more to move around on your system.
  7. At this point, you're done! Congratulations! Close the terminal window and shut down. On a restart, you should now be able to log back in using your lab username and password. If you're not able to, you may have done something wrong, or it might be something else with your system's configuration. If you can't figure it out after looking through this tutorial again, talk to Dr. Athanas, and he may be able to help you.

-- AndrewOlson - 23 Feb 2009

Topic revision: r4 - 04 Nov 2009 - 01:54:17 - AliSohanghpurwala
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback