Saturday, September 21, 2019

Free Oracle Cloud: 6. Create a VM Instance (Compute Cloud)

This post is part of a series of blog posts on the Best and Cheapest Oracle APEX hosting: Free Oracle Cloud.

In this post we will setup a virtual machine with Oracle Linux. If you need a machine in the Cloud, this service is for you... and you can't beat the price, it's FREE!

So why would you need a machine in the Cloud? For anything that you do on your own machine, you can do on your machine in the cloud. You can work with co-workers on the same app, test applications, host some PHP app or Wordpress blog or you name it. You have a full Oracle Linux machine where you can do whatever you want.

So lets get started to setup this machine, but first lets do one step on our own machine, as it's a pre-requisite to get started: create an SSH key pair. In the link you find how you create a keypair on Windows, Linux and OSX. You can see your SSH key pair as a more secure way to enter your machine in the cloud than a username/password.

As I'm on OSX here's the command I use:

ssh-keygen -t rsa -N "" -b 2048 -C "oraclecloud2019" -f oraclecloud2019


This will generate two files:


Now you are all set to setup your VM instance in the Oracle Cloud.

When you login to your Oracle Cloud account, select the Create a VM instance:


Give your instance a name:


When you scroll down, you see the section where you have to upload the SSH key file with the name .pub:


Hit the Create button and you are done... You will see the orange icon on the left stating it's being orange provisioned:


Once the provisioning is done the icon on the left will turn green and it's ready to be used:


In case you don't want to wait for the provisioning, you can always come back later by clicking the left top hamburger icon, and in the Compute section click on Instances:


You will get an overview of your instances, see the status and go to the details from there:


Now if you want to connect to your VM in the Oracle Cloud you can use Putty (Windows) or SSH (Linux, OSX). The command looks like this:

ssh -i ssh_key opc@public_ip

The OPC user is the one you use to connect to an Oracle Compute (VM) Instance.

In the following screenshot you see me connecting to my Oracle Cloud VM (for security reasons I used another ssh key, normally it would have been oraclecloud2019 but as I exposed that with my screenshot I setup another one):


There you go, now you have a full system running in the Cloud. In the next post we will setup a webserver on this machine and configure a custom domain.

13 comments:

Carsten Cerny said...

Too much reception. "Out of host capacity.". :-(

mos said...

alas keeps raising out of host capacity

Carsten Cerny said...

Oracle increased the capacity. This morning I could activate my VM.

mos said...

right. it seems fine now.

Bhavin Adhvaryu said...

Hi Dimitri,

Many thanks for your blog.

My VM has been created successfully but how can I connect to my Oracle Cloud VM using PuTTy?

Could you please add few screenshots?

PS: When I opened PuTTy I don't see anything.

Bhavik Bhatti said...

Hi Bhavin,
You can connect VM through Putty on your windows machine by following the instructions mentioned in the below link:

Connect to a Cloud VM on Windows with PuTTY - Oracle

Anonymous said...

Hi Dimitri,

Thanks for blogging about this topic.

My VM was created successfully but my "Public IP Address" is listed as "Unavailable" and I an unable to cannot connect via Putty. Do know how I can obtain the IP?

Dimitri Gielis said...

I've only seen that during provisioning.
Maybe wait a bit longer and see if the IP address comes?

Dimitri

Dimitri Gielis said...

Actually, I just created another VM and now I could reproduce your issue.
After successful provisioning of the instance, the public ip is not there.

BUT, as my first VM has a public IP I logged in to that. From there I can connect to the other VMs as they are in the same subnet.
So connecting to the internal ip 10.0.0.x works.

Hope that helps,
Dimitri

Gaspar said...

I noticed a glitch (bug?), when I first accessed the page to build a VM the Public IP switch was there but didn't really work.. So I terminated that VM and tried to recreate a new one.
From that point onwards the Public IP did not show anymore.. So now what you need to do is create a Virtual Cloud Network (Under Networking) to help you setup follow this link: https://fuzziebrain.com/content/id/1904/ And check out the networking section.
Note: the CIDR that Adrian chose to use will not necessarily work on your cloud region. Accept the default (something like 10.0.0.16/16 or whatever value shows) and you'll be good.

After you create your network the Public IP switch will re-appear when you build a VM (consistently).

This is essentially the same setup as in Amazon.

Good luck

Greg G said...

I had the same problem as Gaspar -- the Public IP Address was "Unavailable" after creating the instance. Here's the solution I found:

1. From your Instance, select "Attached VNICs". Select your instance.
2. Select "IP Addresses". Choose "Edit"
3. Under Public IP Addresses I changed this from "No Public IP" to "Reserved Public IP".

Dimitri Gielis said...

Actually, I found that Oracle changed the default to not assign a public IP, BUT you can change it when you create the instance.
Click on Show Shape, Network and Storage Options when you create and you can say to assign a public IP.

Carsten Cerny said...

Hi Dimi,

I created a Oracle Linux VM in my Frankfurt/Germany instance.

How could I change the time(zone), that the Database (Apex) shows me the right time.

At the moment (08:14 in the morning) the "select sysdate from dual" shows me "09.10.19 06:14" in the SQL Developer. Minus 2 hours.

Best,
Carsten