Wednesday, 20 May 2020

Installing Oracle Linux 8.2 on Virtualbox

This posting is part of my Oracle Database Developer VM Project series. The resulting VM is intended to be an Oracle DB developer all-in-one VM. For different purposes, other settings might be more appropriate.

Most IT people won't need a guide to install Linux in a VM and skip this part. But if you are new to this, I will give a very detailed step-by-step guide. The settings I use are often my personal preferences. Though I work for Oracle, these settings are not always the officially Oracle recommended settings.

First download and install Oracle VM VirtualBox from https://www.virtualbox.org/wiki/Downloads. It is important to use Version 6.1.10 or newer, because the older ones don't have support for the OL 8.2, the guest additions won't compile according to the changelog. You will also need the Oracle Linux ISO image, which is available from https://www.oracle.com/linux/technologies/oracle-linux-downloads.html, following the link to 'Oracle Software Delivery Cloud'. This is NOT a guide on licensing, so please work through that information yourself.

Start Virtual Box.

Select Machine/New to start with a new VM.
Give it a name and choose Linux and Oracle (64-Bit)
Choose the amount of RAM you can afford
You will need a virtual hard disk
Go with the default VDI file type
As long as you don't have more storage than you need or this is very performance sensitive for you, Dynamically allocated should be fine.
Especially when you are using dynamically allocated, make it large even if you don't need it now. This is so much easier than grow your volume in the future in case you will need it. And it does not cost space on your device now.
Here you are, ready to go. But we need to adjust some settings first, so click on the Settings cog
Shared Clipboard works well for many versions, so I don't see any reason to not enable these (for GUI VM's of course).
We don't need the good old Floppy Disk. I always disable it, though it probably doesn't hurt either.
Give it the cores you have.
A little more Video Memory is usefull. I don't know, if we really need 64 MB. I had some problems in the past with only 16 MB. If you are short on memory, you might try out 32 MB. 
We really don't need audio, and I recently learned that VBox audio might interfere with a Zoom session in your host OS (thanks Sören). So better disable it.
Leave the default NAT adapter, but click on Adapter 2 to add another one.
I prefer to have an additional Host-only Adapter for easy networking between my host and guest.
The USB Controller also sometimes interferes with my host, so better switch it off.
A shared folder with your host can make your life much easier. I prefer to have it auto mounted in my users home directory.
The user interface often gets in my way, so I disable it. When I need the VBox menu, I switch from full screen to windowed and back.
Now virtually insert the Oracle Linux ISO image. Select the empty disk and Choose a disk file...
Locate the previously downloaded OL ISO image on your HDD and open it.
Your DVD controller should display the mounted ISO image like this. We are done here, click OK to close the settings.
Click Start to boot the VM and start the OL setup.
Install Oracle Linux 8.2.0
Even if you choose to change the keyboard layout on the next page (like I do), I recommend to leave the system in English.
In the installation summary, you can change the keyboard layout if you need.
I use a German keyboard.
Now for the important part, choose Installation Destination.
Select the ATA VBOX HARDDISK, which is your .vdi file. Then choose Storage Configuration / Custom.
Click on Click here to create them automatically, so you don't have to start from scratch.
OL comes up with a proposal, that could use some fine tuning. It prefers the xfs file system, which gave me some trouble in the past. Though it has some advantages when running OL on a real server, for a single user VM, ext4 is the easier one to handle. Also 50 GB is not so much for the root file system and swap also could get a little bigger. As /home has more than enough space, the sizes could be adjusted accordingly.
  So my changed layout is 100 GB for root, 16 GB for swap, leave boot untouched and give the rest to home with home and root formatted with ext4.
Click Done and Accept Changes.
Enough storyboarding, let's shoot something. Click Begin Installation.
While setup is running, let's care about the users. Set the root password to your like, then klick on User Creation.
We need at least one user for Oracle, typically named oracle. Give it a password and click on Advanced...
Leave the home directory, but add the groups dba and oinstall, then Save Changes.
Wait for the installer to complete, then click on Reboot.
If you want to use Oracle Linux, Oracle requires you to accept their license. Click on License Information.
Read this carefully. If you choose to accept the license agreement, continue with the next step.
We are almost done. Click on Finish Configuration to do some post installation stuff.
If you want system updates (I bet you do), register the system.
Not sure why we need to choose the input method again. But if you want something other than a US-keyboard then choose the one you want.
 Nah, we don't need Location Services in our VM ...
