Installation of Oracle Linux 5.8 on Virtual Box 4.1 with Guest Additions
Today I wanted to install
Oracle Linux on virtual box, which I need for some testing systems. Since the
installation and especially the setup of the guest additions were not as smooth
as I expected, I decided to share the information.
InstallingOracleLinux58.pdf (1.5 MByte)
******************************************************************************************
This is the text-only preview. Please open the PDF file for full formatting and pictures.
******************************************************************************************
1 Contents
Installation of Oracle Linux 5.8 on Virtual Box with Guest Additions 1
1 Contents 1
2 Installation of Oracle Linux 5.8 on Virtual Box 1
2.1 Download of Oracle Linux Release 5 Update 8 for x86_64 (64 Bit) 1
2.2 Networking 2
2.3 Linux Installation 2
2.4 Installation of Guest Additions 4
2.4.1 Update Linux with Yum 4
2.4.2 Updating the System 7
2.4.3 Fixing the Compile Error 7
2.4.4 Summary of Guest Additions Installation Commands 9
2.4.5 Shared Folder Configuration 9
3 Conclusion 10
2 Installation of Oracle Linux 5.8 on Virtual Box
There are many occasions in which we could need an installation of virtual box. I was investigating a high-availability configuration of some fusion middleware elements and needed to span a Weblogic cluster across two machines. Once we have installed and configured one machine in virtual box, we can easily multiply it by cloning.
In this workshop we show how to install Oracle Linux 5.8 on Virtual Box 4.1.16 running on a 64-bit Windows 7 Host machine. We will start from the download of the media and go through the installation process. We will also install the guest additions and configure shared folder.
2.1 Download of Oracle Linux Release 5 Update 8 for x86_64 (64 Bit)
We download the iso image for the installation from the following location:
Link https://edelivery.oracle.com/EPD/Download/process_download/V31120-01.iso
File D:\01Downloads\V31120-01.iso
MD5 1ec844c1090a417b741a9bf0d6dea240 (matches website)
Notes Digest Website https://edelivery.oracle.com/EPD/ViewDigest/get_form?epack_part_number=B66657-01, Norton Ok.
2.2 Networking
To begin with, we want to consider the network configuration of the virtual box. There is an article that gives a very good overview of the VBox networking options. We choose Host-Only networking, thus multiple virtual machines can talk to each other on an internal network and the host can also participate here.
2.3 Linux Installation
We setup a new virtual machine for Linux 64-bit systems. We configure an 8 GByte volume, 3 CPUs and 4 GByte of RAM. We setup a network interfaces with “host-only” networking. We mount the downloaded iso image and start the new machine.
We go through the installation using the default setting except for some choices like keyboard layout, location etc.
The installation screens are given below.
Table 1. Installation Screens of the Oracle Linux 5 Setup.
We provide the following user/password combinations.
root welcome1
oracle welcome1
2.4 Installation of Guest Additions
In the next step we install the guest additions, which are documented in the virtual box manual. This involves updating the system to compile and integrate a kernel module.
We have to deviate from the manual considerably as shown below.
2.4.1 Update Linux with Yum
We need access to the update server on the internet. Therefore we shutdown Linux, and set up a second network interface with “NAT” networking and start again. We can use the installed Firefox browser to see if the internet is working.
Since our user oracle is not in the sudoer’s file list, we simply run the installation as root.
We open a terminal (Menu->Application->Accessories->Terminal) to update the system with yum. We run the following commands.
--------------------------------------
Setting up NAT for Internet Access and reboot.
--------------------------------------
[oracle@localhost ~]$ su
Password:
[root@localhost oracle]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Update Process
No Packages marked for Update
[root@localhost oracle]# yum install gcc
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
No package gcc available.
Nothing to do
[root@localhost oracle]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
[root@localhost yum.repos.d]# wget http://public-yum.oracle.com/public-yum-el5.repo
--2012-07-25 13:08:01-- http://public-yum.oracle.com/public-yum-el5.repo
Resolving public-yum.oracle.com... 141.146.44.34
Connecting to public-yum.oracle.com|141.146.44.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3974 (3.9K) [text/plain]
Saving to: `public-yum-el5.repo'
100%[======================================>] 3,974 --.-K/s in 0s
2012-07-25 13:08:02 (144 MB/s) - `public-yum-el5.repo' saved [3974/3974]
[root@localhost yum.repos.d]# ls
public-yum-el5.repo
[root@localhost yum.repos.d]# yum install gcc
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
el5_latest | 1.1 kB 00:00
el5_latest/primary | 10 MB 00:25
el5_latest 9256/9256
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.1.2-52.el5_8.1 set to be updated
--> Processing Dependency: cpp = 4.1.2-52.el5_8.1 for package: gcc
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
--> Processing Dependency: libgcc >= 4.1.2-52.el5_8.1 for package: gcc
--> Running transaction check
---> Package cpp.x86_64 0:4.1.2-52.el5_8.1 set to be updated
---> Package glibc-devel.x86_64 0:2.5-81.el5_8.4 set to be updated
--> Processing Dependency: glibc-headers = 2.5-81.el5_8.4 for package: glibc-devel
--> Processing Dependency: glibc = 2.5-81.el5_8.4 for package: glibc-devel
--> Processing Dependency: glibc-headers for package: glibc-devel
---> Package libgcc.i386 0:4.1.2-52.el5_8.1 set to be updated
---> Package libgcc.x86_64 0:4.1.2-52.el5_8.1 set to be updated
--> Running transaction check
--> Processing Dependency: glibc = 2.5-81 for package: nscd
---> Package glibc.i686 0:2.5-81.el5_8.4 set to be updated
--> Processing Dependency: glibc-common = 2.5-81.el5_8.4 for package: glibc
---> Package glibc.x86_64 0:2.5-81.el5_8.4 set to be updated
---> Package glibc-headers.x86_64 0:2.5-81.el5_8.4 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
--> Processing Dependency: kernel-headers for package: glibc-headers
--> Running transaction check
---> Package glibc-common.x86_64 0:2.5-81.el5_8.4 set to be updated
---> Package kernel-headers.x86_64 0:2.6.18-308.11.1.0.1.el5 set to be updated
---> Package nscd.x86_64 0:2.5-81.el5_8.4 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
gcc x86_64 4.1.2-52.el5_8.1 el5_latest 5.3 M
Installing for dependencies:
glibc-devel x86_64 2.5-81.el5_8.4 el5_latest 2.4 M
glibc-headers x86_64 2.5-81.el5_8.4 el5_latest 597 k
kernel-headers x86_64 2.6.18-308.11.1.0.1.el5 el5_latest 1.4 M
Updating for dependencies:
cpp x86_64 4.1.2-52.el5_8.1 el5_latest 2.9 M
glibc i686 2.5-81.el5_8.4 el5_latest 5.3 M
glibc x86_64 2.5-81.el5_8.4 el5_latest 4.8 M
glibc-common x86_64 2.5-81.el5_8.4 el5_latest 16 M
libgcc i386 4.1.2-52.el5_8.1 el5_latest 97 k
libgcc x86_64 4.1.2-52.el5_8.1 el5_latest 99 k
nscd x86_64 2.5-81.el5_8.4 el5_latest 172 k
Transaction Summary
================================================================================
Install 4 Package(s)
Upgrade 7 Package(s)
Total download size: 40 M
Is this ok [y/N]: y
Downloading Packages:
(1/11): libgcc-4.1.2-52.el5_8.1.i386.rpm | 97 kB 00:00
(2/11): libgcc-4.1.2-52.el5_8.1.x86_64.rpm | 99 kB 00:00
(3/11): nscd-2.5-81.el5_8.4.x86_64.rpm | 172 kB 00:00
(4/11): glibc-headers-2.5-81.el5_8.4.x86_64.rpm | 597 kB 00:01
(5/11): kernel-headers-2.6.18-308.11.1.0.1.el5.x86_64.rp | 1.4 MB 00:03
(6/11): glibc-devel-2.5-81.el5_8.4.x86_64.rpm | 2.4 MB 00:05
(7/11): cpp-4.1.2-52.el5_8.1.x86_64.rpm | 2.9 MB 00:06
(8/11): glibc-2.5-81.el5_8.4.x86_64.rpm | 4.8 MB 00:10
(9/11): gcc-4.1.2-52.el5_8.1.x86_64.rpm | 5.3 MB 00:12
(10/11): glibc-2.5-81.el5_8.4.i686.rpm | 5.3 MB 00:12
(11/11): glibc-common-2.5-81.el5_8.4.x86_64.rpm | 16 MB 00:41
--------------------------------------------------------------------------------
Total 411 kB/s | 40 MB 01:38
warning: rpmts_HdrFromFdno: Header V4 DSA signature: NOKEY, key ID 1e5e0159
el5_latest/gpgkey | 1.4 kB 00:00
Importing GPG key 0x1E5E0159 "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>" from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libgcc 1/18
Updating : libgcc 2/18
Updating : glibc-common 3/18
Updating : glibc 4/18
Updating : cpp 5/18
Installing : kernel-headers 6/18
Updating : nscd 7/18
Installing : glibc-headers 8/18
Installing : glibc-devel 9/18
Updating : glibc 10/18
Installing : gcc 11/18
Cleanup : glibc 12/18
Cleanup : cpp 13/18
Cleanup : libgcc 14/18
Cleanup : nscd 15/18
Cleanup : libgcc 16/18
Cleanup : glibc-common 17/18
Cleanup : glibc 18/18
Installed:
gcc.x86_64 0:4.1.2-52.el5_8.1
Dependency Installed:
glibc-devel.x86_64 0:2.5-81.el5_8.4
glibc-headers.x86_64 0:2.5-81.el5_8.4
kernel-headers.x86_64 0:2.6.18-308.11.1.0.1.el5
Dependency Updated:
cpp.x86_64 0:4.1.2-52.el5_8.1 glibc.i686 0:2.5-81.el5_8.4
glibc.x86_64 0:2.5-81.el5_8.4 glibc-common.x86_64 0:2.5-81.el5_8.4
libgcc.i386 0:4.1.2-52.el5_8.1 libgcc.x86_64 0:4.1.2-52.el5_8.1
nscd.x86_64 0:2.5-81.el5_8.4
Complete!
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum install kernel-devel
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-devel.x86_64 0:2.6.18-308.11.1.0.1.el5 set to be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel-devel x86_64 2.6.18-308.11.1.0.1.el5 el5_latest 5.7 M
Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 5.7 M
Is this ok [y/N]: y
Downloading Packages:
kernel-devel-2.6.18-308.11.1.0.1.el5.x86_64.rpm | 5.7 MB 00:13
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-devel 1/1
Installed:
kernel-devel.x86_64 0:2.6.18-308.11.1.0.1.el5
Complete!
--------------------------------------------------------------
Installing the Guest Additions via the virtual box tools menu.
Thhis will mount the volume with the guest addtions.
--------------------------------------------------------------
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# cd /media/
.hal-mtab VBOXADDITIONS_4.1.16_78094/
.hal-mtab-lock
[root@localhost yum.repos.d]# cd /media/VBOXADDITIONS_4.1.16_78094/
[root@localhost VBOXADDITIONS_4.1.16_78094]# ls
32Bit runasroot.sh VBoxWindowsAdditions.exe
64Bit VBoxLinuxAdditions.run VBoxWindowsAdditions-x86.exe
AUTORUN.INF VBoxSolarisAdditions.pkg
autorun.sh VBoxWindowsAdditions-amd64.exe
[root@localhost VBOXADDITIONS_4.1.16_78094]# cd 64Bit
[root@localhost 64Bit]# ls
Readme.txt
[root@localhost 64Bit]# cat Readme.txt
Oracle VM VirtualBox Guest Additions
Where have the Windows drivers gone?
- The Windows Guest Additions drivers were removed from this directory to
save space on your hard drive. To get the files you have to extract them
from the Windows Guest Additions installers:
To extract the 32-bit drivers to "C:\Drivers", do the following:
VBoxWindowsAdditions-x86 /extract /D=C:\Drivers
For the 64-bit drivers:
VBoxWindowsAdditions-amd64 /extract /D=C:\Drivers
Note: The extraction routine will create an additional sub directory
with the selected architecture (x86 or amd64) to prevent mixing up
the drivers.
To get further help with the command line parameters of the installer,
type: VBoxWindowsAdditions-<arch> /?
[root@localhost 64Bit]# cd ..
[root@localhost VBOXADDITIONS_4.1.16_78094]# ls
32Bit runasroot.sh VBoxWindowsAdditions.exe
64Bit VBoxLinuxAdditions.run VBoxWindowsAdditions-x86.exe
AUTORUN.INF VBoxSolarisAdditions.pkg
autorun.sh VBoxWindowsAdditions-amd64.exe
[root@localhost VBOXADDITIONS_4.1.16_78094]# sh ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.16 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-uek-devel-2.6.32-300.10.1.el5uek
Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org 7.1 modules [ OK ]
Setting up the Window System to use the Guest Additions [ OK ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services componen[ OK ]
[root@localhost VBOXADDITIONS_4.1.16_78094]#
2.4.2 Updating the System
The guest additions are installed now, but since there was a compilation error, we reboot Linux, update the system and go through the yum-process again. After reboot, the systems package updater indicates that there are updates, displaying the update icon in the toolbar. We can also check manually for updates by calling Menu->Application->System Tools->Software Updater. The following figures show the Update menu and the Update dialog.
Figure 1. Updating Linux using the System Update Tool.
The process took about ten minutes. After that we reboot and go through the installation process for the guest additions again. It turns out that the necessary packages were not contained in the update but at least we have all the current packages now.
2.4.3 Fixing the Compile Error
We run yum again but still need to install some packages to fix the compilation error.
--------------------------------Reboot after System Update
[oracle@localhost ~]$ su
Password:
[root@localhost oracle]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
[root@localhost oracle]# yum install gcc
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Package gcc-4.1.2-52.el5_8.1.x86_64 already installed and latest version
Nothing to do
[root@localhost oracle]# yum install kernel-devel
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Package kernel-devel-2.6.18-308.11.1.0.1.el5.x86_64 already installed and latest version
Nothing to do
[root@localhost oracle]# cd /media/
[root@localhost media]# dir
VBOXADDITIONS_4.1.16_78094
[root@localhost media]# cd VBOXADDITIONS_4.1.16_78094/
[root@localhost VBOXADDITIONS_4.1.16_78094]# dir
32Bit runasroot.sh VBoxWindowsAdditions.exe
64Bit VBoxLinuxAdditions.run VBoxWindowsAdditions-x86.exe
AUTORUN.INF VBoxSolarisAdditions.pkg
autorun.sh VBoxWindowsAdditions-amd64.exe
[root@localhost VBOXADDITIONS_4.1.16_78094]# sh ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.16 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.16 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-uek-devel-2.6.32-300.32.1.el5uek
Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org 7.1 modules [ OK ]
Setting up the Window System to use the Guest Additions [ OK ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services componen[ OK ]
[root@localhost VBOXADDITIONS_4.1.16_78094]# yum install kernel-uek-devel-2.6.32-300.32.1.el5uek
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-uek-devel.x86_64 0:2.6.32-300.32.1.el5uek set to be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel-uek-devel x86_64 2.6.32-300.32.1.el5uek el5_latest 6.8 M
Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 6.8 M
Is this ok [y/N]: y
Downloading Packages:
kernel-uek-devel-2.6.32-300.32.1.el5uek.x86_64.rpm | 6.8 MB 00:16
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-uek-devel 1/1
Installed:
kernel-uek-devel.x86_64 0:2.6.32-300.32.1.el5uek
Complete!
[root@localhost VBOXADDITIONS_4.1.16_78094]# sh ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.16 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.1.16 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules [ OK ]
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Building the OpenGL support module [ OK ]
Doing non-kernel setup of the Guest Additions [ OK ]
Starting the VirtualBox Guest Additions [ OK ]
Installing the Window System drivers
Installing X.Org 7.1 modules [ OK ]
Setting up the Window System to use the Guest Additions [ OK ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services componen[ OK ]
[root@localhost VBOXADDITIONS_4.1.16_78094]#
The linux system is now up and running.
2.4.4 Summary of Guest Additions Installation Commands
To sum up the necessary steps we have to add a NAT configuration for internet access and run the following commands:
su
cd /etc/yum.repos.d/
wget http://public-yum.oracle.com/public-yum-el5.repo
yum update
yum install gcc
yum install kernel-uek-devel-2.6.32-300.32.1.el5uek
cd /media/VBOXADDITIONS_4.1.16_78094/
sh ./VBoxLinuxAdditions.run
Table 2. Summary of commands to install the guest additions.
2.4.5 Shared Folder Configuration
Now we want to configure shared folder to be mounted on startup. We use the dialog from virtual box (Toos->Shared folders) as illustrated in the figure below.
Figure 2. Configuring a shared folder for the linux vbox guest.
We choose a folder from the host system and select automatic mount and permanent folder.
We have to add the user oracle to the group vboxsf to access the shared folder from linux. We use the graphical interface which is available at Menu->System->Administration->User and Groups. After login in again, we can access the shared folder at /media/sf_01SharedFolder.
3 Conclusion
We demonstrated the installation of Oracle Linux 5.8 in a virtual box. We briefly discussed the network configuration and illustrated the graphical installation process by displaying the installation screens. We showed how to update the system with yum and how to install the guest additions. Finally we demonstrated the configuration of shared folders.
The resulting virtual machine contains current updates and can be used as a template to clone additional virtual machines for e.g. test environments.
Keine Kommentare:
Kommentar veröffentlichen