Updating Opensimulator

OpenSimulator is evolving very quickly, so if you want to keep up with the latest changes you need to update often. This guide is meant for Debian 6 but will probably work in any Linux flavor. With this guide you’ll update to the latest development version of OpenSimulator so be aware that the simulator you install might not work. For this reason it’s important to backup your database and save your current install at least until you’re sure the new version functions.

Backup

Start by shutting down your Simulator and backing it up (database backup not included).

#su -
#cd /opt
#screen -r
#quit
#[ctrl]+[a]+[k]
#mv opensim opensim-backup

Downloading and installing the new OpenSimulator version

#git clone git://opensimulator.org/git/opensim
#cd opensim
#./runprebuild.sh
#nant clean
#nant
#cd bin

Copying configuration files

#cp ../../opensim-backup/bin/OpenSim.ini .
#cp ../../opensim-backup/bin/Regions/Regions.ini Regions/.

If you use a restartscript:

#cp ../../opensim-backup/bin/restartopensim.sh .

If you have OpenSimulator configured for standalone mode, copy the following:

#cp ../../opensim-backup/bin/config-include/StandaloneCommon.ini config-include/.

If you have OpenSimulator configured for grid mode, copy the following:

#cp ../../opensim-backup/bin/config-include/GridCommon.ini config-include/.
#cp ../../opensim-backup/bin/config-include/FlotsamCache.ini config-include/.

Search and group modules for grid mode

If you are configured for grid mode, you’ll probably also want the search and group modules installed. Those don’t come packaged with the git install. The easiest way to get them is to download the preconfigured OpenSimulator from OSgrid.org. I put it in a directory named opensim-preconf.

#cp ../../opensim-preconf/bin/OpenSimSearch.Modules.* .
#cp ../../opensim-preconf/bin/OpenSimProfile.Modules.* .

Starting Opensimulator

The regular way:

#screen
#mono OpenSim.exe
#[ctrl]+[a]+[d]

Or if you use a restart script:

#screen
#./restartopensim.sh
#[ctrl]+[a]+[d]

ssh

If you’re doing this through ssh, don’t forget to use sudo!

Posted in Running OpenSimulator | Tagged , , , , , , , , , | Leave a comment

Uptime Guarantee: Restart Script for Linux

Still being in development, OpenSimulator crashes once in a while. Especially when you’re testing new functionalities, running it on a barely adequate machine (such as your home desktop or even laptop) or if you’re simply overloading your Sim with scripts, complex objects and visitors. Were this to happen in the middle of the night, when you’re not home or simply when you’re not paying attention, your simulator could be down for hours or even days. When you only use your simulator for personal things, that’s not such a big deal. But when it’s a public -grid connected- simulator with actual frequent visitors, this could mean losing your coordinates on the grid and losing visitors.

It’s advisable to set up some form of monitoring, because even the script described here can crash. For my simulator I use Nagios to monitor the simulator port (usually 9000). This way you get email notification of when your simulator goes down and up again. Don’t set the frequency too high, otherwise it will trigger even when the restart script is working.

Then, the restart script. I wrote and tested this script in Debian 5 (Lenny) and 6 (Squeeze) but I’m sure it’ll work in any Linux environment.

Create a file in the bin directory of your Simulator (if you followed my install guide this is /opt/opensimulator/bin/)

#su -
#touch restartopensim.sh
#nano restartopensim.sh

Paste the following into the contents of the script and save:

#!/bin/bash
cd /opt/opensim/bin/
while true ; do mono OpenSim.exe ; echo "done, sleep"; sleep 10; done

This will start a loop that starts OpenSimulator, echoes “done, sleep” whenever the process terminates and then sleeps for 10 seconds before it starts over again. I built in the 10 seconds of sleep to give the simulator the chance to terminate properly, you don’t want it starting up again too soon, especially when it crashed because of a memory issue, but also for a very practical reason. If you do want to *really* shut down your simulator, for example for updating it or maintenance, you can kill the script in those 10 seconds. Never kill your simulator while it’s running, even if it’s starting up or shutting down. This could seriously corrupt your database.

To start OpenSimulator do the following:

#screen
#./restartopensim.sh

To detach the screen, press [ctrl]|+[a]+[d]. To kill it (only during the 10 seconds of sleep!) [ctrl]+[a]+[k]. To resume the screen, simply execute screen -r.

If you’re connecting through ssh, don’t forget to use sudo.

Posted in Running OpenSimulator | Tagged , , , , , , , , , , | Leave a comment

Installing OpenSimulator (Debian 6)

The first time I installed OpenSimulator was on a Debian 5 machine and it was hours and hours of debugging. I ended up with a half compiled version of mono 2.4.3 installed on top of the official debian 5 package. It has been running for at least 8 months now and I still can’t believe it, it’s a miracle. Unfortunately I neglected to document my struggles back then. But I have been planning to transfer to Debian 6 for a while so I decided to do a test install and fully document it. Mind you, with this guide you’re compiling the development version of OpenSim from source and the code could possibly be broken or unstable.

