Onyx logo

Table Of Contents

Previous topic

Install Ubuntu

Next topic

Updating and installing packages

This Page

Static configuration of the Ubuntu system

Once the Ubuntu system is running we make a few, one-time changes to the configuration in order to make it easier to access and to make sure the tools we install later will be available to the users of the system.

Make sure the Ubuntu machine is booted. VMware may alert you to the fact that VMware Tools is not installed on the virtual machine. We’ll install those tools later.

The console should display the login prompt:

Ubuntu 10.04 LTS OnyxUbuntu32 tty

OnyxUbuntu32 login:

Click on the console window, and then login to the administrative account with the password you used during the installation:

OnyxUbuntu32 login: onyxadm
Password: onyxadmin   (this one time we're showing our recommended password)

You should get a screenful of licensing etc. info, and then a shell prompt:

onyxadm@OnyxUbuntu32:~$ _

Setup SSH access

The console window is very constrained as far as UI (cut and paste) and command-line usage is concerned. We install an SSH server on the Ubuntu machine to allow access from any terminal window running on the host.

On the guest console

Install the openssh-server so that you can login from a terminal window on the host machine:

onyxadm@OnyxUbuntu32:~$ sudo apt-get install openssh-server
[sudo] password for onyxadm:

It will print out info and recommendations and ask if you want to continue; the default is Yes, so just hit Return. It will download packages, configure SSH, and start the SSH server.

Once SSH is installed and running, use ifconfig to get the Ubuntu machine’s IP address:

onyxadm@OnyxUbuntu32:~$ ifconfig

This should show IP configuration info for two interfaces: eth0 and lo. The address we want is the inet addr: for eth0, e.g. 172.16.166.130, usually found on the second line of the output from ifconfig.

On the host machine

On the host machien, switch to a terminal application, and use SSH to connect to the virtual machine. Note that you may have to accept an RSA fingerprint (or even edit your known_hosts file if the virtual machine’s IP address has been used before):

$ ssh onyxadm@172.16.166.130
The authenticity of host '172.16.166.130 (172.16.166.130)' can't be established.
RSA key fingerprint is 88:cd:8b:1f:18:79:3f:77:24:d9:b1:6a:2f:23:cf:85.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.166.130' (RSA) to the list of known hosts.

onyxadm@172.16.166.130's password:
Linux OnyxUbuntu32 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS

Welcome to Ubuntu!
 * Documentation:  https://help.ubuntu.com/

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Last login: Thu May  6 18:12:19 2010
onyxadm@OnyxUbuntu32:~$

Other changes to the Ubuntu configuration

For the remainder of the steps to configure the Ubunut system, we will assume you are using the terminal on the host machine with SSH access to the Ubuntu machine, and that you can paste text from the clipboard into the terminal.

Become root

In general we recommend using sudo on a command-by-command basis for doing adminstrative work; but, because we have a bunch of changes to make we will be come root for the remainder of this document. In the terminal, become superuser:

onyxadm@OnyxUbuntu32:~$ sudo su -
[sudo] password for onyxadm:
root@OnyxUbuntu32:~#

Tools for administrative work

Configuration work on the Ubuntu system involves using the command line and editing files. For editing, the vi editor is already available. If you prefer other tools, now is the time to install them.

We prefer Emacs, so we install it now:

root@OnyxUbuntu32:~# apt-get install emacs23-nox
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  emacs23-bin-common emacs23-common emacsen-common libasound2 libpython2.6
Suggested packages:
  emacs23-el libasound2-plugins
The following NEW packages will be installed:
  emacs23-bin-common emacs23-common emacs23-nox emacsen-common libasound2 libpython2.6
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.9MB of archives.
After this operation, 77.0MB of additional disk space will be used.
Do you want to continue [Y/n]?

... (many pages of output)

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
root@OnyxUbuntu32:~#

Note

When you paste text into configuration files, be sure to add final newline after the last line of the pasted text.

Other changes to system files

Make the CD reader easy to mount. In a shell:

root@OnyxUbuntu32:~# cd /media
root@OnyxUbuntu32:/media# mkdir cdrom0
root@OnyxUbuntu32:/media# ln -s cdrom0 cdrom

Edit /etc/fstab and add the following line at the bottom:

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

Add files to default configuration for new users.

Create the file /etc/skel/.bash_aliases with the following contents:

# ~/.bash_aliases: sourced by ~/.bashrc

# work around broken colors in emacs shell
alias ls='ls --color=none'

# enable quick PYTHONPATH in top directory of Onyx-based tools
alias pypa='export PYTHONPATH=`pwd`/py'

Create the file /etc/skel/.emacs with the following contents:

(display-time)
(setq-default fill-column 80)
(shell)

;; Font-Lock Mode Flags and syntax colors
(progn
  (global-font-lock-mode t)
  (setq font-lock-maximum-decoration t)
  (set-face-background 'modeline "black")
  (set-face-foreground 'modeline "white")

  ; font-lock-builtin-face
  (set-face-foreground font-lock-builtin-face "blue")
  ; font-lock-keyword-face
  (set-face-foreground font-lock-keyword-face "blue")
  ; font-lock-comment-delimiter-face
  (set-face-foreground font-lock-comment-delimiter-face "red")
  ; font-lock-comment-face
  (set-face-foreground font-lock-comment-face "red")
  ; font-lock-constant-face
  (set-face-foreground font-lock-constant-face "red")
  (make-face-bold font-lock-constant-face)
  ; font-lock-doc-face
  (set-face-foreground font-lock-doc-face "grey")
  ; font-lock-function-name-face
  (set-face-foreground font-lock-function-name-face "red")
  (make-face-bold font-lock-function-name-face)
  ; font-lock-keyword-face
  (set-face-foreground font-lock-keyword-face "blue")
  (make-face-unbold font-lock-keyword-face)
  ; font-lock-string-face
  (set-face-foreground font-lock-string-face "red")
  ; font-lock-type-face
  (set-face-foreground font-lock-type-face "red")
  (make-face-bold font-lock-type-face)
  ; font-lock-variable-name-face
  (set-face-foreground font-lock-variable-name-face "black")
  ; font-lock-warning-face
  (set-face-foreground font-lock-warning-face "black")
  ; font-lock-negation-char-face
  ; font-lock-preprocessor-face
  ; font-lock-regexp-grouping-backslash-face
  ; font-lock-regexp-grouping-construct-face
)

;; Python stuff
(setq comment-style 'plain)
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist))
; in a shell buffer:  grab the shell's PYTHONPATH into emacs
(fset 'pypa "\C-[xshell-copy-environment-variable\C-mPYTHONPATH\C-m")

That’s it for static changes to system files. Next we have to update and install packages.