... neither do we need any online accounts.
Ready to go sounds good, click the large blue box to start.
Welcome to Oracle Linux 8.2 with the new Redwood Design background. Lovely, isn't it? So much for the basic installation steps.

Next -> Oracle Linux 8.2 on VirtualBox - basic usability settings

Friday, 15 May 2020

The Oracle Database Developer VM Project

There a many options on how to develop with an Oracle Database. By far the smartest way is to use on Oracle Cloud service like the Autonomous Transaction Processing. And it is also free, as you can use the Oracle Free Tier. If you cannot use the Oracle Cloud, you can run the database on your laptop or on your companies servers. And you can install all your tooling also on your laptop, server or you maybe have a VM with all the tooling you need. Just make sure, that you have the required license or go with the Express Edition. See also this post for a great overview on all the options.
I personally prefer, to have everything in one VM. I can still use it while travelling with limited connectivity and I heavily rely on snapshotting my VM (and rolling back when I did something wrong ;-)
If just a running VM with everything is all you need, then read no further. Oracle offers an excellent ready-to-run developer VM with the database, tools and tutorials under
But if you, for any reason, want to build your own VM, be it for your own education or just that you want to set up things differently, then I offer a guide with this series. Most of this series is still based on Oracle 19c, but I optionally offer updated guides for the Oracle Database 23c Free Developer Release where it makes sense. So you can decide to go with the stable release or explore the features of the latest version.

Tuesday, 24 March 2020

How to run Minecraft on Oracle Cloud Infrastructure, the even easier way


There is an Update to this post: Run a free Minecraft Server in the Oracle Cloud (3rd. Update)

---8<-----------------------------------------------------------------------------

This is an update to my older post 'How to run a Minecraft Server in the Oracle Cloud (OCI Update)' which has already been an update to an even older posting covering the older Oracle Cloud Infrastructure Classic (OCI-C). As the OCI is constantly enhancing, I try to keep up describing the easiest way to run your Minecraft server.
Start at the OCI console startpage and choose 'Create a VM instance'.
Give it a name and stick with the defaults.
Scroll down and adjust the shape, if needed. If this is your first project on OCI, you probably don't have a Virtual Cloud Network. The VM wizard will notice this and offers you, to create such. Give it a name and make sure that 'assign a public IP address' is checked.
Do not forget to upload your ssh public key. For the rest, leave the defaults and click 'Create'
You will get a long list of what OCI will do for you. Wait until it shows 'Running' and copy your public IP address.
The next steps are the same as in OCI-C. Set up a ssh connection with your favorite ssh client. I use PuTTY on Windows. Paste the IP adress and save the session.
Enter the Auto-login username 'opc'.
Under Connection/SSH/Auth choose you private key file. Then save again and open your session.
And here we are, hello OCI. Pull the Minecraft server directly from its publisher via (check for the version you prefer)

wget https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar

Install the Java version you want to use, e.g.

sudo yum install java-11-openjdk

Probably this will pull some other updates. Then start the server:

java -jar server.jar

After the first start, the server terminates immediately, because you have to accept the EULA first.
It created a new file eula.txt. Open it in vi and change the content to eula=true.
Before we start the server again, lets open the port in the Linux firewall.

sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --reload

As the Minecraft server has an interactive console, it should be accessible even when the SSH console has been closed in between. I prefer to the screen command for that, which can be installed by.

sudo yum install screen.x86_64

Then open a new screen and start the server with

screen -S minecraft
java -jar server.jar

With the server running, we are done with SSH. Close the screen session via CRTL-A D or just close your PuTTY window. If you want to reconnect to your Minecraft server from a new SSH session, just type

screen -d -r minecraft

Back in the OCI web UI, we also need to configure the firewall rules. From the Server VM page, click on the subnet.

