How to Build Your Own Virtual World with Opensim for Free - Part I

 

A picture of the Rocket Virtual world created in Part I and II of this article.

 

Standalone Opensimulator, Data center Server and MySQL

PLEASE NOTE: This very detailed article has been deprecated, not because its a bad article, its an excellent article which explains in a general the way setting up your own virtual world with DIVA's version of opensimulator. Unfortunately, technology changes rapidly as tools change and some of the specifics are no longer current and up to date, since I have re-written the article for the last three years and re-written every year, I'm tired of trying to hit a moving target. However, again this is an excellent guideline for creating your own virtual world, explaining many things found in pieces across the web and will remain up for that very reason.

The Opensim server is written in the C# language which can run on multiple OS platforms.  Windows, Linux or Mac OS X using Mono a cross-platform implementation of C#.   For this article I will be using Windows 2008 Standard Server and/or Windows 7.  This is simply because these are the systems I know best.

Opensim can be configured into (2) modes: Standalone Server mode or Grid mode.  It would be too difficult to provide detail instructions for both going forward, so I'll choose one for now . . . we will use the standalone mode, but a very specifically configured one, the Diva Distro version.

Hardware first.  You'll need hardware to host the server on.  I recommend at least a dual core AMD or Intel computer.  2 GB of main memory and very high speed access to the Internet. The best being a Data center setup, if you can afford it.  Disk space ~100+ GB HD.  This assumes extra storage may be needed ultimately for backups in the form of MySQL, OAR files and log files, room for a Drupal themed startup website.  I call it a "viewer on-ramp website" for newbies who have yet to install a viewer or visit SL with its viewer.  We'll discuss these things in future articles.

Now a few high-level words about how the client viewer and opensim server work together.  You see its mostly about being able to communicate objects, moving x, y, z  coordinate positions and graphic textured surfaces quickly to the client viewer from the virtual world server.  Latency is expressed as a visual lag as objects rez (are rendered in the viewer).  As the number of connected users, or avatars increases, this becomes even more apparent.  Although there have been performance improvements to Opensim, it still in my opinion remains "chatty" (more so on grids).

Standalone mode is essentially a client-server architecture, despite the recent re-factoring, therefore in a VW site with many users accessing simultaneously, it will mean the server requires high bandwidth access to the global Internet for your users who will most likely come from all over the world.  The advantages to that are you will potentially have a larger user base, but time zones come into play and you will notice traffic at all hours of the day if your VW site becomes popular.  Because of time zones, this allows for a more even distribution or user load, unless of course you have such exciting events that people will stay up all hours of the night to visit, which is really not an entirely impossible scenario considering VWs are primarily a social gathering place in VR.

