Hello, and welcome to today's video presentation on creating a Linux virtual machine using
VirtualBox 6.1 on Oracle Linux 8.
This video will focus on installing the latest Oracle Linux 8, at the time of this recording,
into a VirtualBox VM using both the graphical interface and command-line.
So let us get started.
This demo uses a pre-installed Oracle Linux 8 physical system with VirtualBox 6.1.
If using VirtualBox installed on a compute instance of Oracle Cloud Infrastructure, there
will be differences in the desktop environment navigation steps depending on whether using
Oracle Linux 7 or Oracle Linux 8.
First, open the Virtual Box graphical interface by clicking Activities in the upper left corner
of the screen.
Next, use the search text field to find and open the VirtualBox application by starting
to type its name.
Click the Oracle VM VirtualBox icon.
Once the Oracle VM VirtualBox Manager opens, click the round blue New icon.
Since this will be an Oracle Linux 8.2 VM, ensure you have the ISO file staged somewhere
on the system where the user performing the installation has access.
For this demo, the staged file is in the user's home directory.
After clicking the New icon, the Create Virtual Machine dialog box will appear.
Provide the name ol8-test-vbox for the VM in the Name field.
Keep the default Machine Folder location, which is /home/oracle/VirtualBox VMs in this
environment.
Change the Type list-of-values to Linux and the Version list-of-values to Oracle (64-bit).
Click the Next button.
Next, adjust the slider or type the amount of memory to be allocated to the value of
2048 and click the Next button.
Use the Create a virtual hard disk now option and click the Create button.
Use the default option of VDI (VirtualBox Disk Image) and click the Next button.
For Storage on the physical hard disk, select Dynamically allocated.
Using dynamically allocated, the VM only uses space on your physical disk as the VM fills
up.
Click the Next button.
Use the default location and disk name provided in the dialog window.
Adjust the slider or type the virtual hard disk's size to allocate the capacity to 20.00
GB and then click the Create button.
Now scroll through and view the Settings summary.
Next, make a few recommended settings changes from the defaults based on your environment.
To make those changes, click the orangish-yellow Settings gear icon in the panel above the
summary.
First, navigate on the left and click System.
Under the Motherboard tab and Pointing Device list-of-values, change the value to USB Tablet.
This change helps avoid mouse pointer issues in some environments, such as when using VNC
to connect to the VirtualBox host.
When using VNC, the VM mouse cursor might become out of sync with the physical mouse
cursor.
Next, if running a graphical desktop environment within the VM, increase the Video Memory to
the max value possible.
Navigate on the left and click Display.
Adjust the slider or type in the value for Video Memory to the max setting of 128 MB.
Next, navigate on the left and click Network.
By default, VirtualBox assigns a NAT-based network to Adapter 1.
A NAT-based network is beneficial if running the VM behind a VPN and only concerned that
the VM has network access.
If wanting to access the VM from the same network as the host without port forwarding,
change the setting "Attached to" for Adapter 1 to Bridged Adapter.
If you want more information about the different network settings, check out the VirtualBox
documentation.
For this demo, leave the Adapter 1 attached to NAT.
Click OK to close the VM Settings dialog.
With the Settings complete, click the green Start arrow icon.
As the VM performs the initial boot, it recognizes the need for an installable media.
Click the folder/arrow icon to the right, which opens the Optical Disk Selector dialog.
As there are no media files currently in the list, click the Add icon.
Navigate in the file dialog to the location where you previously staged the Oracle Linux
8 ISO file.
For this demo, the file is in the user's home directory.
Double-click the file to select it.
Highlight the ISO file in the Selector dialog and click the Choose button.
From the Select start-up disk dialog, click the Start button.
The VM will boot and load the installation/boot screen.
Shortly after boot, VirtualBox will display a few notifications regarding the capture
of the keyboard and mouse.
To disable these notifications, click the comment icon in the notification panel with
a blue slash.
Now click in the VM [Running] window.
The first time performing this action will display a dialog about how the VM captures
the mouse.
The dialog also provides information on how to release the capture of the mouse and return
control to the host machine.
Click the Capture button to confirm giving mouse control to the VM.
Proceed and complete the installation.
As the installation takes a while to complete, we will fast forward to the end.
If there are questions on how to complete the installation of Oracle Linux 8, check
out our existing videos at oracle.com/goto/oraclelinuxlearning.
When the installation is complete, click the Reboot button.
The VM will reboot.
Once the VM boots, approve the license agreement and finalize any OS initialization steps after
logging into the VM.
That completes the Linux guest VM installation using the VirtualBox graphical interface.
Now, install another VM using the VirtualBox command-line.
Open a terminal.
The benefit of using the VirtualBox command-line is using VirtualBox in a headless environment.
First, change your directory to the VirtualBox default directory by typing cd "/home/oracle/VirtualBox
VMs"/.
Using this directory helps keep all VM files located in the VirtualBox default folder.
Make a new folder based on the name for the new VM.
In this demo, type mkdir ol8-test-cli and then cd into that directory.
Next, create a 20GB "dynamic" disk by typing the command on the screen and hit Enter.
[ silence while typing vboxmanage createmedium --filename ol8-test-cli.vdi --size 20480 ]
The displayed output indicates the Medium created.
Next, get a list of the OS types recognized by VirtualBox.
To narrow the output and display only the ID for os types related to Oracle, type vboxmanage
list ostypes | grep -i oracle | grep -i id.
The output displays the Oracle (32-bit) and Oracle (64-bit) IDs.
Next, create the VM by typing the command on the screen and hit Enter.
[ silence while typing vboxmanage createvm --name "ol8-test-cli" --ostype "Oracle_64"
--register ]
The output displays the virtual machine created successfully, the VM UUID, and the VM settings
file location.
With the VM created, next, add a SATA controller with the dynamic disk attached.
Type the commands on the screen and hit Enter after each one.
[ silence while typing vboxmanage storagectl ol8-test-cli --name "SATA Controller" --add
sata --controller IntelAHCI ]
[ silence while typing vboxmanage storageattach ol8-test-cli --storagectl "SATA Controller"
--port 0 --device 0 --type hdd --medium 'ol8-test-cli.vdi' ]
Next, add an IDE controller with a DVD attached and the installation ISO inserted into the
drive by typing the commands shown on the screen.
Hit Enter after each command.
[silence while typing vboxmanage storagectl ol8-test-cli --name "IDE Controller" --add
ide ]
[silence while typing vboxmanage storageattach ol8-test-cli --storagectl "IDE Controller"
--port 0 --device 0 --type dvddrive --medium path_to_the_staged_Oracle_Linux_8_ISO_file
]
Wrap the path to the ISO file in single quotes if the path contains spaces.
Lastly, add these additional settings based on changes made during the graphical interface
install.
Enable IO APIC by typing vboxmanage modifyvm ol8-test-cli --ioapic on.
Next, set the mouse pointer to USB Tablet, VM system memory to 2048 GB, and the Video
Memory to 128 MB.
Type vboxmanage modifyvm ol8-test-cli --mouse usbtablet --memory 2048 --vram 128.
If running the network using a Bridged Adapter, type the command shown on the screen.
[ silence while showing callout vboxmanage modifyvm ol8-test-cli --nic1 bridged --bridgeadapter1
br0 ]
The adapter br0 in the command shown is the bridge network for the physical NIC on the
host system.
Once making all these changes, start the VM by typing vboxmanage startvm ol8-test-cli.
The VM will boot and is ready to finish the OS installation.
That completes this demo of creating a Linux VM using the VirtualBox graphical interface
and the command-line.
More details are available in the VirtualBox documentation.
Thank you for watching this video and enjoy using VirtualBox on Oracle Linux 8.
Please check our additional information on Oracle Linux 8 in the Oracle Linux 8 Documentation
or Oracle Linux Learning Library.