Jul 06 2008

OpenSim 0.5.8 server 64-bit build steps for Ubuntu 8.04 HOWTO

Published by under OpenSim

Build recipe for a BARGC public-facing Opensim server 20080703 being built for the Bay Area Regional Geographic Information Systems Council (BARGC)

OVERVIEW: Pre-OpenSim-install steps from bare hardware to ready environment

0) Ubuntu 8.04 LTS x86_64 operating system
1) VNC Server
2) OpenSim build environment - SVN, nant, mono
3) Local 64-bit build of Mono 1.9.1
4) Local 64-bit build of LibSecondlife's libopenjpeg
5) ODE build environment - autoconf, automake, libtool, bison(?)
6) Local 64-bit build of OpenSim's chosen ODE2
7) MySQL Server 5.0.51 x86_64
8] MySQL Administrator 1.2.12
9) OpenSim subversion builds...

This post is notes from procedure used to build an OpenSim virtual world on a rehabilitated BARGC server (2006-era) HP DL360 G4, dual 3.4 GHz Xeon, 4 GB system (a 1-U screamer for its time) System was revived from non-boot status, and has a single surviving 146 GB U320 SCSI drive.

0) OS: Ubuntu 8.04 LTS x86_64 architecture (Desktop Edition)
Downloaded via http://ubuntu.com as ISO image burned to produce a single boot/install Live CD
When the OS is running, install system patches and updates (about 216 items as of 20080703)
Using Ubuntu System > Administration > Update Manager
IMHO there is no shame in choosing Ubuntu Desktop rather than server unless you’re really cramped for memory or disk space—to my understanding, the only difference between server and desktop is the absence of GUI in server. The ease of administering the server via GUI has been important to me for making late-night work sessions more productive. In any case, the following HOWTO steps assume you’re building the OpenSim server on Ubuntu Desktop.

1) Install VNC server
per directions here and ultraVNC client for access to the server console from Windows machines. Ubuntu desktop already has both VNC- and RDP-compatible client preinstalled under
Applications > Internet > Terminal Server Client

2) Prepare Ubuntu for running OpenSim
per directions at opensimulator.org/wiki
which is essentially just this but includes a mono install that we’ll undo in the next step:

sudo apt-get install subversion nant \
  mono-gmcs libmono-microsoft8.0-cil \
  libmono-system-runtime2.0-cil \
  libgdiplus libmono-i18n2.0-cil

3) Upgrade to Mono 1.9.1
per previous page’s performance hint
IMHO it is a big hairy deal to compile the latest Mono from source, but at this point it sort of goes with the 64-bit territory, taking over 50 minutes. And if this is what it takes to outperform dotNET on Windows, so be it Many thanks to Sean Dague for his work in 20080330, and DrScofield for his rev on 20080508 that I ran when it’s all built and done, it’s checked simply enough by entering

mono -V

4) build libopenjpeg on the 64-bit OS
using instructions here which involved a checkout of LibSecondLife svn_1901 and produced libopenjpeg-libsl- at 131032 byes size.

5) prep system to build one’s own 64-bit ODE from source
To do this, one must have automake, which seems to work after this:

sudo apt-get install autoconf automake libtool bison

6) build OpenDynamicsEngine on the 64-bit OS
using instructions here that involves a checkout of the version available from opensimulator.org

svn co \
http://opensimulator.org/svn/opensim-libs/trunk/unmanaged/OpenDynamicsEngine2 \

which checked out svn_47 on 20080710
after obtaining libtool to run autogen.sh, one should be able to

sh autogen.sh;
./configure --with-trimesh=gimpact --enable-shared;
sudo make install

for me this built libode-0.so at 1906756 bytes for X86_64 Ubuntu on a dual Xeon

My last step before the Osim install was to stand up a MySQL instance. This is not required for OpenSim to run (the SVN will work just fine by itself and defaults to included SQLite storage) but I’m preferring MySQL for large, detailed, and hard-to-load terrain and hard-to-build sculptie prim-laden environment that I wish to persist. Like really persist between both client logins and simulator restarts. So I take these few extra steps to install an instance of MySQL, just to run OpenSim’s back end.

7) Obtain MySQL server

sudo apt-get install mysql-server

the download took a long time during Euro-morning hours, but eventually all one needed to do was to set a root/sa password

8] Install MySQL admin GUI
For the sake of being lazy, in keeping with my choice to install Ubuntu desktop to improve late-night productivity, one adds

