On a previous post, we did check the way to download oracle linux 6 dvd
Now that you got the iso image, let's create a virtualbox guest and create our first Oracle Linux 6 guest.
Downloading Virtual Box
The good friends of Oracle Linux have been working in create hand ons lab for Oracle Linux.
You can check the wiki here
They start from the basic that is download the Virtual Box and end with some cool hand on guided tasks, it worth have a look.
Download virtualbox, is quite easy, go to Virtualbox download page and download the software and Expansion pack.
Download the software for your platform and install first the VirtualBox part, and then the Expansion pack.
When you execute virtual box for the first time, you should see a window similar to this:
Virtualbox provide a very powerful networking component for our virtual machines
there are 5 network types for virtual guests
This means the virtual nic is not connected to any particular network.
This is the Network Address Translation, the same kind of network that you are familiar in your home with a router for internet that give you those private address 192.168.x.x
This type is very useful when you want to work from the console of the virtual machine and you require the guest having access to the network or internet and you don't require the virtual machine having his own ip in the network.
The virtual guest will take an ip like 10.2.0.15 and you can't reach from your computer or from any computer from the network.
This type of networking is the most easy to use.
You choose to bridge the virtual nic to one nic on your physical host, and will behave like any computer on the network.
This is, if there is an dhcp server on the network, the virtual guest will take an IP from the network, and you will be able to ssh or connect to any application running on the virtual guest, plus the guest will have access to the network as any other machine.
Keep in mind if you need to set up a proxy to reach internet, you will have to do the same on the virtual guest in order to get to internet.
This type of network is like connecting the virtual guest to a switch that is not connected to any other device or network.
You will end with the virtual guest connected to the virtual switch, and will be isolated.
This type of network is very useful when you need to connect 2 or more virtual guest in a isolated network, example, Oracle RAC, 2 nodes with private interconnect
This type of network is similar to the Internal Network, but the host machine (the real computer) will be able to connect and work with the virtual guests.
This type of network also allow create the network on the host, set up the ip you want to use, and will enable dhcp, so the guest will take an IP automatically.
From the settings of virtual box, go to network
Then click on the + sign
This will create a network called vboxnet0 with some default settings
- Address 192.168.56.1 (this is the IP that will be assigned to the physical host)
- Netmask 255.255.255.0
- DHCP disabled
Double click on the network, or select and click on the screwdriver, and you will be able to change the parameters or enable the DHCP for the guest
More about virtualbox networking
Each virtualguest can have 4 virtual nics from the gui, but you always can add more from the command line
A typical setup when you want the guest connected to the network at your home or office will be
virtual nic 1, type Bridge
A setup where you don't need the guest to be avaliable to the network will be
virtual nic 1, type NAT
A setup where you want to have the guest be able to access the network, but need some portability, example a virtual guest in a laptop, will be
virtual nic 1, type NAT virtual nic 2, type Bridge when the phyiscal host is connected to a network if you are on the the go, like a demo, use Host Only
With this setup, the IP on the virtual nic 1, eth0 will be always the same, so you won't run in troubles or won't have to edit /etc/hosts each time you change network.
A more complex but real setup, will be for example an Oracle RAC in virtual box
virtual nic 1, type Bridge virtual nic 2, type Internal Network (interconnect 1) virtual nic 3, type Internal Network (interconnect 2)
If you are on the go, you can change nic 1 to Host Only, as the guest will be with fixed IP, the virtual machines will be reachable between them.
Creating the first virtual machine
- On the main window of virtual box, you can click on NEW, and this will lead us to create the first virtual guest
Or go to the menu machine, and then new
- Write a name and Select the OS
- Set memory size
- Hard drive
If you are creating a virtual machine for an existing virtual hard drive select existing, otherwise, select new
- Hard disk format
You can choose between several formats
VDI from virtual box works just fine, and allow you increase the size of the disk, like when you expand a lun.
- Storage on physical hard drive
Here you can choose between dynamic or fixed assigned
Dynamic will create an small disk, and will grow as you use more space on the virtual disk Fixed will create the disk immediately of the size you assign.
Dynamic have the advantage you can make the disk to grow. Fixed is supposed to be a bit faster as will avoid defragmentation the disk.
In my personal case, I always go as Dynamic, because my virtual machines have a very short life span.
Here, there is no magic formula.
If you are confortable managing separate disks, like in the real world, you can setup a disk for just the OS.
Depending on how much memory and how much you will need, the size will change.
For just the OS, and 4GB of Swap, you can go with 16GB disk.
For having say Oracle grid and Oracle database binaries installed, make the disk 32GB minimun.
If you want to have a database on disk, add more disk, but you should go with separate disk for datafiles with asm.
If you don't want to use ASM, you should either way use a separate disk for the datafiles (and another for FRA and archivelogs)
Review of the normal setup of the new guest
Now the virtual guest have been created, is time to check few options, like CPU and Network.
Right click on the machine, then Settings will open the settings page
Systems - Motherboard
Here you will be able to change some options like you were interacting at motherboard level
You can adjust the amount of memory here
Systems - Processor
Here you will be able to change some options like the number of processors/core
On storage, you will see what looks like the controllers on a real computer/server
The first controller, is IDE, for a CD-ROM/DVD
The second controller, is SATA, for the virtual hard disk
You can select the virtual hard disk, and see the size and how much is being used at the moment
You can also select an ssd option, and tell virtualbox the disk is on ssd.
On the network options, you have the chance to modify the default value of 1 nic as NAT.
For this particular machine, as I am home, I will use Bridge to the wifi of the mac
Review the configuration
Now the machine have been setup, and we change some values from the default options, you can check on the side panel an overview of the machine
Starting the virtual machine
Select the virtual machine, right click and start
or, Select the virtual machine, then the green arrow on the menu
or, double click on the virtual machine
all this options will start our virtual machine
Now the virtual machine is one, you should see an error that the machine doesn't have an OS installed
If you just create a virtual machine, and go straight to start, it will open a dialog box to mount a DVD to install the OS.
On the Devices menu, Select CD/DVD, Choose CD/DVD and browse for the OS you want to use
Now the virtual DVD iso is on the virtual DVD, reboot the machine.
This can be done, selecting the virtual machine on virtual box, right click and reset
Now you should see the welcome window for the OS install, in our case, Oracle Linux 6.3