Configure VM for lab experiments

From Notes_Wiki

Home > CentOS > CentOS 6.x > New machine configuration > Configure VM for lab experiments

This page is intended to describe settings to be done, files to be copied, packages to be installed via yum or source after OS has been installed on a VM to be used for lab experiments. It was last updated during Cent-OS 6.3 installation on 20th March, 2013


Installing OS

Install OS with following partitioning:

  • Create swap of about 1024MB
  • Allocate rest of the space to / (ext3)


GUI configuration

  • Remove user switch option from panel from top right corner of screen
  • Add system monitor panel extension for monitoring CPU, hard-disk and network usage.
  • Remove all folders (Documents, Downloads, Music, Pictures, etc.) from home folder except Desktop
  • Configure nautilus properly
    • Show hidden and backup files
    • Always open in browser window
    • View executable text files when they are opened
    • Preview for files smaller than 500KB
  • Add lock icon to panel for locking screen
  • Disable screensaver and locking
  • Configure display to go to never go to sleep. Also configure power management such that when power button is pressed system shuts down.


Configure firefox

  • Edit preferences for file download and blank page as home
  • Configure proper proxy and no proxy for values


Configure terminal

Do following changes immediately after OS install to configure terminals

  1. Create file /etc/profile.d/history.sh as mentioned at Storing date / time along with commands in history
  2. Configure Ctl+Alt+t to be shortcut for running terminal
  3. Configure sudo to allow user saurabh to run all commands as root as mentioned at Allowing user to run all commands as root without specifying password
  4. Create shortcut for root terminal in gnome-panel with command 'sudo su -' to be run in terminal with '/usr/share/pixmaps/keyring.png' as image file.
  5. Remove all temporary files created in /root by anaconda



Configure start-up applications

Go to System -> Preferences -> Start-up applications and disable following start-up applications:

  • AT SPI Registry Wrapper
  • Automatic bug reporting tool
  • Bluetooth
  • Disk Notification
  • File context maintainer
  • Gnome Login Sound
  • Network Authentication
  • Network manager
  • Packetkit update
  • Personal file sharing
  • Policykit authentication agent
  • Power Manager
  • Print Queue Applet
  • Pulseaudio Sound System
  • Remote desktop
  • Screensaver
  • SELinux troubleshooter
  • Smart card manager
  • Spice vdagents
  • Terminal server client autostart
  • User folder update
  • Visual assistance
  • Volume Control


Disable SELinux

Edit file '/etc/sysconfig/selinux' and set value for SELINUX parameter to 'disabled'


Disabling services

Disable following services after OS is installed from automatically starting in run-levels 3 to 5: (List is alphabetic)

  1. NetworkManager
  2. abrt-ccpp
  3. abrt-oops
  4. abrtd
  5. auditd
  6. avahi-daemon
  7. bluetooth
  8. cachefilesd
  9. certmonger
  10. cgconfig
  11. edac
  12. fcoe
  13. fcoe-target
  14. ibacm
  15. iscsi
  16. iscsid
  17. isdn
  18. ksm
  19. ksmtuned
  20. libvirt-guests
  21. libvirt-qmf
  22. libvirtd
  23. lldpad
  24. lvm2-monitor
  25. mcelogd
  26. mdmonitor
  27. nfslock
  28. pcscd
  29. pppoe-server
  30. qpidd
  31. rpcbind
  32. rpcgssd
  33. rpcidmapd
  34. sandbox
  35. spice-vdagentd
  36. stap-server
  37. tog-pegasus
  38. trace-cmd
  39. xinetd


One can use following shell script to disable all above mentioned services:

#!/bin/bash

SERVICES="NetworkManager
abrt-ccpp
abrt-oops
abrtd
auditd
avahi-daemon
bluetooth
cachefilesd
certmonger
cgconfig
cups
edac
fcoe
fcoe-target
ibacm
iscsi
iscsid
isdn
ksm
ksmtuned
libvirt-guests
libvirt-qmf
libvirtd
lldpad
lvm2-monitor
mcelogd
mdmonitor
nfslock
pcscd
pppoe-server
qpidd
rpcbind
rpcgssd
rpcidmapd
sandbox
spice-vdagentd
stap-server
tog-pegasus
trace-cmd
xinetd "

for SERVICE1 in $SERVICES; do
	echo "Going to run " chkconfig $SERVICE1 off
	chkconfig $SERVICE1 off
done

exit 0


If the VM is going to be used for lvm based experiments then lvm2-monitor should be enabled. Similarly if VM would be used for software raid experiments then mdmonitor should be enabled. The point is based on the nature of experiment few of the above services may have to be enabled. The current list is very exhaustive to ensure that all non-critical services are stopped.



Enabling services

  • Configure 'network' service by going to '/etc/sysconfig/network-scripts' and editing appropriate ifcfg file.
  • Enable network on start-up using 'chkconfig network on'
  • Configure ntpdate by editing '/etc/ntp.conf' and '/etc/ntp/step-tickers'.
  • Enable ntpdate on start-up using 'chkconfig ntpdate on'


Configure yum

Configure yum with following repositories

  • rpmfusion
  • rpmforge
  • epel

To configure use following steps:

  1. Vist http://www.rpmfusion.org/ and choose link 'Enable RPM Fusion no your system'.
  2. Then download both RPM Fusion free and RPM Fusion nonfree setup rpms
  3. Install epel using from http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
  4. Install downloaded rpms using 'rpm -ivh rpmfusion*'
  5. Disable 'rpmfusion-free-updates-testing' and 'rpmfusion-nonfree-updates-testing' repositories
  6. Visit http://repoforge.org/use/ and download rpmfile for configuring repoforge (rpmforge) repository.
  7. Configure repoforge repository using downloaded rpm file 'rpm -ivh repo*.rpm'
  8. Edit '/etc/yum.conf' and configure proper proxy and do 'keepcache=1'
  9. rsync yum cache backup from updated machines '/var/cache/yum' folder with keepcache=1 to current machine


Installing packages from yum

Install following packages using yum (List is alphabetic)

  1. atop
  2. denyhosts
  3. dot
  4. encfs
  5. emacs
  6. flash-plugin
  7. geany
  8. htop
  9. hunt
  10. iptraf
  11. john
  12. libotf-devel
  13. openvpn
  14. phpMyAdmin
  15. tcptrack
  16. wireshark
  17. wireshark-gnome


Following script can be used to install above packages:

#!/bin/bash

PACKAGES="atop
denyhosts
dot
encfs
emacs
flash-plugin
geany
htop
hunt
iptraf
john
libotf-devel
openvpn
phpMyAdmin
tcptrack
wireshark
wireshark-gnome"

yum -y install $PACKAGES

exit 0


Configure SSH

  1. Enable connection multiplexing as explained at Sharing multiple ssh connections
  2. Disable GSSAPI authentication using 'GSSAPIAuthentication no'


Disable guest account

  1. Use 'userdel -r xguest' to disable guest account


Install packages from source

Install following packages from source:

  1. Installing Erlang by source
  2. Installing yaws by source


Home > CentOS > CentOS 6.x > New machine configuration > Configure VM for lab experiments