Installing Guest Additions for Oracle Linux
In this article, I am going to discuss Installing Guest Additions for Oracle Linux. Please read our previous article where we discussed Creating a Virtual Machine in Virtual Box and Installing Linux. This is our fourth step toward the Oracle Installation.
Installing Guest Additions for Oracle Linux
We have installed oracle Linux previously but now you can see the size of the screen is very small. We cannot copy the data from my original computer to Linux virtual machine. If you go to the terminal and select any text and copy the text and you cannot paste that text into your computer document. Now to overcome this we need to install Guest Additions.
Now we have an interesting topic called guest additions. The guest additions is a nice additional feature like resizing the screen, copying and pasting from Linux to our computer and shared folder. Below are the steps to installing guest additions.
The first step is to disable the security. To disable security open the terminal.
After opening the terminal, you will always be connected to the user that you have logged in to. You need to connect to the root user if you need to make any changes to the operating system. Please login to root by giving the following command. su root – this is a prompt for a password please enter the password. In the below image you can see root@oracletest which means now root has been logged in now.
If you need to make the security turn off you need to open the config file by the below commands. In the below command you can see vi is a default text editor for Linux and /etc/selinux/ are the folders and the config is the file that we need to modify. Press enter and it will open the config file.
Below is the config file. You can use your arrow buttons (up, down, left, right) to navigate in the vi editor (Mouse is not accessible). Go until the SELINUX=enforcing line as the below-highlighted line.
Now you are in the SELINUX line. Press the ESC button on your keyboard and press A to edit the file. After pressing A then the bottom of the page you can see it will be converted to INSERT as below.
Then change the enforcing to disabled for SELINUX setup. Now you might get a question about why we are doing this. We are doing this because in a real-time production environment we are not supposed to do this. But we are doing this because we are training and if the SELINUX is enforcing then there will be some problems installing the guest additions, oracle database and we may miss many features. But in the real-time environment, we will not change this setting.
After changing the setting, we need to save the file. So for saving the file we press esc button and then type Shift+colon ( : ) and then wq (write and quit) and then press enter. The bottom of the screen will appear as below and the file will be saved. And you will return back to the terminal.
After this, we will get back to our terminal. In order to make these changes effective, we need to reboot our Linux machine. Once the reboot is done we will follow other steps.
After reboot is done log in again and follows the below steps to install guest additions. Go to devices in the Virtual box toolbar and select insert guest additions.
Then there will be a popup in the Linux machine as below. Click Run. It will ask for a password because of the user that you have logged in as the administrator as well.
After clicking run a screen appears showing the progress of the installation of guest additions as you can see below. You need to wait for a few minutes as it will install a few packages and modules.
At the bottom, you can see Press Return to close this window. You can press enter and this terminal will be closed. Even though you install the guest additions the copy and paste between the machine and the computer don’t work until you restart the entire machine. So please restart the machine.
After restarting the machine, once you open the machine Go to View and click on Full-Screen Mode. Like below and you will get a popup as below.
Once you click on full-screen mode then you will see a small popup as below. Select switch and you will get full-screen mode. You can use the shortcut as well as mentioned below.
After logging into the Linux machine, now try to copy from the machine to your computer as below. Open the terminal and copy the terminal text [jaya@oracletest].
After selecting copy go to your computer and open a notepad or else any word document and right click and click paste you will be able to paste the text that is present in the Linux machine.
Creating Shared Folder
We have installed the guest additions till now. Now we need to add a shared folder between the Linux machine and the computer. The first thing reboots your virtual box and then opens virtual box oracle 19c and click and settings and open shared folder settings as below.
On the right side, there is a small symbol where you can add a shared folder (shown in the below image). Please click on the symbol.
Once you click on the Add new shared folder you will receive a popup stating to choose a location of the shared folder.
If you select other you will another popup to choose the file location. I have selected the E:\Oracle\Shared folder\ path. You can choose any of your locations on any other drive. That folder would be considered a path for the shared folder.
Click on the select folder after you selected the path. Then you will return back to the virtual box showing the below popup and select the Auto-mount option and click ok to save the shared folder and click on the shared folder setting as well.
After clicking ok go ahead and start your Linux machine and login into your machine. Once you logged in to the machine click on Activities and open files and you can see the shared folder below.
You can see the Shared folder is present in the Files. But if you click on a shared folder it will ask for the authentication password of the user). Jaya is a user who has administrator and root access. This user can easily access this folder by entering the password. But we will not follow this process.
We are going to follow the below process. Open the terminal and we will connect to the root user. So, after connecting to the root, we will provide access to the shared folder for the user jaya by using the below command. The below command indicates usermod- modification of user and access to vboxsf (virtual box shared folder) shared to the user jaya. ( -a -G) we will discuss further Linux basic commands.
After entering the command in order to apply these changes you need to reboot your Linux machine. You can reboot the machine as below.
After rebooting the machine login again and try to access to the shared folder you will be able to access this shared folder this time without any password as you have complete access to the shared folder.
Now you can use this shared folder to share any documents or files between your virtual machine and your computer.
In the next article, I am going to discuss Basic Linux Commands. Here, in this article, I try to explain Installing Guest Additions for Oracle Linux and I hope you enjoy this Installing Guest Addition for Oracle Linux article.
About the Author: Pranaya Rout
Pranaya Rout has published more than 3,000 articles in his 11-year career. Pranaya Rout has very good experience with Microsoft Technologies, Including C#, VB, ASP.NET MVC, ASP.NET Web API, EF, EF Core, ADO.NET, LINQ, SQL Server, MYSQL, Oracle, ASP.NET Core, Cloud Computing, Microservices, Design Patterns and still learning new technologies.