I started with a completely clean installation of Debian 6 (64 bit).

[Package Installation]

#su -
#apt-get update
#apt-get upgrade
#apt-get install --no-install-recommends screen
#apt-get install --no-install-recommends openssh-server //optional, needed for remote access
#apt-get install --no-install-recommends sudo //optional, needed for remote access
#apt-get install --no-install-recommends nant
#apt-get install --no-install-recommends mysql-server
#apt-get install --no-install-recommends mono-complete
#apt-get install --no-install-recommends git

[OpenSimulator Installation]

#cd /opt
#git clone git://opensimulator.org/git/opensim
#cd opensimulator
#./runprebuild.sh
#nant clean
#nant
#cp OpenSim.ini.example OpenSim.ini

[Create Database]

#mysql -u root -p
#create database Opensimulator;
#grant all privileges on Opensimulator.* to Opensimulator@"localhost" identified by 'password';
#flush privileges;
#quit

[OpenSimulator Standalone Configuration]

#nano OpenSim.ini

All the way down in the [Architecture] section, uncomment the line:

Include-Architecture = "config-include/Standalone.ini"
#cp config-include/StandaloneCommon.ini.example config-include/StandaloneCommon.ini
#nano config-include/StandaloneCommon.ini

Comment out the line under ; SQLite
And uncomment:

StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=password;Olds Guids=true;"

Make sure to fill in the right database name, username and password (case sensitive).

[Starting OpenSimulator]

#screen
#mono OpenSim.exe

You use the screen command so that opensim will stay alive even when you lose connection or decide you want to do something else at the server. You can ‘detach’ a screen by pressing ctrl+a+d and kill it by pressing ctrl+a+k. You can resume a screen by executing screen -r.

[OPTIONAL: Setting up remote access]

#nano /etc/sudoers

Add the line:

%adm ALL=(ALL) ALL
#adduser username adm

You can now remotely access your server by executing this command:

#ssh username@hostname

Don’t forget to use sudo when starting a screen or running OpenSimulator, it won’t work otherwise.

Posted in Running OpenSimulator | Tagged , , , , , , , , , , , | Leave a comment

Free SL land?

As a formerly frequent second life user, I wanted to have my own piece of virtual land. So I got myself a premium account and bought a piece of 512 sqm. Soon however, those 512 sqm weren’t enough any more, so I bought some more and started paying monthly tier. But the longer I played second life, the more land I needed and at a certain point my tier fee was over 40 dollars a month and I still needed more. So I started looking into owning whole regions. You should know that I’m not in any way rich, those 40 dollars a month were already more than I could spare, so you can understand that the prices of whole regions shocked me. The set up costs are insanely high (1000(!!!) dollars) and then I’m not even mentioning the monthly costs… It’s a little cheaper when buying from an estate manager, because of the wholesale prices, but cheap still isn’t the right word.

Second life is a fun game, but linden labs only goal is clearly to make as much money as possible. You can’t tell me that setting up a new server really costs them 1000 dollars. The highest set up fee any company asks is about 50 dollars. And 295 dollars a month for server costs? I don’t know what kind of server they put in for a region, but it has to be a monster machine if you look at that rate. It should certainly be able to have more than 40 users online at the time…

It became clear to me that owning sl land was not an option for me, if only sl allowed people to host and connect their own regions… Then I found a page on that subject in the sl wiki saying that linden labs was planning to make second life opensource and would probably allow users to connect their own regions in the future, but that a major redesign of the grid was needed for that. Yeah… Of course…And why exactly would linden labs give up their money tree?

So I continued my search and I found the open source equivalent of second life: opensimulator, or opensim. This software is still in alpha stage, but already very much like second life. It makes use of the same viewers, looks the same, feels the same and on some areas can do even more than second life. And best of all: opensim is designed to let users connect their own regions, completely free!

I discovered there are many opensim grids up and running, of which the biggest is osgrid (osgrid.org). So I installed opensim on my server and connected it. I now have 20 regions running on a server that costs less than 70 dollars a month.

Of course there is a downside, osgrid, or any opensim grid for that matter isn’t nearly as crowded as second life. And that’s where I come in. I’d very much like for second life users to come and take a look in osgrid, try it out for yourself. And for that reason I’m giving away land for free. No whole regions of course, nice little pieces of land for you to experiment on.

Interested? Here’s how it works:

  • Go to osgrid.org and create an account.
  • Install Imprudence viewer
  • Login to osgrid with your username and password
  • Open the search menu, choose people
  • Search for “Nihlaeth”
  • IM Nihlaeth Melody that you want a piece of land
  • Wait for me to respond

If you want to see what I’ve been doing, open the map menu and search for Phoenix Rising Isles.

Have fun exploring!

Posted in Free SL land | Tagged , , , , , , , , , | Leave a comment