X

Step Up to Modern Cloud Development

Announcing the Oracle Vagrant boxes GitHub repository

Gerald Venzl
Senior Principal Product Manager

Today we are pleased to announce the launch of a new GitHub repository to build Oracle software Vagrant boxes: https://github.com/oracle/vagrant-boxes

Vagrant provides an easy and fully automated way of setting up a developer environment. In conjunction with Oracle’s VirtualBox, Vagrant is a powerful tool for creating a sandbox environment inside a virtual machine. With this announcement, we introduce this powerful automation to users worldwide as a streamlined way for creating virtual machines with Oracle software fully configured and ready to go inside of them. This is yet another in a series of steps for making the lives of developers easier and more productive.

Getting started is quick and easy! If you have not done so yet, you will need to download and install the following:

Once you have installed those two components you can go ahead and clone/download the GitHub repository and create your own Vagrant boxes. Getting an Oracle Linux virtual machine is as simple as follows:

  1. Clone (or download) the GitHub repository:

gvenzl-mac:vagrant gvenzl$ git clone https://github.com/oracle/vagrant-boxes
Cloning into 'vagrant-boxes'...
remote: Counting objects: 74, done.
remote: Total 74 (delta 0), reused 0 (delta 0), pack-reused 74
Unpacking objects: 100% (74/74), done.

  1. Go into the the OracleLinux sub folder:

gvenzl-mac:vagrant gvenzl$ cd vagrant-boxes/OracleLinux/

  1. Type “vagrant up” and wait for your VM to be provisioned:

gvenzl-mac:OracleLinux gvenzl$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'http://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'http://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box' (v0) for provider: virtualbox
    default: Downloading: http://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box
==> default: Successfully added box 'http://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box' (v0) for 'virtualbox'!
==> default: Importing base box 'http://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: ol7-vagrant
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2220 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
...
...
...
==> default: INSTALLER: Locale set
==> default: INSTALLER: Installation complete, Oracle Linux ready to use!

Once the machine is provisioned you are all set and ready to go. You can now just simply ssh into the virtual machine by typing “vagrant ssh” and perform whatever tasks you would like to do. Once you are done, just type “exit” just like any other ssh terminal:

gvenzl-mac:OracleLinux gvenzl$ vagrant ssh

Welcome to Oracle Linux Server release 7.4 (GNU/Linux 4.1.12-112.14.13.el7uek.x86_64)

The Oracle Linux End-User License Agreement can be viewed here:

* /usr/share/eula/eula.en_US

For additional packages, updates, documentation and community help, see:

* http://yum.oracle.com/

[vagrant@ol7-vagrant ~]$ uname -a
Linux ol7-vagrant 4.1.12-112.14.13.el7uek.x86_64 #2 SMP Thu Jan 18 11:38:29 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@ol7-vagrant ~]$ exit
logout
Connection to 127.0.0.1 closed.
gvenzl-mac:OracleLinux gvenzl$

You can stop the virtual machine and reboot it any time by typing “vagrant halt” and “vagrant up”:

gvenzl-mac:OracleLinux gvenzl$ vagrant halt
==> default: Attempting graceful shutdown of VM...


gvenzl-mac:OracleLinux gvenzl$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2220 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.30 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Mounting shared folders...
default: /vagrant => /Users/gvenzl/Downloads/vagrant/vagrant-boxes/OracleLinux
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
gvenzl-mac:OracleLinux gvenzl$

Last, if you would like to remove the VM altogether from your machine, you can do so by typing “vagrant destroy”. This will remove the entire VM and everything within it, so be careful with this command:

gvenzl-mac:OracleLinux gvenzl$ vagrant destroy
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...

Going forward, Oracle will bring more and more Vagrant configuration files to this GitHub repository, which is driven in a fully open source fashion. Please provide comments and enhancement requests via the GitHub issues.

Also check out this cool video by Sergio Leunissen showing you how to setup a Docker sandbox using Oracle VM VirtualBox and Vagrant:

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha

Recent Content

Oracle

Integrated Cloud Applications & Platform Services