CentosWorkstation: Difference between revisions

From MDWiki
Jump to navigationJump to search
mNo edit summary
Line 87: Line 87:
* H: Make sure 873/TCP is open if a firewall is enabled
* H: Make sure 873/TCP is open if a firewall is enabled


== Create Image and Send to Image Server ==
== Creating Image and Sending to Image Server (Initial Workstation Image using Bootable CD) ==
These steps can be run every time a new image is to be sent to the image server. VM stands for commands run on Virtual Centos (Virtual Machine) and IS stands for commands to the image server.
These steps should be run just once to create the first image which performs a partitioning on the real workstation local disk. Update images do not perform partitioning. VM stands for commands run on Virtual Centos (Virtual Machine) and IS stands for commands to the image server.  
* VM: Edit /etc/systemimager/updateclient.local.exclude to exclude certain directories, e.g. nfs mounts:
* VM: Edit /etc/systemimager/updateclient.local.exclude to exclude certain directories, e.g. nfs mounts:
**  
**  
Line 136: Line 136:
* TODO: yum install fonts-chinese
* TODO: yum install fonts-chinese
* pymol:  (Dirty hack). yum install pymol. As the one from sorbonne repository gives the python shared object in 32-bit, we need to rebuild it. This involves running, inside the pymol source, python setup.py build. Then, copying the libpymol.so built to /usr/lib/python2.4/site-packages/pymol/_cmd.so.
* pymol:  (Dirty hack). yum install pymol. As the one from sorbonne repository gives the python shared object in 32-bit, we need to rebuild it. This involves running, inside the pymol source, python setup.py build. Then, copying the libpymol.so built to /usr/lib/python2.4/site-packages/pymol/_cmd.so.
== Creating Image and Sending to Image Server (Update Workstation Image using Grub) ==
These steps can be run once the first image has been loaded. This image does not perform a partitioning on the real workstation local disk. VM stands for commands run on Virtual Centos (Virtual Machine) and IS stands for commands to the image server.
* VM: Edit /etc/systemimager/updateclient.local.exclude to exclude certain directories, e.g. nfs mounts:
**
* VM: Prepare the image for image server, currently on lychee (IP Address 152.98.195.188)
** /usr/sbin/si_prepareclient --server 152.98.195.188
*** Continue? y
*** Continue? y
* IS: Grab the image from the virtual Centos running on the VirtualBox VM on the host computer (this case uqmd13, which has IP address 152.98.195.144)
** /usr/sbin/si_getimage -golden-client 152.98.195.144 -image centos_golden_client -ip-assignment static -autodetect-disks
*** Continue? y
*** Press <Enter> to continue ... <Enter>
*** Run si_clusterconfig? n
* VM: shutdown -h now # Also kills rsync daemon used for serving the image
* IS: Fix disk partitioning information
** Edit: /systemimager/images/centos_golden_client/etc/systemimager/autoinstallscript.conf
*** Replace all: /dev/hda (VM disk) with /dev/sda (Real SATA disk)
*** Alter partitioning to use whole disk space:
<code><pre>
<disk dev="/dev/sda" label_type="msdos" unit_of_measurement="%">
    <!--
      This disk's output was brought to you by the partition tool "parted",
      and by the numbers 4 and 5 and the letter Q.
    -->
    <part  num="1"  size="0.1"  p_type="primary"  p_name="-"  flags="boot" />
    <part  num="2"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="3"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="4"  size="*"  p_type="extended"  p_name="-"  flags="-" />
    <part  num="5"  size="1"  p_type="logical"  p_name="-"  flags="-" />
    <part  num="6"  size="*"  p_type="logical"  p_name="-"  flags="-" />
  </disk></pre></code>
** /usr/sbin/si_mkautoinstallscript -image centos_golden_client -force -ip-assignment static -post-install beep
* IS: Make bootable CD that will download the image from the image server
** Put a writable CD into the image server
** Generate ISO
*** /usr/sbin/si_mkautoinstallcd --out-file /tmp/systemimager.iso --kernel /usr/share/systemimager/boot/x86_64/standard/kernel --initrd /usr/share/systemimager/boot/x86_64/standard/initrd.img --append "IMAGESERVER=152.98.195.188 IMAGENAME=centos_golden_client SKIP_LOCAL_CFG=y"
** Burn ISO to CD (to find the CD recorder device run: cdrecord -scanbus)
*** cdrecord -v -eject speed=16 dev=1,0,0 /tmp/systemimager.iso
* IS: [Re]Start rsync server
** To check status: /etc/init.d/systemimager-server-rsyncd status
** To start: /etc/init.d/systemimager-server-rsyncd start
** To restart: /etc/init.d/systemimager-server-rsyncd restart


