• How to install LTSP on ubuntu 9.04

    LTSP was available as an install option in Ubuntu 8.04 and 8.10 from the alternate install CD . However I am unable to find it on the Jaunty CD. So, here is a quick how to on installing LTSP on ubuntu 9.04.

    1) Install Ubuntu 9.04 desktop
    You can follow the default documentation on Ubuntu site.

    2) Set up a static IP on the system
    You can refer to this post for setting up static IP on Jaunty.

    3) Install dhcp3 server

    $ sudo apt-get install dhcp3-server

    You may also refer to this post for some more details on dhcp3 installation on Ubuntu 9.04.

    4) Install open ssh server

    $ sudo apt-get install open-sshserver

    Ltsp uses ssh to tunnel X to the client machines.

    5) Install ltsp

    $ sudo apt-get install ltsp-server-standalone

    This will download all the package needed for building LTSP.

    6) Edit /etc/ltsp/dhcpd.conf to suit your IP requirement

    The default dhcp3-server configuration file is in /etc/dhcp3/dhcpd.conf. However when ltsp was installed it created a new config file for dhcp3 under /etc/ltsp/dhcp3.conf. You have to edit this dhcp3.conf to suit your IP requirements.

    My dhcpd.conf looks like this. You can use this as a starting point.

    Code:
     # Default LTSP dhcpd.conf config file.
    
    #
    
    authoritative;
    
    subnet 192.168.0.0 netmask 255.255.255.0 {
    
      range 192.168.0.20 192.168.0.250;
    
      option domain-name "example.com";
    
      option domain-name-servers 192.168.0.1;
    
      option broadcast-address 192.168.0.255;
    
      option routers 192.168.0.1;
    
    #    next-server 192.168.0.1;
    
    #    get-lease-hostnames true;
    
      option subnet-mask 255.255.255.0;
    
      option root-path "/opt/ltsp/i386";
    
      if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
    
          filename "/ltsp/i386/pxelinux.0";
    
      } else {
    
          filename "/ltsp/i386/nbi.img";
    
      }
    
    }

    7) Run LTSP build client

    $ sudo ltsp-build-client

    This command will build the ltsp environment under /opt/ltsp and build the squashfs image for clients.

    8) Enable pxe boot on a client machine and test the set-up.

    Trouble shooting

    1) If your client boots up and says “You are not authorised to connect to server” , run the following.
    $sudo ltsp-update-sshkeys
    $sudo ltsp-update-image

    2) If you change the IP address of the server, run the same commands again, ie

    $sudo ltsp-update-sshkeys
    $sudo ltsp-update-image

    continue reading »

     
     
  • Exploring Ubuntu Recovery Mode

    Today, I did a fresh installation of Ubuntu 9.04 inside virtual box. My original idea was to play with sudoers and sudo command. I edited /etc/sudoers and logged out. Next time I tried to sudo , I go some parse error in /etc/sudoers. I was stuck . I needed sudo for modifying the file. But sudo was preventing me because of the error.

    Then, I remembered about the recovery mode. Rebooted the machine and I pressed escape to get the standard grub screen as shown below.

    Selecting recovery mode showed the following screens. ( The second figure below shows the remaining part of the recovery screen which is hidden from the first screen.)

    I selected drop to a root shell. It allowed me to enter root account with out a password. I fixed my /etc/sudoers and my problem was gone.

    Later I rebooted again and re-entered the recovery mode again to find out what capabilities it offers.

    The recovery screen offers you the following menu entries on ubuntu 9.04 .

    a) Try to make free space – this is useful if your machine is stuck for the want of free disk space.
    b) Dpkg – If you select this option you can repair broken packages. Very useful ,if the system is stuck after a package installation.
    c) fsck – if the system is stuck with file system error you can try this option.
    d) grub – You can update the grub boot loader from this option.
    e) netroot – Your TCP/IP network settings will be enabled and system will drop to a root shell.
    This option is useful if you are trouble shooting network related issues.
    f) root- Plain old root shell . Suitable for editing config files.
    g) xfix – This option will try to reconfigure your X window system

    continue reading »

     
     
  • Enhancing contextual menus on Ubuntu Desktop

    Ubuntu desktop uses Gnome and its default desktop. You can add several interesting features to your contextual menus. ( You get a contextual menu when you right click on an object.). Let us see how we can add a simple script to the contextual menu.
    There is a special directory ( .gnome2/nautilus-scripts/ ) inside your home folder into which you can put your custom scripts. Any script you place in that location can be accessed by right-clicking on a file or window and selecting it from the Scripts sub menu. (The Scripts menu item will be visible only if you have some valid scripts installed.

    Let us try to open a terminal from the contextual menu. Change to the scripts directory. ( Note that .gnome is a hidden directory, try control -h in nautilus to see hidden files. )

    $ cd ~/.gnome2/nautilus-scripts/

    Create the following script

    Code:
     #!/bin/shgnome-terminal

    Save the file as myterminal
    Change the permission of the file and make it executable

    $ chmod u+x myterminal

    Now right click on the contextual menu. You should get it as below.

    When you execute a contextual menu script , a number of environment variables are passed to the script from nautilus. For example, if you select some files and then right click and select a script , the list of selected files will be passed to the script as an environment variable . You can use this variable inside the script for further processing.

    Some of the variables passed are.

    NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
    Newline-delimited paths for selected files if they are local
    NAUTILUS_SCRIPT_SELECTED_URIS
    Newline-delimited URIs for selected files
    NAUTILUS_SCRIPT_CURRENT_URI
    URI for current location
    NAUTILUS_SCRIPT_WINDOW_GEOMETRY
    Position and size of the current window

    Here is a bare minimum example with which you can try out the use of environment variable.

    Suppose you want to open a terminal and change to a particular directory, you can put the following code in nautilus-scripts directory. ( There is no error checking).

    Code:

     #!/bin/sh
    
    mydir=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHSif [ -d $mydir ]; thencd $mydirgnome-terminalexitfi
    

    Now right click and select the script. Your terminal will open with the selected directory as the working directory.

    There are a number of nautilus scripts available on the internet. In the ubuntu 9.04 repository, the following script collections are available.

    nautilus-script-audio-convert – A nautilus audio converter script
    nautilus-script-collection-svn – Nautilus subversion management scripts

    You can also get lot of useful scripts from http://g-scripts.sourceforge.net/.

    continue reading »

     
     
 
 
Extra Tags