Starting Multiple OpenOffice Instances

To use multiple OpenOffice instances you have to:

  • Start one instance with its own user directory; $HOME on UNIX or %USERPROFILE% on Windows
  • Use different TCP/IP ports

For server mode use options to not display logo at startup (-nologo), to not draw a frame (-headless or -invisible), skip the first start wizard (-nofirststartwizard) and to prevent crash reports (-nocrashreport) as in these situations OOo tries to show a dialog which will prevent your instance from working. As OOo may restart automatically if an exception occured and display a dialog to send a report, you want to display this behavior using the -norestart option.

I wrote a small shell script to start several instances on my Mac. You can easily adopt it for other Unices by pointing OOO_HOME to your installation directory:

OOO_PORT="2002 2003 2004 2005"

_create_home() {
    mkdir -p ${home}
    echo ${home}

_start_instances() {
    # Go to OOo program folder
    cd ${OOO_HOME}/program
    # Set IP address
    # All ports... default is standard port 2002
    for port in ${OOO_PORT:-2002}
        # Set user home
        HOME=$(_create_home ${port})
        export HOME
        # Start OOo
        echo "Starting OpenOffice on ${host}:${port} using home directory ${HOME}"
        opts="-nologo -nofirststartwizard -nodefault -nocrashreport -norestart -nolockcheck -headless"
        nohup ./soffice -userid="${HOME}" -accept="${sock}" ${opts} 1>soffice_${port}.log 2>&1 &

exit 0
This entry was posted in Odisee, Software Development and tagged . Bookmark the permalink.