sudo apt-get install mysql-admin mysql-gui-tools-common

with that install, MySQL Administrator just shows up in the
Applications > Programming menu.
Almost magically, just log in using

Server Hostname: "localhost"  Port: "3306"
Username: "root"
Password" "*****"  <<your password>> and Connect.

Welcome to your new MySQL instance.

In the upper-left pane of MySQL Administrator, highlight the Catalogs item at the bottom, then in the Schemata/database box with the magnifying glass, DO NOT TRY to enter your new opensim catalog name, as you will be disappointed with the non-result! Instead, hover over a blank portion of the Schemata window and right-click, selecting Create Schema. Then in the dialog box enter the Catalog/database that you intend to have OpenSim use. I used “opensim” (the schema/database).

For grins, I also went to the User Administration item in MySQL Administrator, and using the same hover-over and right-click, this time in the User Accounts pane, added a user that OpenSim might use. Again, I used “opensim” (the MySQL user). In fact, on this machine I will not be using MySQL for any other purpose than as a back end for OpenSim, so if worse comes to worse, I’m willing to have OpenSim log in to MySQL with database-root credentials.

And that’s most all the prep work
to clear the way for OpenSim on Ubuntu 8.04 x86_64 environment. The previous steps tended to use ‘sudo’ or system root privileges to install most of the supporting items for system-wide use, and now subsequent steps will tend to take place in one’s own development directory. Here’s where we’ve gone so far:

0) Ubuntu 8.04 LTS x86_64 operating system
1) VNC Server
2) OpenSim build environment - SVN, nant, mono
3) Local 64-bit build of Mono 1.9.1
4) Local 64-bit build of LibSecondlife's libopenjpeg
5) ODE build environment - autoconf, automake, libtool, bison(?)
6) Local 64-bit build of OpenSim's chosen ODE2
7) MySQL Server 5.0.51 x86_64
8] MySQL Administrator 1.2.12
9) install and configure OpenSim <== you are here

After that 64-bit detour, I’m returning to the directions here and willfully maintaining the perspective that OpenSim is presently Alpha-stage code , I created a ./dev directory in my Ubuntu user login’s home directory. In ./dev, I expect to have a growing thread of OpenSim svn checkouts that will evolve over time. In each of these there will be a variety of source and support directories, including a /bin that contains the .NET executable that is OpenSim.exe and settings OpenSim.ini and its associated region definition XML files in /bin/Regions. Thus far, to hop from one SVN to the next, I copy over essential configurations from previous SVNs.


I grow this tree from one version to the next using SVN into a generic directory below ./dev

svn co http://opensimulator.org/svn/opensim/trunk os058_

Then after the last line of that checkout informs Checked out revision 5341 one simply

% mv os058_ os058_5341
% cd /os058_5341
% ./runprebuild.sh
% nant

This should give one a compiled Opensim.exe in the /bin directory within 30 to 90 seconds.

Next I cd into the /bin directory to rename the supplied libode.so and replace it with a symlink to the 64-bit library from step 6) above

% mv libode.so  libode_32.so
% ln -s /usr/local/lib/libode-0.so libode.so

Although I’m presently not certain how it gets chosen (some versions have .dynlib and others don’t) I copy the latest libsl libopenjpeg into bin

% cp ../../libopenjpeg-libsl- \

To get the sim personalized, I download my sim definition for the 40 OpenBerkurodam regions
which contains my 40 functional regions of seamless real-world bare earth terrain, 40 working region definition files, and some PHP scripts to create other region definition XML files with different estate owners, a command script for loading the terrain into 40 sims, and a good luck charm to remind me to create a symlink to mono created above /bin in the main sim directory with

% ln -s `which mono` cli

this symlink is for invoking mono to run the sim, in the belief that should a need arise, it is easier to kill mono when invoked that way than if mono is called directly. I can’t explain why this should be so, but I’m trying it for the sake of smoother remote server administration.

Note that if you’re following the build steps I’ve posted here and choose to try out the berkurodam_OB40 set, it will be necessary for you to input your own root@MySQL password in both the OpenSim.ini and mysql_connection.ini configuration files.

In the Region directory, it appears necessary to specify your machine’s network IP (not loopback) to allow connections from outside. The way that I maintain this with twoscore of regions is based on an example provided in earlier OpenSim svn that is a PHP script. If you’ve not yet got PHP on your machine it’s easy enough with