Now our Minecraft server is up and running and the Linux firewall is open, so it could serve requests. But we first need to open the Minecraft port on Linux too, because by default on OCI all ports except for ssh are closed for security reasons.
Back to the OCI console, open the Hamburger menu and to to Networking/Virtual Cloud Networks.
There you shoud find a VCN with the name you gave it when creating the instance. Click on the name to open the settings.
Click on Security Lists on the left under Resources.
Click on the Default Security List to open the settings.
From the Ingress Rules you can see, that any incoming TCP traffic, except for ssh, is blocked. So we need to add a rule for our minecraft server here.
By clicking on 'Add Ingress Rule' we can define our rule for CIDR 0.0.0.0/0 (all internet) and the Minecraft server port 25565.
The rule should be listed under Ingress Rules. Now we are done with the OCI setup.
Start Minecraft and configure a new Server. Give it a name and enter the public IP address of your instance.
Your Oracle Cloud instance will be listed in Minecrafts server list, notice the good ping. Double click to start your game.
Have fun with the Oracle Cloud and Minecraft!

BTW: this tutorial is meant to demonstrate the usage of OCI, not to do a perfect Minecraft setup. There are many tutorials to do this, like this one.

Thursday, 6 June 2019

How to run a Minecraft Server in the Oracle Cloud (OCI Update)


Update: I made a newer and shorter version of this tutorial utilizing new OCI UI features. So please read no further and go to my updated posting under: https://arnes-stuff.blogspot.com/2020/08/run-free-minecraft-server-in-oracle.html

---8<-----------------------------------------------------------------------------

This is an update to my older post 'How to run a Minecraft Server in the Oracle Cloud' covering the older Oracle Cloud Infrastructure Classic (OCI-C). This posting describes how to do the same on the newer Oracle Cloud Infrastructure (OCI).
This time start at the OCI startpage and choose 'Create a virtual cloud network', because we need a VCN first.
For an easy start, select 'Create a virtual cloud network plus related resources', which will give you a complete starter virtual cloud network. Just give it a name, scroll down and confirm.
This will give us a VCN with three subnets in three different availability domains (three physical data centers). This is more than what we need, but as subnets are not charged, it does not hurt either.
Now that we have our networking up and ready, let us move to the compute menu. Click on the hamburger menu and choose Compute|Instances.
There click on 'Create Instance'
You can leave all the defaults. Your VCN should be chosen automatically.
But do not forget to upload your ssh public key.
Wait for your machine to be running, then copy the public IP address.
The next steps are the same as in OCI-C. Set up a ssh connection with your favorite ssh client. I use PuTTY on Windows. Paste the IP adress and save the session.
Enter the Auto-login username 'opc'.

Under Connection/SSH/Auth choose you private key file. Then save again and open your session.

Pull the Minecraft server directly from its publisher via

wget https://launcher.mojang.com/v1/objects/808be3869e2ca6b62378f9f4b33c946621620019/server.jar

Install the Java version you want to use, e.g.

sudo yum install java-1.8.0-openjdk.x86_64

Then start the server:

java -jar minecraft_server.1.9.2.jar

After the first start, the server terminates immediately, because you have to accept the EULA first.
It created a new file eula.txt. Open it in vi and change the content to eula=true.
Before we start the server again, lets open the port in the Linux firewall.

sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --reload

As the Minecraft server has an interactive console, it should be accessible even when the SSH console has been closed in between. I prefer to the screen command for that, which can be installed by.

sudo yum install screen.x86_64

Then open a new screen and start the server with

screen -S minecraft
java -jar server.jar

With the server running, we are done with SSH. Close the screen session via CRTL-A D or just close your PuTTY window. If you want to reconnect to your Minecraft server from a new SSH session, just type

screen -d -r minecraft

Back in the OCI web UI, we also need to configure the firewall rules. From the Server VM page, click on the subnet.
On the subnet page, click on the security lists.
Here, click on the default security list
From the Ingress Rules you can see, that any incoming TCP traffic, except for ssh, is blocked. So we need to add a rule for our minecraft server here.
By clicking on 'Add Ingress Rule' we can define our rule for CIDR 0.0.0.0/0 (all internet) and the Minecraft server port 25565.
The rule should be listed under Ingress Rules. Now we are done with the OCI setup.
Start Minecraft and configure a new Server. Give it a name and enter the public IP address of your instance.
Your Oracle Cloud instance will be listed in Minecrafts server list, notice the good ping. Double click to start your game.
Have fun with the Oracle Cloud and Minecraft!

BTW: this tutorial is meant to demonstrate the usage of OCI, not to do a perfect Minecraft setup. There are many tutorials to do this, like this one.