Install Oracle XE 10g On OS X with VMWare Fusion

Oracle HQ

Oracle don’t yet provide a native OS X installer for XE but you can install it on a virtual machine running under OS X.

I found a very detailed article here [1] but also found it quite hard to follow, so thought I would post my own experience here, referring back to that one where appropriate.

First you need VMWare Fusion

I have installed Windows XP SP 2 on there.

The installation of Fusion and XP was pretty straightforward, just point and click. Once the windows guest machine is set up, fusion should prompt you to install VMWare tools which makes the graphics look much better. It will also ask you to install McAffee anti virus (its a free 12 month trial) which I did.

According to [1], it is important to set the computer name. In my case I set this to be “winxp-guest” (right click My Computer).

Next thing is to get the networking set up correctly. You have 3 options with VMWare Fusion:

  • NAT – share the network adapter with the host machine
  • BRIDGED – VM appears to be a seperate machine to the host
  • PRIVATE – VM is only available within the host machine and not on the wider network

PRIVATE networking means your VM cannot connect to the internet, so the best option is NAT

When you change your network settings you need to renew your network config:

ipconfig /release
ipconfig /renew

You should see your IP address like this:

C:\Documents and Settings\Administrator>ipconfig /renew
Windows IP Configuration
Ethernet adapter Local Area Connection:
       Connection-specific DNS Suffix  . : localdomain
       IP Address. . . . . . . . . . . . :
       Subnet Mask . . . . . . . . . . . :
       Default Gateway . . . . . . . . . : 192.168.xx.xx

In order to be able to connect to your guest machine from outside, you need to configure firewalls…

Initially, I disabled McAffee. Once I got everything working, I re-enabled Mcaffee and found that when I tried to access using SqlDeveloper it automatically asked me if I wanted to allow this program.

To setup the windows firewall, you need to go to Control Panel -> Windows Firewall -> Exceptions -> Add Port…
You’ll need to do this twice, one for http access to the admin tool (8080) and one for client access (1521 which is the default)

You also need to select Advanced -> ICMP -> Allow incoming echo request if you want to be able to ping it.

From the host:

64 bytes from icmp_seq=0 ttl=128 time=0.290 ms
64 bytes from icmp_seq=1 ttl=128 time=0.498 ms

You should also setup your hosts file on the host computer:

sudo vi /etc/hosts
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost broadcasthost
::1             localhost
fe80::1%lo0     localhost winxp-guest winxp-guest.localdomain

The localdomain part I found out from installing apache. Note, I also ran “Network ID” wizard from the My Computer-> Computer Name screen, not sure if that made a difference.

Now you can ping winxp-guest

To check that everything is in order, I installed apache on the guest

I picked httpd-2.2.15-win32-x86-no_ssl.msi and within a few moments I can navigate to http://winxp-gueston the guest machine and see an apache “It Works!” page.

I can also do this from my host machine, so networking is all good.

In the reference it mentions setting up the windows hosts file aswell on the guest machine, this is so that everything works on the guest machine with the tnsnames.ora file (it get generated to point to whatever the hostname of your machine is). It is not important to connect from the host machine.

# For example:
#          # source server
#              # x client host       localhost winxp-guest winxp-guest.localdomain

Next install Oracle XE itself. The only thing required to enter here is a password, which you will later use to log in to the web interface with the user “SYSTEM”

Once installed, you can launch the home page and log in as SYSTEM. The first thing to do is to change “Administration->Http Access” which will allow computers outside the machine to access the admin console.

Then you can try it out using sqlplus. I found there was a mistake in the Environment PATH variable – it had referred to the bin directory as “bin” but in windows it was actually “BIN”. Changing it made it work for me.

sqlplus SYSTEM/{password}@XE
SQL> create table foo (bar number, baz varchar(255));
SQL> insert into foo VALUES (2, ‘blah’);
SQL> select * from foo;
SQL> drop table foo;

Brilliant. You have an oracle database.

The connection XE is from your tnsnames.ora file which lives (in default install) at C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN

and contains:

XE =
    (ADDRESS = (PROTOCOL = TCP)(HOST = winxp-guest)(PORT = 1521))

Notice the hostname in here. Presumably if you wanted to change this you could update this file and the computer name and your hosts file.

Next step is to try accessing from the host machine.

I used Oracle SQLDeveloper

I used a jdbc connection string of jdbc:oracle:thin:@winxp-guest:1521:xe

Note that as long as you update /etc/hosts on the host machine, you can call the computer whatever you like (e.g. oraclexe)

Something you might need to do is create a new tablespace. You can do this through the oracle administration console. Go to “home” and then SQL and you can execute sql like this:

create tablespace  datafile ‘/ORACLEXE/ORADATA/XE/{table_space_name}/{table_space_name}.dbf’ size 500m;




Passing System Properties and Environment Variables to unit tests in Maven – Update

Unfortunately there was an bug in my previous post.

I had naively assumed that the syntax for environment variables was the same as for system properties but alas not.

The correct code is:

                       some value


Edit GMail messages using Vim

Ok, why would you want to do this ?

Because you can.

1) Install this add-on which allows you to edit text areas in firefox using an external editor:

2) Install VIM

3) Setup the plugin to use vim (addOns->its all text addon->options)

4) make sure gmail is using “plain text” as editing – otherwise its not a text area, but some mad iframe.

6) Happy Days!


Read in a list of files and loop over them in bash

Needed to do this and after a bit of looking around (Bash scripting) came up with this:





#echo -e "\\nLIST_OF_FILES:\\n$LIST_OF_FILES"

echo "List of files:"
for i in $LIST_OF_FILES; do
    echo $i