Thursday, January 10, 2019

Install VirtualBox on MacOS using HomeBrew


I’m fairly new on using MacOS. I’ve been struggling finding shortcuts and keys that I was very comfortable with in Windows. I friend of mine helped me with tips and also mentioned to install HomeBrew in order to install VirtualBox. Here’s a short post on how to do it.

First you need to install Xcode. Xcode is a MacOS development framework application.

$:~ user$ xcode-select --install
xcode-select: note: install requested for command line developer tools


Then, you need to install HomeBrew. This version of HomeBrew doesn’t require to install Cask separately.

$:~ user$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 4894, done.
remote: Counting objects: 100% (4894/4894), done.
remote: Compressing objects: 100% (4697/4697), done.
remote: Total 4894 (delta 52), reused 324 (delta 6), pack-reused 0
Receiving objects: 100% (4894/4894), 4.00 MiB | 372.00 KiB/s, done.
Resolving deltas: 100% (52/52), done.
Tapped 2 commands and 4680 formulae (4,936 files, 12.4MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:

As I previously mentioned, Cask is already included in the HomeBrew installation.
Now, lest try to use HomeBrew to search for the VirtualBox package.


$:~ user$ brew search virtualbox
==> Casks
homebrew/cask-versions/virtualbox-beta
homebrew/cask-versions/virtualbox-extension-pack-beta
homebrew/cask/virtualbox
homebrew/cask/virtualbox-extension-pack


$:~ user$ brew cask info virtualbox
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 4195, done.
remote: Counting objects: 100% (4195/4195), done.
remote: Compressing objects: 100% (4185/4185), done.
remote: Total 4195 (delta 26), reused 915 (delta 7), pack-reused 0
Receiving objects: 100% (4195/4195), 1.33 MiB | 241.00 KiB/s, done.
Resolving deltas: 100% (26/26), done.
Tapped 1 command and 4096 casks (4,205 files, 4.2MB).
virtualbox: 6.0.0,127566
https://www.virtualbox.org/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/virtualbox.rb
==> Name
Oracle VirtualBox
==> Artifacts
VirtualBox.pkg (Pkg)
==> Caveats
To install and/or use virtualbox you may need to enable their kernel extension in

  System Preferences Security & Privacy General

For more information refer to vendor documentation or the Apple Technical Note:

  https://developer.apple.com/library/content/technotes/tn2459/_index.html


Now is time to install VirtualBox.


$:~ user$ brew cask install virtualbox
==> Caveats
To install and/or use virtualbox you may need to enable their kernel extension in

  System Preferences Security & Privacy General

For more information refer to vendor documentation or the Apple Technical Note:

  https://developer.apple.com/library/content/technotes/tn2459/_index.html

==> Satisfying dependencies
==> Downloading https://download.virtualbox.org/virtualbox/6.0.0/VirtualBox-6.0.
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'virtualbox'.
==> Installing Cask virtualbox
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
Password:
installer: Package name is Oracle VM VirtualBox
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
==> Purging files for version 6.0.0,127566 of Cask virtualbox



Error: Failure while executing; `/usr/bin/sudo -E -- env LOGNAME=user USER=user USERNAME=user /usr/sbin/installer -pkg /usr/local/Caskroom/virtualbox/6.0.0,127566/VirtualBox.pkg -target /` exited with 1. Here's the output:
installer: Package name is Oracle VM VirtualBox
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)

Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/system_command.rb:107:in `assert_success'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:50:in `run!'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:27:in `run'
/usr/local/Homebrew/Library/Homebrew/system_command.rb:31:in `run!'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:59:in `block in run_installer'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:65:in `with_choices_file'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:52:in `run_installer'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/pkg.rb:32:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:209:in `block in install_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:200:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:95:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:21:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:88:in `<main>'
$:~ user$


As you can see, my installation failed. This is due to a new MacOS Sierra feature that prevents to load external libraries. I had to follow the instructions in below note:


Now that I have approved the extension let’s execute the install again.

$:~ user$ brew cask install --force virtualbox
==> Caveats
To install and/or use virtualbox you may need to enable their kernel extension in

  System Preferences Security & Privacy General

For more information refer to vendor documentation or the Apple Technical Note:

  https://developer.apple.com/library/content/technotes/tn2459/_index.html

==> Satisfying dependencies
==> Downloading https://download.virtualbox.org/virtualbox/6.0.0/VirtualBox-6.0.
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/c68cfddc9133da5c221557cd77b23f34e0b513dc380e6b010dc36b3d0eb2df45--VirtualBox-6.0.0-127566-OSX.dmg
==> Verifying SHA-256 checksum for Cask 'virtualbox'.
==> Installing Cask virtualbox
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
installer: Package name is Oracle VM VirtualBox
installer: Installing at base path /
installer: The install was successful.
virtualbox was successfully installed!


Now, just use spotlight search to find the VirtualBox application.

Hope this helps.
Alfredo

Friday, January 4, 2019

OEM 13c - AMP EBS Discovery Error Due To Lack Of Privileges


We recently had to enable monitoring for an EBS 11i system using the Application Management Pack. Even though the EM_MONITOR user was already provisioned by the EBS patch, the discovery was failing due to lack of privileges on several FND tables.

My Oracle Support shows several bugs related to missing privileges like the one below, but I wasn’t able to find one for 11i.

Patch 21951154: 1OFF:12.2.0: READ ACCESS NOT PRESENT FROM EM_MONITOR USER FOR FOLLOWING TABLES

I decided to manually track the missing privileges on these tables and here's the list I found in order to make the discovery work.

GRANT SELECT ON "APPLSYS"."AD_APPL_TOPS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."AD_FIXED_ISSUES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."AD_PATCH_DRIVER_LANGS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."AD_PATCH_RUNS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."AD_PATCH_RUN_BUGS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."FND_LOG_EXCEPTIONS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."FND_LOG_UNIQUE_EXCEPTIONS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."FND_NODES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."FND_PROFILE_OPTIONS_TL" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPLSYS"."FND_USER" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "APPS"."HR_OPERATING_UNITS" TO "EM_OAM_MONITOR_ROLE";
GRANT EXECUTE ON "APPS"."JTF_DIAG_DEPENDENCIES" TO "EM_OAM_MONITOR_ROLE";
GRANT EXECUTE ON "APPS"."JTF_DIAG_INPUTS" TO "EM_OAM_MONITOR_ROLE";
GRANT EXECUTE ON "APPS"."JTF_DIAG_INPUTTBL" TO "EM_OAM_MONITOR_ROLE";
GRANT EXECUTE ON "APPS"."JTF_DIAG_VERSION" TO "EM_OAM_MONITOR_ROLE";
GRANT EXECUTE ON "APPS"."JTF_DIAG_VERSION_NT" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."ALL_IND_COLUMNS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."ALL_OBJECTS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."ALL_QUEUES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."ALL_TRIGGERS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_DATA_FILES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_OBJECTS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_PROCEDURES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_SOURCE" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_TAB_PRIVS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_TEMP_FILES" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_USERS" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."DBA_USERS_WITH_DEFPWD" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."GV_$INSTANCE" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."GV_$LOGFILE" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."GV_$SESSION" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."V_$INSTANCE" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."V_$THREAD" TO "EM_OAM_MONITOR_ROLE";
GRANT SELECT ON "SYS"."V_$VERSION" TO "EM_OAM_MONITOR_ROLE";

Hope this helps to your discovery.

Thanks,
Alfredo