= How to make a Centos Workstation (Real Machine) =
= How to make a Centos Workstation (Real Machine) =


== First Image ==
== Initial Image ==
* Check nothing that cannot be replaced is on the local machine hard disk, as it will be wiped
* <font color="red">Warning! Make sure that the local disk does not have anything on it as it will be wiped</font>
* Boot from boot CD create above
* Boot from boot CD create above [[#Creating Image and Sending to Image Server (Initial Workstation Image using Bootable CD)]]
* Change /etc/X11/xorg.conf : generic to nvidia '''TEST'''
* Change /etc/X11/xorg.conf : generic to nvidia '''TEST'''


Line 147: Line 190:
== Second and Later Installs ==
== Second and Later Installs ==
* The /data partition will not be replaced
* The /data partition will not be replaced
= Frequenty Asked Questions =
* Does the /data partition on the local disk get removed by the imaging process? Only when imaging from the boot CD. When imaging from the SystemImager option in the

Revision as of 07:38, 29 April 2009

How to make a Centos Workstation (VM)

Warning Do not install the Xen virtualisation package within the virtual Centos as it will crash during boot when running inside the VirtualBox VM!

A virtual machine makes installation and testing faster and easier, especially since it makes it easy to make and revert to snapshots.

Building the VM (Virtual Machine)

For serving the image to lychee, VirtualBox needs to be run as root because the NAT port forwarding from 873/TCP on the host to 873/TCP on the virtual machine is only possible in Linux if the VirtualBox processes are run by root. It is probably best to run VirtualBox as root for other stages, just for VirtualBox's own internal consistency.

  • Inside VirtualBox (F7|C5) server, add users to vboxgroup (/etc/group), run VirtualBox, register product, create new virtual machine
    • "Centos 5.3 Workstation"
    • Linux, Red Hat 64-bit
    • 1536MB RAM
    • Boot hard disk (Primary master)
      • Create new hard disk
        • Dynamically expanding storage
        • Location: /data/virtualbox/Centos.vdi
        • Size: 40.0 GB
  • This creates a $HOME/.VirtualBox directory, which contains all the information about the VM
  • Further settings

Installing Centos

  • Start VM
  • Press Enter at Centos installation screen
  • Skip media check
  • Ignore colour mode message
  • Centos Installation screen (GUI)
    • Language: English
    • US English
    • Click OK to erase all data on device hda
      • Hard disk
    • Create custom layout
    • hda 40955MB VBOX HARDDISK
    • Partitioning
      • /boot, ext3, 100MB, Fixed size, Force to be a primary partition
      • /, ext3, 18000MB, Fixed size, Force to be a primary partition
      • /usr, ext3, 18000MB, Fixed size, Force to be a primary partition
      • swap, 2048MB, Fixed size
      • /data, ext3, Fill to maximum allowable size
    • The Grub boot loader will be installed on /dev/hda
      • Default: CentOS /dev/hda3 (/)
    • Network
      • Active on boot, eth0, DHCP, Auto
    • Hostname:
      • Automatically via DHCP
    • Time
      • Australia/Brisbane time
      • System clock uses UTC
    • Root password
      • <standard workstation root password>
    • Installation
      • Desktop - Gnome
      • Desktop - KDE
      • Centos Extra
        • eth0/DHCP/IPv4 (for downloading packages)
      • Customize later
    • Begin!
    • Wait ~20 minutes
    • Reboot (unmounting ISO)
  • Post Installation Configuration
    • Firewall: Disabled
    • SELinux: Disabled
    • NTP: Enabled, 130.102.2.15, 130.102.128.43, Synchronise system clock, Local time source
    • Create User: Use Network Login: LDAP for both User Information & Authentication:
      • LDAP Search Base DN: dc=md,dc=smms,dc=uq,dc=edu,dc=au
      • LDAP Server: ldap://lychee.md.smms.uq.edu.au/
    • Sound should be OK
    • Reboot
    • Power off

Installing Imaging System

After installation of the base system, we need to perform some one-time steps to allow it to be imaged to real machines. VM stands for commands run on Virtual Centos (Virtual Machine), H stands for commands run on the host, such as commands to the VirtualBox application itself.

  • H: Forward port 873/TCP on the host to the VM
    • Note: e1000 below is because the virtual Intel 1Gb adapter is used (this is the default). Check that this is indeed the case.
    • VBoxManage setextradata "Centos 5.3 Workstation" "VBoxInternal/Devices/e1000/0/LUN#0/Config/rsync/Protocol" TCP
    • VBoxManage setextradata "Centos 5.3 Workstation" "VBoxInternal/Devices/e1000/0/LUN#0/Config/rsync/GuestPort" 873
    • VBoxManage setextradata "Centos 5.3 Workstation" "VBoxInternal/Devices/e1000/0/LUN#0/Config/rsync/HostPort" 873
  • H: Start VirtualBox
    • VirtualBox &
  • H: Start Centos 5.3 Workstation
  • VM: scp -r -P 2023 lychee.md.smms.uq.edu.au:/etc/yum.repos.d/\* /etc/yum.repos.d/
  • VM: yum update
  • VM: yum install perl-AppConfig
  • VM: rpm -iv systemconfigurator-2.2.11-1.noarch.rpm systemimager-common-4.1.6-1.noarch.rpm systemimager-client-4.1.6-1.noarch.rpm systemimager-x86_64initrd_template-4.1.6-1.noarch.rpm
  • VM: We don't need to open port 873/TCP (for serving the image) as no firewall is turned on
  • H: Make sure 873/TCP is open if a firewall is enabled

Creating Image and Sending to Image Server (Initial Workstation Image using Bootable CD)

These steps should be run just once to create the first image which performs a partitioning on the real workstation local disk. Update images do not perform partitioning. VM stands for commands run on Virtual Centos (Virtual Machine) and IS stands for commands to the image server.

  • VM: Edit /etc/systemimager/updateclient.local.exclude to exclude certain directories, e.g. nfs mounts:
  • VM: Prepare the image for image server, currently on lychee (IP Address 152.98.195.188)
    • /usr/sbin/si_prepareclient --server 152.98.195.188
      • Continue? y
      • Continue? y
  • IS: Grab the image from the virtual Centos running on the VirtualBox VM on the host computer (this case uqmd13, which has IP address 152.98.195.144)
    • /usr/sbin/si_getimage -golden-client 152.98.195.144 -image centos_golden_client -ip-assignment static -autodetect-disks
      • Continue? y
      • Press <Enter> to continue ... <Enter>
      • Run si_clusterconfig? n
  • VM: shutdown -h now # Also kills rsync daemon used for serving the image
  • IS: Fix disk partitioning information
    • Edit: /systemimager/images/centos_golden_client/etc/systemimager/autoinstallscript.conf
      • Replace all: /dev/hda (VM disk) with /dev/sda (Real SATA disk)
      • Alter partitioning to use whole disk space:
<disk dev="/dev/sda" label_type="msdos" unit_of_measurement="%">
    <!--
      This disk's output was brought to you by the partition tool "parted",
      and by the numbers 4 and 5 and the letter Q.
    -->
    <part  num="1"  size="0.1"  p_type="primary"  p_name="-"  flags="boot" />
    <part  num="2"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="3"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="4"  size="*"  p_type="extended"  p_name="-"  flags="-" />
    <part  num="5"  size="1"  p_type="logical"  p_name="-"  flags="-" />
    <part  num="6"  size="*"  p_type="logical"  p_name="-"  flags="-" />
  </disk>
    • /usr/sbin/si_mkautoinstallscript -image centos_golden_client -force -ip-assignment static -post-install beep
  • IS: Make bootable CD that will download the image from the image server
    • Put a writable CD into the image server
    • Generate ISO
      • /usr/sbin/si_mkautoinstallcd --out-file /tmp/systemimager.iso --kernel /usr/share/systemimager/boot/x86_64/standard/kernel --initrd /usr/share/systemimager/boot/x86_64/standard/initrd.img --append "IMAGESERVER=152.98.195.188 IMAGENAME=centos_golden_client SKIP_LOCAL_CFG=y"
    • Burn ISO to CD (to find the CD recorder device run: cdrecord -scanbus)
      • cdrecord -v -eject speed=16 dev=1,0,0 /tmp/systemimager.iso
  • IS: [Re]Start rsync server
    • To check status: /etc/init.d/systemimager-server-rsyncd status
    • To start: /etc/init.d/systemimager-server-rsyncd start
    • To restart: /etc/init.d/systemimager-server-rsyncd restart

Software

  • yum install pymol zsh lyx
  • yum install fonts-chinese
  • TODO: yum install fonts-chinese
  • pymol: (Dirty hack). yum install pymol. As the one from sorbonne repository gives the python shared object in 32-bit, we need to rebuild it. This involves running, inside the pymol source, python setup.py build. Then, copying the libpymol.so built to /usr/lib/python2.4/site-packages/pymol/_cmd.so.

Creating Image and Sending to Image Server (Update Workstation Image using Grub)

These steps can be run once the first image has been loaded. This image does not perform a partitioning on the real workstation local disk. VM stands for commands run on Virtual Centos (Virtual Machine) and IS stands for commands to the image server.

  • VM: Edit /etc/systemimager/updateclient.local.exclude to exclude certain directories, e.g. nfs mounts:
  • VM: Prepare the image for image server, currently on lychee (IP Address 152.98.195.188)
    • /usr/sbin/si_prepareclient --server 152.98.195.188
      • Continue? y
      • Continue? y
  • IS: Grab the image from the virtual Centos running on the VirtualBox VM on the host computer (this case uqmd13, which has IP address 152.98.195.144)
    • /usr/sbin/si_getimage -golden-client 152.98.195.144 -image centos_golden_client -ip-assignment static -autodetect-disks
      • Continue? y
      • Press <Enter> to continue ... <Enter>
      • Run si_clusterconfig? n
  • VM: shutdown -h now # Also kills rsync daemon used for serving the image
  • IS: Fix disk partitioning information
    • Edit: /systemimager/images/centos_golden_client/etc/systemimager/autoinstallscript.conf
      • Replace all: /dev/hda (VM disk) with /dev/sda (Real SATA disk)
      • Alter partitioning to use whole disk space:
<disk dev="/dev/sda" label_type="msdos" unit_of_measurement="%">
    <!--
      This disk's output was brought to you by the partition tool "parted",
      and by the numbers 4 and 5 and the letter Q.
    -->
    <part  num="1"  size="0.1"  p_type="primary"  p_name="-"  flags="boot" />
    <part  num="2"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="3"  size="10"  p_type="primary"  p_name="-"  flags="-" />
    <part  num="4"  size="*"  p_type="extended"  p_name="-"  flags="-" />
    <part  num="5"  size="1"  p_type="logical"  p_name="-"  flags="-" />
    <part  num="6"  size="*"  p_type="logical"  p_name="-"  flags="-" />
  </disk>
    • /usr/sbin/si_mkautoinstallscript -image centos_golden_client -force -ip-assignment static -post-install beep
  • IS: Make bootable CD that will download the image from the image server
    • Put a writable CD into the image server
    • Generate ISO
      • /usr/sbin/si_mkautoinstallcd --out-file /tmp/systemimager.iso --kernel /usr/share/systemimager/boot/x86_64/standard/kernel --initrd /usr/share/systemimager/boot/x86_64/standard/initrd.img --append "IMAGESERVER=152.98.195.188 IMAGENAME=centos_golden_client SKIP_LOCAL_CFG=y"
    • Burn ISO to CD (to find the CD recorder device run: cdrecord -scanbus)
      • cdrecord -v -eject speed=16 dev=1,0,0 /tmp/systemimager.iso
  • IS: [Re]Start rsync server
    • To check status: /etc/init.d/systemimager-server-rsyncd status
    • To start: /etc/init.d/systemimager-server-rsyncd start
    • To restart: /etc/init.d/systemimager-server-rsyncd restart

How to make a Centos Workstation (Real Machine)

Initial Image


Second and Later Installs

  • The /data partition will not be replaced


Frequenty Asked Questions

  • Does the /data partition on the local disk get removed by the imaging process? Only when imaging from the boot CD. When imaging from the SystemImager option in the