Showing posts with label OEL. Show all posts
Showing posts with label OEL. Show all posts

OEL - VBox Guest Additions

On gui-less linux installations it is not always clear how the guest additions can be installed.

This article tries to show how to do this.

The steps to do this are:
  • Get the additions mounted (supposing no cdrom is attached yet) 
  • create cdrom directories 
  • determine the cdrom device 
  • mount the device loosely 
  • install the guest additions 
  • (Install missing packages ... ) 
  • (Retry installation) 
Just click devices > install guest additions
The cdrom will become attached to the vm
Best is to reboot the system at this instance. (Have encountered that for some reason the cd device was no immediately available.)

To be able to mount the cdrom within some instances you will require a directory to mount it to.
Go to the /mnt directory as root user and create some directories with a trailing number.

For example:
mkdir cdrom0
mkdir cdrom1
...for as many as you will find cdroms required ;-)

The trailing number starts best with 0 ... why ... see later.

Determine the cdrom device.
The name of the device depends under which link the cdrom is attached.
If a cdrom is defined as a SATA device the cdrom will become available as sr0, sr1 ...
For the further documentation let 's suppose the device is /dev/sr0

Mount the cdrom by using the following command:
mount /dev/sr0 /mnt/cdrom0
So ... that is why 0 at the end ... ;-)

The output of the command will be something like this:

root@wlspfrd mnt]# mount /dev/sr0 /mnt/cdrom0
mount: block device /dev/sr0 is write-protected, mounting read-only

Go to the cdrom drive:
cd /mnt/cdrom0

[root@wlspfrd mnt]# cd /mnt/cdrom0
[root@wlspfrd cdrom0]# ls
32Bit runasroot.sh VBoxWindowsAdditions.exe
64Bit VBoxLinuxAdditions.run VBoxWindowsAdditions-x86.exe
AUTORUN.INF VBoxSolarisAdditions.pkg
autorun.sh VBoxWindowsAdditions-amd64.exe

To install the additions execute the VBoxLinuxAdditions.run command.
./VBoxLinuxAddtions.run

In a 64-bit Oracle Linux environment you will encounter a problem which is indicated by the line:
Building the main Guest Additions module [FAILED]

The reason is that the build requires the header files of the correct version of the Linux OS.
The line preceeding the FAILED error gives a clear hint:
The following command should solve the problem.
yum install kernel-uek-devel-2.6.32-200.13.1.el5uekPut the package name, in this case kernel-uek-devel-2.6.32-200.13.1.el5uek in the copy buffer

To install this package, the yum repository must be configured (context Oracle)
See the website for this: http://public-yum.oracle.com/
Follow the instructions.
cd /etc/yum.repos.d
for Oracle Linux 5:
          wget http://public-yum.oracle.com/public-yum-el5.repo
for Oracle Linux 6:
          wget http://public-yum.oracle.com/public-yum-el6.repo
In the obtained file enable (value = 1) the correct version (warning if you enable the latest version the update may take a long time ... ).

After installation of the yum repository, retry the installation of VBox additions.
This should now succeed.

After this any shared folder will become available in the /media directory.

Update dd 02-feb-2014


When using version 6 update 3 of Oracle Linux, it seems not possible to get the correct Kernel headers for the uek. At least it should be possible to find them ... but I did not find them, or at least ... not as fast as I wanted. Just used a short-circuit to get things working fast ... 

I followed these steps:
  • boot with the non-uek kernel
    This can be achieved by:
    • or change the kernel at boot time
    • or change the default boot instance in the /boot/grub/grub.conf file
  • Make sure gcc and the kernel-devel packages are installed (using yum install gcc kernel-devel kernel-headers)
  • running VBoxLinuxAdditions.run -> this should not fail anymore
  • you will find in the /media any shared folder
  • now ... reboot in
    • uek -> seems to work ... but not really guaranteed because of the difference in the compile-time and runtime-kernel versions
    • run in the version as was compiled 
      • make the kernel version permanent in the grub.conf if not already done so

Update 4-feb-2014

