Update: Oracle has released 10g for macOS. Here’s a third-party guide to installing it.

Oracle still hasn’t come out with a current version of their database for the Mac. If you need to work with an Oracle database and need a local copy for development this is a problem. Luckily it’s one that can be solved using VMWare Fusion 2.0. We’ll install Oracle XE on Linux. From a developer’s perspective Oracle XE is virtually equivalent to a full Oracle install.

Oracle XE runs very well inside Linux. And Ubuntu makes a Linux edition tailored for virtual machines. It’s called JeOS (“Juice”). Using JeOS you can build a fully functional Oracle virtual machine that is light on resources. This is a fairly simple process but does require command line interaction.

The first step is to obtain JeOS. It’s fairly small, about 100MB, and the current edition can be found here http://cdimage.ubuntu.com/cdimage/jeos/releases/8.04/release/jeos-8.04.1-jeos-i386.iso. Download the ISO file.

It’s always a good idea to verify ISOs. Bring up the MD5 page here http://cdimage.ubuntu.com/jeos/releases/8.04/release/MD5SUMS, then run this command in a terminal:

md5 jeos-8.04.1-jeos-i386.iso

The MD5 signatures (the part that looks like ‘238c620a4ae97004d3dd8f28bf188ecd’) should match.

Next we’ll create the virtual machine.

  • Start up VMWare Fusion and click on the New button.
  • Click on the ‘Continue without disk’ button.
  • On the next screen choose the ‘Use operating system installation disk image file’ option.
  • A file selection will open. Navigate to the ISO file you just downloaded and choose it.
  • Click the ‘Continue’ button.
  • On the next screen choose ‘Linux’ as the operating system and ‘Ubuntu’ as the version. They may already be selected.
  • Click the ‘Continue’ button.
  • On the next screen, UNSELECT the ‘Use Easy Install’ checkbox. Easy install will just make things confusing.
  • Click the ‘Continue’ button.
  • You can customize the settings here if you like, or wait until the install is completed - make sure the virtual machine has access to the Internet though, don’t set it to Host only networking. I would suggest waiting until the end to make changes. When finished, click the ‘Finish’ button.
  • A file selection box will open in the VMWare virtual machine directory, this is where you name your virtual machine. Give the virtual machine any name you like, e.g., ‘JeOS Oracle’.

VMWare will startup the install process. You’ll very quickly see the initial installation screen for JeOS. On the locale selection screen press Enter to select the English language and press Enter again to select the ‘Install Ubuntu JeOS’ menu item. Ubuntu JeOS will start the install. Press Enter to take the defaults. When asked whether you wish to detect the keyboard, say NO. Just keep taking the defaults and the installer will start copying files into the virtual machine.

After the initial install it will ask for a host name. Choose whatever you like, e.g., ‘oracle’. Select your timezone. When you get to the ‘Partition disks’ page, STOP. The Oracle XE install is very simple but has one hard requirement, that the swap partition be at least twice as large as the memory size. The default partition doesn’t meet that requirement. So we’ll do a manual partition.

  • Use the arrow keys and select the ‘Manual’ menu item. Press Enter.
  • On the next screen use the arrow keys and select the ‘SCSI3’ menu item. Press Enter.
  • Answer Yes to the ‘Create new empty partition table on this device’ and press Enter.
  • On the next screen use the arrow keys and select the ‘pri/log 21.5 GB FREE SPACE’ menu item and press Enter.
  • Press Enter on the next screen to ‘Create a new partition’.
  • Change the ‘21.5 GB’ to ‘20 GB’ and press Enter.
  • On the next screen press Enter to make it a Primary partition.
  • On the next screen press Enter to locate it at the ‘Beginning’ of the partition.
  • A screen will be displayed showing the partition details. Use the arrow keys to move to the ‘Done setting up the partition’ option. Press Enter.
  • On the partitions screen use the arrow keys to select the ‘pri/log 1.5 GB FREE SPACE’ item. Press Enter.
  • Choose ‘Create a new partition’ and press Enter.
  • Accept the default of ‘1.5 GB’ and press Enter.
  • Make it a ‘Primary’ partition and press Enter.
  • On the partition details screen use the arrow keys to choose the ‘Ext3 journaling file system’ entry and press Enter.
  • On the next screen choose ‘swap area’ and press Enter.
  • Select ‘Done setting up the partition’ and press Enter.
  • Select ‘Finish partitioning and write changes to disk’ and press Enter.
  • On the following screen tell it to write the changes to disk by selecting ‘Yes’ and then press Enter.

That was the hardest part. The rest is very straightforward.

