Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Vagrant - Trying to install Oracle 19c on Oracle Linux 8 VM - On Windows 11 host machine

user-y00bwOct 4 2023

Hi,

I am trying to test oracle database VM on my home computer. I am getting the following error:

Here is my setup information:

Host machine OS: running Windows 11 64 bit / home edition

Oracle Virtual Box version: 7.0.10

vagrant version: 2.3.7_windows_amd64

VM machine OS: Oracle Linux 8

https://yum.oracle.com/boxes/oraclelinux/ol8/OL8U8_x86_64-vagrant-virtualbox-b485.box

Oracle database version: 19c

https://download.oracle.com/otn/linux/oracle19c/190000/LINUX.X64_193000_db_home.zip?AuthParam=1696291219_0a5ac89b6466133fe92ff4eac5ae70b4

vagrantfile content:

#
# LICENSE UPL 1.0
#
# Copyright (c) 2018, 2020 Oracle and/or its affiliates.
#
# Since: July, 2018
# Author: gerald.venzl@oracle.com
# Description: Creates an Oracle database Vagrant virtual machine.
# Optional plugins:
#     vagrant-env (use .env files for configuration)
#     vagrant-proxyconf (if you don't have direct access to the Internet)
#         see https://github.com/tmatilai/vagrant-proxyconf for configuration
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

# Box metadata location and box name
BOX_URL = "OL8U8_x86_64-vagrant-virtualbox-b485.box"
BOX_NAME = "oraclelinux/8"

# UI object for printing information
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")

# Define constants
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # Use vagrant-env plugin if available
  if Vagrant.has_plugin?("vagrant-env")
    config.env.load(".env.local", ".env") # enable the plugin
  end

  # VM name
  VM_NAME = default_s('VM_NAME', 'oracle-19c-vagrant')

  # Memory for the VM (in MB, 2300 MB is ~2.25 GB)
  VM_MEMORY = default_i('VM_MEMORY', 4096)

  # VM time zone
  # If not specified, will be set to match host time zone (if possible)
  VM_SYSTEM_TIMEZONE = default_s('VM_SYSTEM_TIMEZONE', host_tz)

  # Oracle base directory
  VM_ORACLE_BASE = default_s('VM_ORACLE_BASE', '/opt/oracle')

  # Oracle home directory
  VM_ORACLE_HOME = default_s('VM_ORACLE_HOME', '/opt/oracle/product/19c/dbhome_1')

  # Oracle SID
  VM_ORACLE_SID = default_s('VM_ORACLE_SID', 'ORCLCDB')

  # PDB name
  VM_ORACLE_PDB = default_s('VM_ORACLE_PDB', 'ORCLPDB1')

  # Database character set
  VM_ORACLE_CHARACTERSET = default_s('VM_ORACLE_CHARACTERSET', 'AL32UTF8')

  # Oracle Database edition
  # Valid values are 'EE' for Enterprise Edition or 'SE2' for Standard Edition 2
  VM_ORACLE_EDITION = default_s('VM_ORACLE_EDITION', 'EE')

  # Listener port
  VM_LISTENER_PORT = default_i('VM_LISTENER_PORT', 1521)

  # EM Express port
  VM_EM_EXPRESS_PORT = default_i('VM_EM_EXPRESS_PORT', 5500)

  # Oracle Database password for SYS, SYSTEM and PDBADMIN accounts
  # If left blank, the password will be generated automatically
  VM_ORACLE_PWD = default_s('VM_ORACLE_PWD', '')
end

# Convenience methods
def default_s(key, default)
  ENV[key] && ! ENV[key].empty? ? ENV[key] : default
end

def default_i(key, default)
  default_s(key, default).to_i
end

def host_tz
  # get host time zone for setting VM time zone
  # if host time zone isn't an integer hour offset from GMT, fall back to UTC
  offset_sec = Time.now.gmt_offset
  if (offset_sec % (60 * 60)) == 0
    offset_hr = ((offset_sec / 60) / 60)
    timezone_suffix = offset_hr >= 0 ? "-#{offset_hr.to_s}" : "+#{(-offset_hr).to_s}"
    'Etc/GMT' + timezone_suffix
  else
    'UTC'
  end
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = BOX_NAME
  config.vm.box_url = BOX_URL
  config.vm.define VM_NAME

  # Provider-specific configuration
  config.vm.provider "virtualbox" do |v|
    v.memory = VM_MEMORY
    v.name = VM_NAME
  end
  config.vm.provider :libvirt do |v|
    v.memory = VM_MEMORY
  end

  # add proxy configuration from host env - optional
  if Vagrant.has_plugin?("vagrant-proxyconf")
    ui.info "Getting Proxy Configuration from Host..."
    has_proxy = false
    ["http_proxy", "HTTP_PROXY"].each do |proxy_var|
      if proxy = ENV[proxy_var]
        ui.info "HTTP proxy: " + proxy
        config.proxy.http = proxy
        has_proxy = true
        break
      end
    end

    ["https_proxy", "HTTPS_PROXY"].each do |proxy_var|
      if proxy = ENV[proxy_var]
        ui.info "HTTPS proxy: " + proxy
        config.proxy.https = proxy
        has_proxy = true
        break
      end
    end

    if has_proxy
      # Only consider no_proxy if we have proxies defined.
      no_proxy = ""
      ["no_proxy", "NO_PROXY"].each do |proxy_var|
        if ENV[proxy_var]
          no_proxy = ENV[proxy_var]
          ui.info "No proxy: " + no_proxy
          no_proxy += ","
          break
        end
      end
      config.proxy.no_proxy = no_proxy + "localhost,127.0.0.1"
    end
  else
    ["http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY"].each do |proxy_var|
      if ENV[proxy_var]
        ui.warn 'To enable proxies in your VM, install the vagrant-proxyconf plugin'
        break
      end
    end
  end

  # VM hostname
  config.vm.hostname = VM_NAME

  # Oracle port forwarding
  config.vm.network "forwarded_port", guest: VM_LISTENER_PORT, host: VM_LISTENER_PORT
  config.vm.network "forwarded_port", guest: VM_EM_EXPRESS_PORT, host: VM_EM_EXPRESS_PORT

  # Provision everything on the first run
  config.vm.provision "shell", path: "scripts/install.sh", env:
    {
       "SYSTEM_TIMEZONE"     => VM_SYSTEM_TIMEZONE,
       "ORACLE_BASE"         => VM_ORACLE_BASE,
       "ORACLE_HOME"         => VM_ORACLE_HOME,
       "ORACLE_SID"          => VM_ORACLE_SID,
       "ORACLE_PDB"          => VM_ORACLE_PDB,
       "ORACLE_CHARACTERSET" => VM_ORACLE_CHARACTERSET,
       "ORACLE_EDITION"      => VM_ORACLE_EDITION,
       "LISTENER_PORT"       => VM_LISTENER_PORT,
       "EM_EXPRESS_PORT"     => VM_EM_EXPRESS_PORT,
       "ORACLE_PWD"          => VM_ORACLE_PWD
    }

end

Your assistant is heighly appreciated.

Best,

Anas

Comments
Post Details
Added on Oct 4 2023
0 comments
1,400 views