Context Delta : Oracle Linux 6.3 base installation with Database Server option.
Even though the kernel was booted with the compatible version (RHEL) the openGL compilation failed. All major requirements like folder sharing and screen sizing do not work.
Found on a site the hint to do an export  MAKE="/usr/bin/gmake -i " before launching the VBoxLinuxadditions.run command.
This solved immediately the problem of the shared folders not being accessible under /media/sf_*.
It did not solve the problem of the windows resizing.
After a reboot with the original UEK kernel (in OL 6.3) which caused the Shared folders not being accessible anymore.
Starting to update to really latest version of OL v6 ... see if things will be more smooth then ...
... and yes it did.
So ... changed  config file in the yum.repos.d directory to retrieve the latest versions, which at this moment in time seems to be 6.5.1. Performed a simple yum update which took 40 MB to download and install. Rebooted with the new kernel.
Mounted the cdrom again and started the installation of the VBoxGuestAdditions again.
This time no errors were encountered ... with the exception of the Window System Drivers.
Will try to fix that too.

Good Luck

OEL - Kickstart documentation

The following link, this link, points to the doc of redhat kickstart.

OEL klein en fijn

note 579101.1 over minimale installatie van OEL ... naar het schijnt gescrhreven door de Master himself.
800124.1 over oracle Validate.

OEL netwerk configuration

Sometimes a system has been initiated to use DHCP and the use of a static ip-address is required, including correct dns resolution and gateway settings.

The following steps accomplish this:

Define the parameters of the NIC
  • Connect as root
  • Go to directoy /etc/sysconfig/network-scripts
  • Identify the file that is used for the NIC that you must define:
    for example ifcfg-eth0 is for the traditional first network card.

  • Verify/Change the settings depending on your needs
  • When changing from dhcp to static addressing, the file should become something like this:
    BOOTPROTO=static

    BROADCAST=192.168.1.255
    HWADDR=xx:xx:xx:xx:xx
    IPADDR=192.168.1.102
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    ONBOOT=yes

Define the paramter for the network in itself
  • Connect as root
  • Go to /etc/sysconfig
  • Edit the file network
  • Set the hostname here and the gateway for the network.
  • The file should contain something like:
    HOSTNAME=myservername

    GATEWAY=192.168.1.1


Set the resolv.conf file with the nameservers
  • Connect as root
  • Go to directory /etc
  • Edit the file resolv.conf
  • Add/modify lines in the file with the specification of the nameserver.
  • An example
    search hellings.be

    nameserver vvv.xxx.yyy.zzzz

  • Add as many nameservers as you require
Restart the network
  • Connect as root
  • Restart the network
    service network restart

Create Filesystem on OEL

Just as a documentation thing...

1.Partition the device

Use fdisk to add/delete/modify partitions.
Start it by specifying the device name after fdisk:
ex. fdisk /dev/hdb
The result of this will be that you allocated the space on the device to a set of partitions (/dev/hdb1, ... )
This you can see when looking in the /dev directory. The partitions you created should be defined in it.

2. Create a filesystem on the partition(s)
This can be done by issueing the mkfs command.
You have to specify the type of filesystem at the -t option.
For example: mkfs -t ext3 /dev/hdb1

3. Mounting the filesystem
Two possible ways to do this:
- on a permanent basis 3.b.
- on a use base : 3.a.

3.a. Mount the filesystem permantently
This is achieved by defining the partition and mount point in the fstab file.
In there you will enter a line per partition to be mounted with the systemboot.
See man fstab for details on what theline should look like.

3.b. Mount the filesystem on a use base
Just launch the command mout to mount the filesystem on the location you want.
The location must be a directory.
ex: mount -t ext3 /dev/hdb1 /MyNewPartition

3.c for completeness ... unmounting the filesystem
You can do this by issueing the umount command followed by the mount point
ex. umount /MyNewPartition

Shrink size of a LVM Volume Group

The next things are a very short resume of an article on how to shrink a Logical Volume group by using the rescue mode of the installation disk.

The article itself can be found at http://forums.fedoraforum.org .

The context is Redhat or Oracle Enterprise Linux.