Here are some stress tests of avatar load between the old and refactored version of Opensim.  You can find grid hardware performance info here.  The reason I included it in this article is because I suspect performance for an average standalone opensim (abbreviated "sim" for short) will be worse than the stress tests, because your VW will be a growing world of object.  But still better performance than grid sims with powerful standalone multi-core server hardware (however this may drop off for very a larger group of users in single region areas, I'll explain regions later).  The point is the Opensim software has been changing so rapidly up to this point it is difficult to get good performance metrics unless you measure them yourself. 

Now you can use and install on a Virtual Server, I have, and they usually work fine, that's as long as your hosting provider doesn't overload that hardware by over-selling and putting too many other customer's virtual machines on the same multi-core hardware box.  I personally prefer a dedicated one, even much little less powerful because you never get unexpected slow downs as with virtual servers.

However, with windows and dedicated hardware you could pay as much as $125-$140 or more per month, you'll want to find a good dedicated hosting deal or share hosting costs with other friends.

If that's still too much money, try the virtual servers (maybe significantly cheaper per month), if that's still too much use Linux virtual servers (~$20 less for MS OS fees) and if that's still too high (and you only want a simple sandbox setup) try a dedicated cable modem with the proper router, configuration and possibly use dynDNS loopback (maybe throw in a backup power supply for your desktop which will run 24hrs/7days a week?).  I have tried and/or seen these other configuration(s) and dedicated hardware setup in a Data center is still the best setup to date.  

The only other option is a cloud service.  It is a very new option, so new I have yet to try it out and won't be writing about it in this article.  I suggest going with what has already been tried and has most of the bugs worked out! 

Whatever your chosen configuration, I recommend you setup a MySQL database before you begin installing any version of Opensim.  If you are going to have a real user base, SQLite just doesn't cut it for me, unless maybe when your in a Grid mode installation where your persistence store is mainly on the grid asset server.

For information on a Non-standalone grid configuration I recommend OSGrid.org.  However, I also recommend you do not attempt to rely on that developer grid for production VWs because they are too unstable, to their credit they have even said so.  If you just want to play around with opensim in a grid environment, that's fine though.

Note: if you select a virtual server, MySQL may already be setup for you, use that instead and keep your security login info and database settings available, you'll need it shortly . . .

 

Instructions for MySQL Install

1.  First, turn off your firewall and whatever Anti-virus software you have (IMPORTANT! Just briefly while installing MySQL to avoid any problematic installation conflicts.  If you are unwilling to do this, most likely the install will fail.  Once your install is complete remember to turn them both back on again.  If you have a windows server setup, you probably won't have anti-virus software because the licenses are too expensive.  That's OK... just be extra security cautious, at least harden your server with lastest updates and patches)

You can find the firewall by typing "check firewall status" into the search field under the Windows Start Menu,

"Turn windows firewall on or off", select off for both private and public locations and click OK.

2. Turn off also your specific anti-virus software.

3. Because of a bug in opensim relating to MySQL on 64 bit machines, I recommend you use the 32 bit version of MySQL version 5.1.35 which can no longer be found on the "Oracle" MySQL.com ???

Anywhere on the website!!!

Fortunately for all, I have a copy pre-Oracle Sun MicroSystems acquisition, which is legally called "GA - General Availability", which can be found here.  Download it and install (not to worry, even older versions of MySQL will work very well with Opensim).  I will be skipping some visual steps, so just follow along with the important check points.

Proceed past the security warning and allow all needed access permissions for the install . . . 

take the Typical Setup Type . . .

Continue along with the install . . .

Once the install is finished wait for the "MySQL Server Instance Configuration Wizard" to launch and pay close attention to the next steps . . .  YOU WON"T WANT TO BE REGISTERING FOR THE "SunConnect" SERVICE! Ha Ha... Oracle!

Select Detailed Configuration.

You want the Server Machine option.

Choose Multifunctional Database, because we maybe using the same database instance for a Drupal website.  (more on that  later on . . .)

Decision Support or the Manual Setting option  is acceptable . . .  I chose Decision Support.

This is important: enable the "Add firewall exception for this port" check box.

IMPORTANT: Make sure all check boxes are checked.  Install As Windows Service, Launch the MySQL Server automatically, Include Bin Directory in Windows PATH.  Leave the Service Name to MySQL.

Modify the Security Settings only with your root password for MySQL.  Remember this password, you'll need it in a later step(s).

Finally, MySQL is ready to configure your "Instance" of the database.  This step should complete successfully if you turned off your firewall and anti-virus.  Note: If it did not, cancel the install, go to the control panel and "Uninstall" the MySQL Server 5.5 software and try it again.  Good Luck.   

Click finished if you had a successful install and congratulations!  Remember to turn on your firewall and anti-virus software again.  I would suggest a computer reboot at this time.  SKIP the troubleshooting step below and go to "Installing Toad for Your MySQL Database" next.

 

****TROUBLE SHOOTING ONLY ---ONLY IF YOU HAVE PROBLEMS AND DID NOT COMPLETE MYSQL INSTALL AND CONFIGURATION SUCCESSFULLY ABOVE

Most likely you didn't follow the instructions in turning off the firewall and anti-virus.  I've forgotten to do this several times on different installs myself!  To Fix: Run the "MySQL Server Instance Configuration Wizard" under Start Menu/MySQL again taking the "Remove Instance" and/or "Repair" option (try them both now).  Clear out the files on the hard drive under C:/Program Files/MySQL/  All of them...  Reboot the machine.  Re-install the MySQL again.  When you get to the "Modify Security Setting" step pay careful attention.  You  will be asked for the "Current Password:" this time, use either blank (nothing, which is the default) or the previous password you use last time, whichever works for you...  You can use the "Back" button on the wizard in the last steps to try changing the password a couple of times to see if you can get a successful completion this time.  Good luck, that should fix your problem.  Now please turn your firewall and anti-virus back on and continue to the next step... 

 

Installing Toad for Your MySQL Database

If you need a unzip program for unzipping the Toad files, I recommend 7zip.

Now that you have successfully installed MySQL, you should install Toad next for managing your opensim database.

Here are the setup instructions for Toad for MySQL . . .

1.  First thing you’ll need to do, if it isn’t already installed, it is to download and install, the Microsoft .NET Framework Version 4.0.  If you are asked to "Repair" your .NET 4.0 at some point, do so rather than uninstall, and Restart also if asked to do so, you should now be good to go to the next step . . .  downloading and installing Toad!

2.  Next go to http://www.toadworld.com/DOWNLOADS/Freeware/ToadforMySQLFreeware/tabid/561/Default.aspx and download Toad for MySQL.

3.  Proceed with the install . . . taking the normal defaults, I will display the critical steps along the way.

Select the check box for the .sql file extension, unless you have a different SQL editor.

Install will take a short while to copy files into your system.

It will then optimize it's code for improved performance on your system.

Let Toad "Start" after installation, you may deselect the "Launch Release Notes" check box if you wish. 

 

Connecting and Creating the Opensim Database with Toad

Now that we have Toad installed and running, we need to setup a connection to the "instance of the MySQL database" and create the opensim database as well.

Here is how:  Check the "Custom" Layout and Settings when the wizard launches in Toad for the first time. 

When you get to the connections window, you can check off "Show this dialog at startup" and select "Click here to create a new connection" . . . 

Now you are asked to create the new connection putting in the User field "root", case sensitive no quotes, the password for the database in the Password field To the password you put into MySQL step above (hope you remember it).

Now select the "Save password" check box and the "Connect on startup" check box and click the "Connect" button.  Leave the Database name blank for now, we will create the database next.

Notice the MySQL system "information_schema" is already created and in the Connection Manager sub-panel root@localhost has a green arrowed play button next to it.  This is good, your connection is established.

Click the "Build SQL statements" icon below (see top red circle below).  Then under the "Query Builder" tab click the "Query" tab down below (see bottom red circle below).  You are read to copy and paste SQL command text into the window.

You'll want to copy and paste the following commands into the Query Builder Window below and then carefully replace the text "your_password_goes_here"  inside the single quotes with your own password for the database, the same in both lines, and then click the icon to "Execute the SQL statement" (see red circled icon below).  The SQL statements will now execute.

 

use mysql;
create database opensim;
create user opensim identified by 'your_password_goes_here';
create user 'opensim'@'localhost' identified by 'your_password_goes_here';
grant all on opensim.* to opensim;
grant all on opensim.* to 'opensim'@'localhost';
FLUSH PRIVILEGES;

 

If they executed successfully, you should see the messages below under the "Results" tab -go to the next step.  If they did not execute correctly,  then correct the error statement under the "Query" tab.  You may have to drop the users to do this...

 

Under the root@localhost tab in the Main panel, you will see a series of sub tabs, use the right arrow next to these tabs to locate the click-scroll to the "Databases" tab itself.  You should see a "opensim" with a database icon next to it.  This means the blank opensim database has been created.  Toad has been setup for managing your database and you can now exit by selecting File > Exit, from the Top Menu.

Congratulations you made it to the end of Part I !!!  You have now completed all the preliminaries before installing Opensim itself.  It's also a good place to take a break before continuing on with the second part . . . Good Job.  We are half way there.  Part II of the article continues here.

 

Commenting has been turned off because of the Ad spamming, but here is a valid comment...

 

 

There is an update to the Diva Distro.  Here is the recent information from her website blog... you should read this before proceeding  =>

http://metaverseink.com/blog/?p=163#more-163

 

Hi!

I really wanted to thank you for writing this article - as I write this I am following the directions to try to create my own world :-)

I seem to be running in to some issues with Toad the steps where you paste in the database etc part can't seem to get past it. Anyhow I've gotten this far I'm not giving up yet!

 

I also stopped in and visited your world it's very nice :-)

 

Great job!

Visit Viradu.com a Science Fiction World by Michael Blade

All Rights Reserved, Copyright © Michael Blade, RocketVirtual.com 2011.