Install Oracle Linux 7 on VirtualBox
This article describes step by step process of setting up Oracle Linux 7 on Oracle VirtualBox. This is the exactly same method we use every-time when we have to create a VM and practice Oracle.
Oracle Linux 7 Installation Steps
Note: This method applies to all OEL 6 and OEL 7 versions! This is also one of the fastest ways to create a Linux VM.
Download Oracle Linux 7.7
Go to edelivery.oracle.com and search for Oracle Linux. Check for the correct version that you would like to download and only download the ISO file.
Note: You must only download the .iso file and it will be only one single file
Create Virtual Machine
Start virtual-box and click on New to create a new virtual machine.
Give a meaningful name to your VM. I will give it as OEL_7.7_Test and select machine type as Linux. Make sure you select version as Oracle 7.
Default select 4GB RAM, in special cases, you might have to give more RAM to VM. Check your machine requirements before. Example: if you installing Oracle Enterprise Manager, then you need minimum 10 GB RAM allocated to machine.
Create a virtual Hard Disk of 120GB size. This is more than enough for almost all types of practicing on a virtual machine.
Edit Virtual Machine Settings
Under VM settings >> System >> uncheck floppy
Under storage >> Controller IDE >> Select Empty Disk >> Under Optical Drive (right size) >> click on CD icon >> browse the OEL 7.7 iso file
Under Network >> change NAT to Bridged Adapter
Click on OK and start VM
Define Linux IP Address
Open command prompt on your windows machine and type below command
You need to find the network adapter with which you are connected to internet. In general, if you are connected via Wi-Fi, then check network IP under Wireless LAN Adapter and if you are connected via LAN, then check network IP under LAN Adapter.
All the general hope IP addresses will start with 192.168.X.X or 10.10.10.X.
In my case, below are the IP details from my windows machine
IPV4 Address: 192.168.0.10 Subnet Mask: 255.255.255.0 Gateway Address: 192.168.0.1
Using the above details, I plan to assign below IP address details to my virtual machine
IPV4 Address: 192.168.0.171 --> I just changed 1o to 171 Subnet Mask: 255.255.255.0 --> No change Gateway Address: 192.168.0.1 --> No change DNS Server: 220.127.116.11 --> Google IP address
Note: use IP addresses as per your windows IP address details, do not copy mine as it might now work in your system
Install Oracle Linux
Now that we have VM ready and IP address defined, let us start installing OEL 7.7
Start the virtual machine
One the installer screen >> Select English as default language >> click on Continue
You will be on Installation Summary Screen
Installation source must be Local media
Software selection must be Minimal install
Click on Installation Destination
Select option “I will configure partitioning” and click on done
Change LVM to Standard Partition
Click on “+” button >> Mount point: /boot >> Size: 512M >> Add mount point
Click on “+” button >> Mount point: swap >> Size: 20G >> Add mount point
Click on “+” button >> Mount point: / >> Size: leave blank >> Add mount point
Click on Done and click on Accept Changes
Click on Kdump >> uncheck Enable Kdump >> Done
Click on Network & Hostname
Give hostname as test.dbagenesis.com & click on Apply
Under Ethernet options, click Configure
General Tab >> check Automatically connect to this network when available
Goto IPV4 Settings Tab
Change Method from Automatic to Manual
Click on Add >> give IP addresses as defined in previous step
Give subnet mask, gateway ip and DNS server ip as 18.104.22.168
Click on Save
Click on Done
Click on Begin Installation
OEL 7.7 installation has started. Click on Root Password >> give a root user password and click on done.
Note: No need to create a new user under user creation option
Wait for installation to complete and you will be prompted to reboot the machine.
Post Installation Steps
Once the installation is done, I like to do couple of things just to make sure the machine runs smooth for all lab practices.
Edit the /etc/hosts file and put the IP address, hostname and a short name inside the file. Here is my machine /etc/hosts content that I added to last line of the file >> save and close
192.168.0.171 test.dbagenesis.com test
Note: make sure to add your VM ip address and hostname to the last line of the /etc/hosts file. Also, do not delete the existing lines inside the file.
In real-time, firewall is taken care by network team but for your practice, disable it so that it does not create any trouble while practicing Oracle. As root user, issue below commands
service firewalld stop
Permanently disable firewall so it does not come up from next startup
systemctl disable firewalld
Below command will disable SELinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
Take VM Snapshot
It's a good idea to take VM snapshot so that in case while practicing Oracle, if you make any mistake, you can roll back to this point with one simple click.
Stop the VM >> Goto Snapshots >> Click on Take >> give snapshot name as Fresh OEL Install >> click on OK
Done! your VM is ready and you can start playing with it!