% sudo apt-get update
% sudo apt-get install php5 php5-cli

The relevant script to generate the 40 region.xml configuration files is obdam_40h.php and edit that file to set $ourHostNom = "your.ip.addr.here" and just run % php obdam_40h.php to generate all your region.xml configuration files right there in the sim’s /bin/Regions directory.

By way of detail for public server in DMZ, a successful configuration was found that used the loopback alias “” for internal IP, and the external public IP for the host name. This was necessary because on the DMZ-based host, the server name would resolve differently in different contexts, either loopback, non-routable DMZ address, or public routable address. This caused the outbound UDP to bind to the loopback address, leaving the server mute to outside users.

When all is installed and poised for action, just go into the svn’s bin directory, such as from home

% cd ./dev/os058_5341/bin
% ../cli OpenSim.exe

and hopefully your very own OpenSim server is off and running within a mostly 64-bit environment!

2 responses so far

Jun 24 2008

Progress of a sort OpenSim 0.5.8_5195 on mono / MySQL

Published by under OpenSim

I’ve been trying to be patient and catch a good wave in OpenSim’s evolution, so that I can configure a demo of terrain prims for late July. Much good seems to be afoot, and yet I am trying to find the right point amidst all this progress to grab an SVN and build on it for a few weeks. Tonight I had some luck with getting my OpenSim.ini configuration together better than before.

For all OpenSim back end storage now I’ve gotten MySQL 5.0.51a-3ubuntu5.1 working fine. I had a glitch in my configurations where I worked with a configuration setting that referred to Catalog / schema (what MS SQL folks might know only as a “database”) but interpreted as schema certain tables within that one schema known as users, userfriends, terrain, prims, land and such. For a few nights I seemed sleepily unaware that I had confused the table ‘opensim’ with the catalog ‘opensim’—my bad for naming them all the same without being sure enough what I was doing. The symptom was simply that
../cli OpenSim.exe
refused to load storage, which is to say that the sim wouldn’t start up, and refused to go more than the first few lines into a startup sequence that for my 40 regions is typically many hundreds of status lines. Anyhow, that’s all happy now and every storage invocation in my OpenSim.ini config is using the local MySQL instance through loopback. Bottom line for me was this—the OpenSim.ini and mysql_connection.ini config files are connecting to a catalog, even through in places they contain references to certain tables.

On the physics side, I’ve got ODE turned on for all 40 regions, and the startup is still very fast at less than 30 seconds with no prims. The 1-meter gridded terrain loads into 40 regions in about 15 seconds [hardware: 2x Core2 Duo E6550 overclocked to 3.4 GHz with 3.9 GB RAM]. Everything seems to be going my way until…

I try to create prims right now. Tonight at svn 5195, I can create cube prims, have them be physical and drop to the ground. When either I turn them into spheres, or create them as spheres, in regions near (where I first rez) or far (at the northeast end of my 40 region sim), the whole sim hangs brutally. I’ve never had the sim hang this way before, where it’s a ‘kill -9’ to get its attention and make it go away.

With the persistence of MySQL running, if I quickly restart the sim without taking time to command the previous “../cli OpenSim.exe” into oblivion, then I can’t log in because the second sim still thinks that I’m already logged in, from the first hung sim’s session. I flailed around a bit this evening learning this and creating new users along the way. At one point, I was so discombobulated between hung mono and typing anything *.exe on a command line that I restarted Ubuntu to wash my hands of the matter. Now wasn’t that silly? I certainly think that it was. No amount of C# code under mono is going to turn Ubuntu into the sort of bounce first, ask questions later mode favored by some Windows server administrators, including myself in impatient moments.

But whatever happens tonight at svn 5195, it appears to have an evil effect on mono when meshing a single spherical prim, or a box that’s become a sphere. This is using SL Windows client or SL Linux client on x86_64 Ubuntu 8.04 Hardy Heron.

Thanks to Nebadon who helped me get a pulse on my memory usage. Interesting experience tonight was that now that I’ve started using MySQL and making sure to kill off zombie ../cli processes, my memory use is down toward 780 MB, rather than the 1.4 GB I’d mentioned on IRC. At that size, there does not seem to be too much memory use penalty under Linux+mono versus native Windows servers running OpenSim. Selfishly, I’m glad of that because I’ve already switched my opensim test servers off of Windows and onto Ubuntu, and I’d prefer not to come across too many reasons to want to go back!

No responses yet