Tuesday, 9 June 2020

Oracle Linux 8.2 on VirtualBox - Guest Additions & basic usability settings

This posting is part of my Oracle Database Developer VM Project series. In the last episode, we did a clean installation of Oracle Linux 8.2 on VirtualBox.
In this episode, I will list my personal preferred settings. As always, these are my personal preferences and not necessary the official Oracle recommended settings.
As we need to do some configuration stuff that requires root privileges, start with putting the oracle user into the sudoers group. Fire up a console, become root and give add the oracle user to the wheel group that has the sudoers privilege:

[oracle@localhost ~]$ su -
Password:
[root@localhost ~]$ usermod -aG wheel oracle
[root@localhost ~]$ logout
[oracle@localhost ~]$

As the new group setting won't be effective until the next login, logout of your Gnome environment
Login as oracle again and double check if you are now in the sudoers group. Run the groups command, it should return oracle wheel dba oinstall.
As we are now member of the sudoers, the very first thing I always do is to make sure, that your system is up to date. Having the latest updates installed increases the chance of running seamlessly on VirtualBox a lot. So first run a

sudo yum check-update

And I regularly run into this problem:
Though the network adapters are enabled in VirtualBox, they are disabled in OL by default.
So switch on both network adapters.
As you probably don't want to do this after every reboot, click on Wired Settings below each adapter and check Connect automatically (This could also be done when running the installer, but I usually forget this). Now re-run the sudo yum check-update.
And here we are.
Continue with a yum update to install the listed package updates. Now it is time to get some more comfort by installing the VirtualBox Guest Additions. After successful patching the system, reboot to continue.
For installing the VirtualBox Guest Additions, we need the kernel headers and make. After login, run

dnf install kernel-uek-devel
dnf install make

and you will have the required package.
Important: make sure that you are running VirtualBox 6.1.10 or newer, because there is an issue with the Guest Additions of older versions and OL 8.2. After booting, go to the VirtualBox Devices menu and choose 'Insert Guest Additions CD image...', follow the instructions and reboot.
After reboot, you should be able to enjoy all the comfort from the Guest Additions, so you can move the mouse out of the VBox-Window, Copy&Paste between Host and Guest OS and resize your desktop.
To give the oracle user access to shared file systems, add him to the vboxsf group by editing /etc/group. Log out and in again to make this change active.
Try it with a ls to wherever you mounted your externe folder to, in my case ~oracle/ddrive.
As this is just my development VM with no sensitive data, I prefer to auto-login my oracle user on startup. This can be configured by editing /etc/gdm/custom.conf and adding the following lines

[daemon]
AutomaticLoginEnable = true
AutomaticLogin = oracle

After the next reboot, you should automatically be logged in as oracle.
Same is for the screen lock. As my host OS already locks the screen, I have no need to double that functionality in my VM. It can be disabled in Settings|Privacy|Screen Lock.
If you change your proxy settings regularly, eg. if you sometimes work from a company network and sometimes from a public one, then go to the Software Manager and search and install the Gnome Extension Proxy Switcher. It lets you easily change your settings from the network menu.

This is a matter of taste. I don't like Gnome and the missing window minimize and maximize buttons could lead to clutter on your desktop. But these can be brought back.

sudo dnf install gnome-tweak-tool

Install Gnome Tweaks.

Start it, navigate to the Windows section and re-enable them.

I prefer to have one more extension. Even with screen lock switched off, Gnome 3 comes with something like a screensaver called screen shield, showing your background and a clock. To disable that, another extension is needed.
It can be downloaded from Gnome Extensions under https://extensions.gnome.org/extension/672/disable-screen-shield/. To install it from the browser, first install the plugin mentioned on that page and reload it. Then directly enable the extension from your browser.
Now under Extensions I prefer to enable Applications MenuDesktop Icons, Disable screen shield and Window List. This is much closer to the older Gnome versions like in Oracle Linux 7.x and more usable IMHO.

I would also recommend to get a better file manager. I personally prefer Double Commander, get it from SuSE OpenBuild service at https://software.opensuse.org/download.html?project=home%3AAlexx2000&package=doublecmd-gtk.
The EPEL-Repository contains several tools that are not recommended for production usage. So it is not installed by default, but handy for a developer environment. Install it via dnf ...

dnf in oracle-epel-release-el8.x86_64

 and test it with installing htop from the EPEL repository:

dnf in htop

Run htop and it should look like this
By default, Python 3 is installed, but not configure to run. Enable Python 3 with the following:

/usr/sbin/alternatives --config python

So much about my basic usability settings for the DB Developer VM.

Next --> Preparing the Linux VM for Oracle DB installation