JeOS will now copy lots of packages from the ISO. Eventually it will ask for the full name of the system administrator (not the userid, the actual name). Use whatever you like, e.g., ‘user’. Then it will ask for the userid you would like to use and then for the initial password. It will ask if you have an HTTP proxy in your network - enter the appropriate information for your network or just press Enter if you’re not sure. JeOS will attempt to access the Ubuntu online package repository. If this fails, you have the HTTP proxy setup incorrectly or don’t have Internet access. The rest of the installation won’t work if the virtual machine can’t access the Internet.

Eventually it will ask you if the system time clock is set to UTC. You’re running on a Mac, so the answer is ‘Yes’. Just press Enter.

Now it’s time to reboot the virtual machine. Press Enter to select ‘Continue’ on the ‘Installation complete’ screen. It will reboot and fairly quickly you’ll see the ‘login:’ prompt. Enter the userid and password you gave during the installation.

The first thing we’ll do is bring all of the JeOS packages up to date. Enter the following at the command line.

sudo apt-get update && sudo apt-get dist-upgrade

This will contact the Ubuntu package repository and churn for a while, eventually providing you with a list of packages to install. Press Enter at the ‘Do you want to continue [Y/n]’ prompt. The packages will be downloaded and installed. Next we’ll reboot just in case we updated the kernel. Enter this at the command line:

sudo shutdown -r now

That does a shutdown and reboot (-r). Login again when prompted.

Next we’ll install the pre-requisites for the VMWare Tool installation. Enter the following at the command line. Press Enter if prompted for a Yes/No.

sudo aptitude install build-essential linux-headers-$(uname -r)
sudo aptitude install psmisc
sudo aptitude install wget

Next we’ll install the VMWare Tools to make the virtual machine work more efficiently and smoothly. In the VMWare Fusion menu, select the ‘Virtual Machine’ menu and then select the ‘Install VMWare Tools’ option. Choose ‘Install’ from the dropdown window. This makes a virtual CD available to the virtual machine. In the virtual machine we’ll need to mount the device by typing this as the command line:

mount /media/cdrom0

Copy the installation materials to the temporary directory:

sudo cp -a /media/cdrom0/VMwareTools*.gz /tmp/
cd /tmp/
sudo tar -xzvf VMwareTools*.gz

And then run the installer:

cd vmware-tools-distrib/
sudo ./vmware-install.pl

Press Enter at every prompt. When the install has completed restart the virtual machine by typing this at the command line:

sudo shutdown -r now

Log back in when the virtual machine reboots.

That’s the basic JeOS install with VMWare Tools. Now for Oracle.

We’ll add the Oracle package repository to the list of repositories JeOS knows about.

sudo vi /etc/apt/sources.list

Go the bottom of the file by pressing capital ‘G’. Press capital ‘A’ to append and then press Enter. Type this line to add it to the file:

deb http://oss.oracle.com/debian unstable main non-free

Save and exit the file by pressing the ‘Esc’ key then typing ‘:wq’ and pressing Enter. If you screwed something up, type ‘:q!’ instead of ‘:wq’ and try again.

Now run these commands:

wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install oracle-xe

This adds the Oracle repository signing key to our virtual machine, gets the package list from Oracle and then installs the Oracle package. When the package installation completes, we need to run the Oracle configuration script.

sudo /etc/init.d/oracle-xe configure

Press enter to choose port 8080 for the Application Express web app port and 1521 for the database listener. Then enter the system and sys password of your choice. Enter ‘y’ to have the database startup on boot of the virtual machine and then press Enter. When that’s done you can exit the shell.

exit

You’re done! The final step, if you want it, is to switch the virtual machine to headless code. Headless mode let’s you get rid of the virtual machine window and even shutdown VMWare Fusion without shutting down the virtual machine. You don’t have to do this step. The Oracle virtual machine is now complete.

First, we enable headless mode (it’s not visible by default). From the macOS command line (not the virtual machine!), enter this:

defaults write com.vmware.fusion fluxCapacitor -bool YES

Then edit the VMWare Fusion configuration file at ~/Library/Preferences/VMware Fusion/config and add these lines:

signal.suspendOnHUP = "TRUE"
signal.powerOffOnTerm = "TRUE"

This will make the virtual machine suspend if it receives a -HUP signal and power off if it is killed. The result of all this is that VMWare Fusion will now have a ‘Enter/Exit Headless’ menu item on the View menu.

At this point you may want to change the network settings of your virtual machine to Host Only. You can also lower the memory down to 320 MB or 256 MB if you like. After changing all the settings restart the virtual machine using:

sudo shutdown -r now

And determine the IP address of the virtual machine using:

ifconfig

The database will be accessible at that IP address on port 1521 with the SID of ‘xe’.

The majority of this information was pulled from these links:

[1] https://help.ubuntu.com/community/JeOS

[2] http://blog.xebia.com/2007/12/09/installing-oracle-xe-on-ubuntu-jeos-on-vmware-fusion-on-os-x-leopard/

[3] http://djgraphite.com/articles/vmware-fusion-20-beta-1/