In order to shrink an LVM volume group the only prerequisite is that you have the installation media.

1. Verify the content in advance of the logical volume group.
This can be done via the volume management tool (graphical) where you see the layout of the filesystems, or simply by using df -h on the command line. Verify the space that is in effect used in the filesystem.

2. Launch the rescue mode.
This can be achieved by booting the machine using the installation media of Redhat/Fedora/Oracle linux.
The option to launch the rescue mode is documented in the startup screen. See F2 for more informaiton after booting from the dvd/cd.
On the command prompt enter "linux rescue".
Enter the language, keyboard and network parameters. The network is not required to be available.

3. identify the filesystems to be unmounted
Typically the existing filesystems will be mounted in rescue mode in
/mnt/sysimage.
Use df -h to see a list of filesystems.

4. unmount the filesystems
Execute an umount for each of the filesystems named /mnt/sysimage/* ending with the /mnt/sysimage itselve.

5. Identify the volumegroup
Two options here:
- you looked closely to the df -h output
- you look in the /dev directory to identify the structure of the volumegroup.

6. Check the logical volumes.

Perform an e2fsck on the logical volume:
$> e2fsck -f /dev/VolGroup00/LogVol00
At the end of the command the statistics show the usage of the filesystem.

7. Resize the filesystem.
Execute resize2fs to move all files in a consistent way to the beginning of the device.
resize2fs /dev/VolGroup00/LogVol00 3G
The 3G is the indication of the size that will be used for the filesystem after the operation.

8. Release not used space.
This will physically change the size of the partition occupied.
Some OS's do not have an lvm command shell but all commands have to be passed to lvm. This is something that was not documented in the original article.
To know the existence of the lvm shell, simply type lvm. If you enter the shell ... there is one, obvious. All commands can be taken as in the original article. In the other case - so no lvm shell exists - you will need to use the command format lvm .
To resize execute the following command (for the shell way, refer to the original article).
Execute the command:
lvm lvresize --size 3G /dev/VolGroup00/LogVol00
The endpoint (cilinder) of the partition will change.

9 exit the rescue mode and restart.
This should be the most easy command ...

Tested the procedure on a OEL virtual machine running under VMWare Fusion 3 on an Apple MacBook Pro.

Me.

iSCSI configuration on OEL

Intro

This entry is, or will hopefully become, a resume of a number of articles I read in the course of understanding and configuring iSCSI on Oracle Enterprise Linux (OEL). So ... first the links to different documents I found interesting (hopefully the links remain working)
The section on the configuration will suppose you know iSCSI terminology ... which requires you not to be a novice on this subject ... or having read the documents referred to under the section 'Links' ;-)

Links



Configuration of the iSCSI targets on OEL


Configuration of the iSCSI Initiator on OEL





nfs on enterprice linux - to be continued

This is just a resume from the things I read in some articles and things I experience while applying them.

0. Point Zero
Some considerations are in place.
NFS stands for Network File System, or ... you need a network and you need a filesystem to be shared. This latter is in a certain way a big limitation of the possibilities of NFS. it is not possible to share a subdirectory of a filesystem.

a. Use an nfs share

a.1. verify the portmapper is running
To do this run
rpcinfo -p
The portmapper should be in the list that is returned.

a.2. Mount the share
Just use the mount command telling the type of drive is nfs and the location where to find the share and how the share is called.
$> mount -t nfs :
example:
mount -t nfs mynfsserver:software /remoteshares/software
The location must exist upfront.

To unmount
$> umount

b. Create an nfs share

b.1. define the shares that may be exported
The shares are defined in the /etc/exports file.
Look to this location for information on the possible options.
A very simple example of the file
/Software *.hellings.be(ro)
/Share *.hellings.be(rw,all_squash,anonuid=100,anongid=100)

use exportfs to update the mountd tables.
$> exportfs -rav

b.2. (re)start the nfs server
This depends on how nfs has been installed.
If installed as a service use
service nfs restart

c. Mounting nfs shares at boot time

A line should be added to the fstab file in /etc.
Look in the referenced articles for further details.
It should look something like
: nfs rw 0 0
nfs is the type of filesystem
rw can be elaborated with a lot of other options
0 (this is the number zero) is the dump indicator
0 (again ... zero) is the fsckorder flag.

d. What about permissions on nfs share drives?

Not investigated yet .... sorry ...
The only thing is that you can set a 'replacement' user and group on the level of the nfs-share definition in the /etc/exports file, using the anonuid and anongid options. this in combination with all_in_squash option.

e. References
This is the original article

NFS reference pages
...

vncserver on enterprise linux

In order to have a vnc graphical desktop to your server do the following:

Check if vncserver exists.
If not ... install the package (see other forums)
If installed:

Connect to the unix box as the user that needs to be connected to the linux box via the vncserver.

Step1: init vncfiles for user
Launch the command vncserver.
This will create the required files and config settings in the users home directory.
You will notice the reference of a desktop id, something like :1
Use this referenct to stop the vncserver again by issueing the following command:
vncserver -kill :1

Step2: Enable X for the users remote desktop
Go to the home directory ( simply cd )
Go to the .vnc directory
Edit the file xstartup by uncommenting two lines:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
so that you get
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Save the file.

Step3: Initialise the vnc password
Launch the command vncpasswd.
Enter two times the password.
This will initialise the password for the user via which you will be connecting

Step 4: Start vncserver again
This step is only required if you want to run vnc not as a service but for restricted time periods.
Issue the command vncserver
Look at the reference the vncserver indicates, eg :1 or something like it.
Make a connection by a vncviewer using the host:reference

Step5: configure the service
Connect as root user
Go to the directory /etc/sysconfig
Modify the file vncserver as root user.
Look at the bottom of the file and duplicate the two lines.
In the pasted lines:
  • uncomment them (remove the # character)
  • in the line VNCSERVERS change the myusername by the user under which you created in steps 1 to 3 the config files
  • In the line VNCSERVERARGS remove the option -localhost
    This would prevent you from connecting from an other host.
(Step 6: What if you need different vnc servers with different users)
This step is optional.
Basically this is very easy.
Just perfom Steps 1 to 3 for each unix user you want to make available via vnc.
So
  • connect as the unix user on the box
  • start vncserver, defaulting the vnc-password of that user
  • stop the vncserver
  • go to directory ~/.vnc
  • uncomment the two lines in the xstartup file
The tricky bit is located in the startup script for the vncserver service. (step 5)
The first line should contain a list of the different displays with the corresponding unix users.
The second line should be repeated for every display that you entered in the list of displays in the first line. For each of the displays specific settings can be done.
The next is an example of two displays with two users:

VNCSERVERS="1:oracle 2:defaultuser"
VNCSERVERARGS[1]="-geometry 1200x1024 -nolisten tcp -nohttpd"
VNCSERVERARGS[2]="-geometry 1200x1024 -nolisten tcp -nohttpd"

Step 7: enable automatic startup of vncserver

Vncserver should be started at the multiuser runlevel, ie runlevel 5.

To enable this perform the following command as root user:
    chkconfig --level 5 vncserver on

To verify the setting in the runleve the following command can be used:
         chkconfig --list | grep vnc

Hope this helps
Yours

ULN - Enterprise Linux oracle internal resources

This doc is only intended for Oracle Employees or people having links to the intranet.

Clients should have the correct licensing and/or support contracts through which they can have access to the client update sides. Being an Oracle employee I do not know if the procedure is the same for clients.
But I guess the files to be used and the way of working should be pretty much the same.

In order to update your server to the latest patchsets you should go internally to http://linux.us.oracle.com

A set of rpm's exist that will install the required settings and definitions to update the system.
It is rather simple: download and install the rpm. Via firefox just execute the rpm.
Then you should look into /etc/sysconfig/rhn.
You will find a file called 'sources' which contains different locations for update packages all depending on the version of OEL you are running.
Uncomment the correct yum line by removing the # sign.
Save the file and quit the editor.

Once this has been done, just go to Applications > System Tools > Software Update.
A list will be shown of available updates.
Press the "apply updates" button and wait ...wait ... wait ...