Post Reply  Post Thread 
[Linux/Unix]: How to set up and run srcds under Solaris 10
Author Message
AoS.DeathFromAbove
Junior Member
**


Posts: 17
Group: Registered
Joined: Apr 2007
Status: Offline
Post: #1
[Linux/Unix]: How to set up and run srcds under Solaris 10

TUTORIAL: How to set up and run srcds under Solaris 10

Summary: Here is a quick list of every external link in this article.

Java Desktop System: http://www.opensolaris.org/os/community/desktop/
ZFS: http://www.opensolaris.org/os/community/zfs/
Fault Management: http://www.opensolaris.org/os/community/fm/
Intro to Zones: http://www.opensolaris.org/os/community/zones/
Intro to BrandZ: http://www.opensolaris.org/os/community/brandz/

Solaris HCL: http://www.sun.com/bigadmin/hcl/
Solaris Network Drivers: http://homepage2.nifty.com/mrym3/taiyodo/eng/
Get Solaris: http://www.opensolaris.org/os/downloads/
Install Solaris: http://frsun.downloads.edgesuite.net/sun...index.html

Get a CentOS tarball image: http://opensolaris.org/os/community/brandz/downloads
Install an lx Branded Zone: http://www.opensolaris.org/os/community/brandz/install/
Install and run srcds in your Linux zone: http://www.srcds.com/db/engine.php?subac...0&archive=

More help with Brandz: http://www.opensolaris.org/jive/forum.jspa?forumID=83
More help with srcds: http://forums.srcds.com/viewcat/6

Try the Ace of Spades server: 76.92.198.60:27015
Report problems with the Ace of Spades server: http://www.aceofspades27.proboards52.com/


1) Introduction

What is Solaris?

Solaris is a mature UNIX Operating System, derived from Sun and AT&T’s partnership in 1988 that created UNIX Sytem V, Release 4. The first official release of Solaris in 1992 incorporated SVR4 plus many features from Sun’s previous BSD-Based SunOS, such as the Network File System and a number of BSD libraries for compatibility. 1992’s release was officially called Solaris 2. Sun’s old BSD-based SunOS (which at the time was up to SunOS v4) was retro-named Solaris 1 and phased out.

Sun began to open-source Solaris in 2004, and today the entire operating system (now Solars 10) and its components are open source and maintained by the separate, independent OpenSolaris community.

[Solaris history from http://www.softpanorama.org/Solaris/sola...ory.shtml, which also cites wikipedia, and my memory]

2) Why use Solaris?

There are several reasons to choose Solaris over other open-source UNIX variants.

-- You may already use and know it: This was my reason. I’ve been using Solaris since the SunOS days. I don’t want to set up a separate Linux box just for one application. I just list the remaining reasons so I don’t look too biased. They are cool, but I don’t really know if Linux can do any of the stuff that follows or not.

-- The Java Desktop: All of the popular window manager/desktop choices are available on Solaris. In addition to CDE, KDE, etc., OpenSolaris has customized the GNOME desktop into a very simple and easy to use version called the Java Desktop System. There’s a lot to like here: http://www.opensolaris.org/os/community/desktop/

-- The ZFS filesystem. OpenSolaris’ ZFS filesystem is as bulletproof as a Unix filesystem gets. If you’re running a server that needs to run dependably, ZFS has numerous advantages: http://www.opensolaris.org/os/community/zfs/

-- Fault Management. Another consideration if you want to run an industrial-strength high-availability server is fault management. When running on AMD hardware, Solaris can monitor CPU, Memory, Northbridge chipset, and other hardware. While these features are mainly designed for multiple-blade server farms, they’ll run on any AMD hardware: http://www.opensolaris.org/os/community/fm/

-- You want to isolate srcds. It’s a good idea to run srcds in a sandbox. This keeps srcds failures or hacks from damaging your system. Solaris’ Zones are an ideal environment, providing isolation from the host in a simple package that is integrated into the host OS and supported by the OS vendor. An alternative would be to use a user-space tool like VMWare, but that doesn’t run on Solaris today.

-- Full 64-bit support and cool tools. This isn’t important for running srcds, in fact the Linux Zone only supports 32-bit Linux binaries. However, if there’s other development or hosting you want to do on the same machine outside the Linux sandbox, Solaris is a full 64-bit implementation of Unix with really nice developer tools. Sun Studio 11 is completely free and better than many paid-for developer suites. I don’t see how developers get along without DTrace.

NOTE: This tutorial only applies only to Solaris running on Intel or AMD x86 32- or 64-bit hardware. srcds is an x86-only binary, and it won’t run on SPARC or PPC hardware. The Linux Zone isn’t an Intel emulator. Also, Fault Management is only supported on AMD hardware as of this writing.

3) How to run Linux applications on a Solaris machine

There are three tools available to run Linux binaries on Solaris: lxrun, Xen, and BrandZ.

lxrun is an obsolete solution. It’s a user-space application that executes Linux binaries but has limitations such as read-only access to the filesystem. It’s available but not actively supported anymore.

Xen is more complicated, but allows you to run any complete OS of your choice. Xen actually runs the entire operating system on top of a Hypervisor. Solaris can (but doesn’t have to) be the “root” domain OS, with other OSes running in parallel. Its development is not as mature as BrandZ, so I did not choose this solution. Xen support is currently based on an old build of OpenSolaris. However, it may become the way to go in the future, as I’ll explain below.

Zones, which are built-in to the current release of OpenSolaris, allow you to set up a partitioned user space that’s completely abstracted from the OS APIs and from other processes on the host:
http://www.opensolaris.org/os/community/zones/

A Branded Zone (or BrandZ) is a particular kind of Zone that has all of the abstraction features of a Zone with the added ability to run non-native OS APIs: http://www.opensolaris.org/os/community/brandz/

The lx Branded Zone allows you to run binaries that make Linux API calls. Support for the lx BrandZ is currently limited to RedHat or CentOS (the “community” version of RedHat). Any OS that uses the Linux 2.4.1 kernel should work but all of the documentation and support are around RedHat/CentOS. Red Hat did an odd thing in that their kernel is not a complete implementation of the Linux 2.6 kernel but it’s not stuck at 2.4 either. Many of the 2.6 features, with the big exception of 64-bit support, are in RedHat/CentOS. srcds works just fine under this kernel, but if Valve ever uses any of the APIs that aren’t supported this solution won’t work anymore. We’d have to switch to Xen, unless Sun ups the version of the Linux kernel supported by the lx Brand. There does seem to be user demand for this, though, so we’ll see what happens in the future.

Both Xen and BrandZ are currently supported by the OpenSolaris community. The supported version of Red Hat/CentOS is now behind the latest release of both, but it works.

4) How to Install Solaris and a Linux Branded Zone

Check Your Hardware

Before you do anything, check Sun’s Hardware Compatibility List:

http://www.sun.com/bigadmin/hcl/

Solaris seems geared for big iron. The real push to support commodity PCs has only happened with the recent open-sourcing of the OS. It’s the only area I’ve seen where Ubuntu, Knoppix, and the other boot-and-go Linuxes beat Solaris. In particular, Solaris does not support as many Ethernet chipsets out-of-the-box as Linux does. If your Ethernet chipset isn’t on the official HCL, don’t panic. There are more drivers here:

http://homepage2.nifty.com/mrym3/taiyodo/eng/

I wouldn’t worry about the rest of the HCL since you won’t need sound or even graphics support to run srcds. The latest & greatest version of OpenSolaris (see below) seems to support more hardware than the HCL says anyway.

If you find a driver for a non-official NIC, just make sure you download your driver and put it on a thumbdrive or something before installing Solaris. Then install the correct Ethernet drivers after the install but before you do anything else.

Even easier: Ethernet cards are ten bucks. I just went out and bought one that works. You do need to remember to disable your built-in Ethernet in BIOS if you use another card.

You’ll know if your Ethernet card works early in the install process (see below).

Get The Latest OpenSolaris -- Not Sun's

Things get a little confusing here, because there are many releases of OpenSolaris depending on which branch of the build tree you’re looking at. The OpenSolaris community’s latest and greatest official version is sometimes a version or more ahead of what Sun Corporate supports. Both are free. More confusing is the fact that Sun’s website is the repository for all of the ISO images, whether you get the corporate version from Sun or the Community version from OpenSolaris.org.

The latest & greatest OpenSolaris release is always called Solaris Express, Community Edition. The tested and supported from Sun version is always called Solaris Express, Developer Edition. When the links for both take you to the same place, they’re in sync and Sun’s supporting what OpenSolaris is giving away.

You want to get the latest version of Solaris Express from OpenSolaris.org:

http://www.opensolaris.org/os/downloads/

The above link takes you to Sun’s repository, where they ask for sign-up information but then take you to the download page. Remember this sign-up information for later.

If you’re really ambitious you can get an even later release from the source code tree and compile it yourself. Double all coffee suggestions given below if you’re going to do that.

---------------------------------------------------------------

NOTE 02/09/2008:

Sun's "Project Indiana" was released 11/2007. This is a new version of Solaris that installs from a live CD, like Ubuntu. It also includes Sun's ZFS file system as the native file system. The Main OpenSolaris download page now has this distro as the first download listed. It's called "OpenSolaris Developer Preview." This version works just fine for installing linux and running srcds. All of the directions below still apply.

The big difference is that it has ZFS as the native filesystem and can boot from it. They also removed some extras so the install will fit on a single CD, and it only comes with one desktop choice (no Java Desktop). It also partitions your whole drive as a single partition, so the partition warnings below don't apply. The install process is much simpler and the try-before-you-install CD boot feature is nice.

There is also a nifty hardware test tool now available that boots from a live CD and tells you if your system will be compatible with Solaris before you install. If it's not, it tells you where to get drivers. You can use this before installing Indiana but I don't know if it's results apply to the production release or not.

Note 11/09/2008:

The latest stable version of OpenSolaris as of today is called 2008.5. It comes on a live CD that boots to a fully working OS. ZFS is the default file system now. You can also download and build for yourself versions up to 2008.11.

I've tested everything in this tutorial to ensure that it works the same for this latest version of Solaris as before.

The Solaris team also now has a working version of the 64-bit Linux Kernel (2.6), but my installation still uses the 32-bit version. I haven't tested 2.6 support yet. The 32-bit CentOS tarball is still available and is still the version used in the Solaris BrandZ installation tutorial.

---------------------------------------------------------------

You can also go through sun.com’s “Get Solaris” page. This will allow you to download the current commercial version of Solaris but it may be out of sync with all of the directions linked below, since they come from the community portals on opensolaris.com.

You can get free DVDs in the mail from OpenSolaris.org, but this takes about 3 weeks. You can get free DVDs of the 11/06 release from Sun in about 3 days but, again, it’s not the correct revision.

The download is in five or six parts that have to be unzipped and then assembled using the copy command of your host. Instructions are on the download page. Then you can burn it to a DVD.
Sun’s download manager is nice if you have Java in your browser but not necessary.

Install Solaris

You don’t have to watch the videos, but they put a lot of work into them:

http://frsun.downloads.edgesuite.net/sun...index.html

If you’re not going to dual-boot you can skip most of what’s in the videos, pop in the DVD & boot. Answer all of the installation questions. Go get some coffee. Go get more coffee. Solaris takes longer to install than Ubuntu, (“Time compressed sequence” in the video is no exaggeration) but not as long as Vista, so that should tell you how much you need to brew.

If Solaris recognizes your network card, you’ll know because some of the setup questions will be about your network setup. If you’re watching, you’ll know early in the boot process, because one of the startup messages will look like this:

NOTICE: rge0 link up 100Mbps

If the install process recognizes your network card. For a home PC behind a cable modem/router, you can just skip all the questions about installing NIS, where your DHCP server is, etc, and it’ll find all that automatically just like Windows or Linux installs do.

Watch out for partitions: Solaris actually assumes you know a thing or two about your disk drive and asks you how big to make each partition. It doesn’t do the math for you, so if you’re a byte or two off you’ll have to do it again. The defaults are fine, but see the warning below when it’s time to install CentOS.

After Solaris installs and reboots (be sure to wait for the GUI login to start) and you log in for the first time, you’ll have your choice of desktop, then you’ll be asked to register. Use the login and password you created at sun.com when you downloaded the ISO image (or skip). This will also tell you if your network hardware is supported, btw. Registering sets up the automatic package management, which is nice but not Ubuntu-nice.

If your network hardware wasn’t detected and installed the first time, now’s the time to unzip and install your driver from above, then reboot. If you’re not sure choose “Network” from the Start menu (where it is and what the start menu is called depend on what desktop you chose). If you only see the network adapter lo0 that’s the loopback adapter—Solaris didn’t see your hardware.

Make sure your box can see the outside world before proceeding. Ping something, visit a website, or actually register Solaris to check.

If the installer did recognize your network card but you’re still not seeing the outside world, you may need to make some configuration changes. From the Start menu, choose “Administrative Functions” and then “Network” (these may be different depending on the desktop you’re using). You may have to make sure you have DHCP turned on. That should trigger your machine to get an IP address from your router. It should also trigger the population of the “DNS Server” field with the root address of your router. If not you may have to add it. The same tool applies if you’ve divided your network into subnets, etc.

Once it's all working, be sure to run "ifconfig -a" in a terminal window and get the exact name of your network adapter since you'll need to set the network adapter of the lx zone to the same thing, below.

Get Linux and Install a Linux Branded Zone

You should download the CentOS tarball first, validate that it’s all there (tar –tvv), and then proceed with the following instructions. The CentOS tarball is not on the Solaris DVD even though the packages to support Linux are all installed from the DVD by default. Some people have reported trouble with tarball at the link below:

http://opensolaris.org/os/community/brandz/downloads

You can also use an ISO image or CD of RedHat 3 or the corresponding CentOS release, but the tarball is the easiest way to go.

Pop open a terminal window, become superuser, and follow these instructions:

http://www.opensolaris.org/os/community/brandz/install/

Now is a good time to refill the coffee you got above.

5) Considerations Before Moving Forward

IP Address & configuration inside the Zone

The IP address you assign to your lx Zone will be more or less permanent. Make sure it’s in the same range as the ones your router assigns, but high enough that your router will never auto-assign it to another PC on your LAN. You also have to use the “slash” notation when you assign your zone’s IP address: 192.111.0.155/24, where the /24 refers to the number of bits in the netmask. Don’t worry. 24 almost always works, and if you want to geek out about it you can read more here:

http://www.zytrax.com/tech/protocols/ip-...html#slash

Configure your router for the IP address of the ZONE, not the host

Put the IP address you assigned to your lx Zone in your router and then forward srcds’ port (27015 by default) to it, not the IP address of the host Solaris box. This is a nifty feature because no matter how often you reboot your Solaris host, and no matter how often your router assigns a new IP to it, your Linux zone will always have the same IP address and it’ll match the one in your router.

If you’re behind a home router, put the address of your router in /etc/sysconfig/network (as a “GATEWAY” entry), and put the IP address of your DNS host in /etc/resolv.conf (as a “nameserver”)

Both of these files are inside the zone, and look like this:

$ cat /etc/sysconfig/network
NETWORKING="yes"
HOSTNAME=linux
GATEWAY=192.168.0 .1

$ cat /etc/resolv.conf
nameserver xx.xx.0.1

You may have to get your DNS host's IP address from your ISP. Sometimes your router's admin page will show it as well.

Otherwise, your lx zone will see the outside world by ip addresses but won’t be able to resolve domain names. The alternative is to enter a line-item for every server you want to talk to in /etc/hosts, which gets old.

Test the net connection of the Zone

Ping something from inside your zone to make sure it works. You can even directly ssh into it from outside if everything works. No need to ssh into the host Solaris Zone first once the lx Zone is up and running.


Disk Space -- watch out where you create lxroot

The example in the BrandZ install page shows creating the root directory for your new zone in /export/my-zone_root. However, the default Solaris installation only partitions enough space in / to hold the Solaris install and not much else. If you put your Linux root here you’ll run out of space while extracting the tarball. Be sure to put it in your biggest partition; by default that’s not /export but /export/home. That's not always obvious when you watch Solaris install.

Create a user in the lx Zone, or you'll be running srcds as root

The srcds experts frown on running srcds as root. You can, but if someone ever hacks in via port 27015, finds a way to buffer-overflow srcds, etc. they’re in your box as root. It’s not as big a deal here since the zone is completely isolated. At the very least set a root password for your zone before you go any further.

6) Get and Install srcds inside the lx Zone

Log in to zone as described above, and then follow the instructions below:

http://www.srcds.com/db/engine.php?subac...0&archive=

Refresh your coffee as directed.

There’s no modifications needed to the excellent install instructions from srcds.com. It all just works.

Congratulations, you’re now running srcds from inside Solaris 10.

7) More things you can do inside the lx Zone

Automatically start & monitor srcds

Any Linux tool you can use to watch your processes should work in your lx Zone. There are a number of discussions here in the forums on how to do this.

To start srcds when the lx zone boots, you can add an entry to rc.local:

http://forums.srcds.com/viewtopic/921

And to monitor your server in progress, you can follow the instructions here to add a monitor to crontab:

http://forums.srcds.com/viewtopic/3098

This checks every few minutes to see if it's running. It works like a charm.

You can also put cron jobs in the root solaris machine to monitor things like your UPS or network connection. You can write scripts like the ones above and put them in cron on the parent solaris box.

Install Mani Admin Plugin

Mani works as advertised. The tutorials and help on the srcds.com forums was better than the help I found at the mani forums, though. Thanks to everyone here for the information.

Supposedly, Mani is a bigger resource hog than some of the other admin plugins like Sourcemod or SourceMM, but I haven't tried them yet.

8) More things you can do on the host Solaris box

Automatically start & monitor the lx Zone

You can auto-start your Linux Zone when your Solaris box boots. When working through the zonecfg commands, above, add

autoboot=true

before executing the "commit" command. You can also come back and add this later.

Automatically monitor host hardware

As mentioned above, Solaris has fault-monitoring tools that currently support AMD hardware. I’ll update this tutorial as soon as something fails (or I make something fail) and I’m sure it all works the way I think it should. For now I'm just using simple cron jobs.

9) How to get more help

More help with BrandZ:

http://www.opensolaris.org/jive/forum.jspa?forumID=83

More help with srcds on Linux:

http://forums.srcds.com/viewcat/6

How to brew coffee:

http://www.howtobrewcoffee.com/

(I didn’t put that link in the summary because I want to see how many of you actually read this far)

Everything described above also works by installing Solaris in a VMWare image. It makes no long-term sense to run a virtual machine (lx BrandZ) inside a host (Solaris) inside another virtual machine (VMWare) on a Windows box. I only did this first to play around with Solaris and make sure it all works before wiping out my physical hardware for Solaris. It does all work, and it’s a good way to try all this out before committing it to hardware.

10) See srcds on Solaris in action

Play on a Solaris-hosted srcds server

The Ace of Spades server is at 76.92.198.60:27015. Stop by and see what we're playing.

Report any problems with the Ace of Spades server to our Forum:

http://www.aceofspades27.proboards52.com/

Go to the “Server Information/Rules” Forum.

11) ACK

Many thanks to the folks on the Linux forums here and especially at the OpenSolaris.org BrandZ discussion forums for all of their help in setting up and running my server.

Thanks to {(.:A.o.S:.)}Byte, {(.:A.o.S:.)}FNDR.Dogmeat, and ±(€-Ų)± UltimaRage for beta-testing the srcds-on-Solaris CS:S server.

As I modify and improve my server setup, I’ll modify this tutorial. I’m probably going to add an HL2DM server in the near future. If there are any bugs, crashes, or showstoppers I’ll report them in the srcds Linux forum and update the tutorial.

--DFA

REVISION HISTORY:

4/26/07 Forgot to cite my source for Solaris history
5/3 Added more network configuration information
6/5 Updated Mani admin plugin information
7/4 Updated crontab and auto-boot information, udpated Mani information.
7/5 Updated DNS information, and the IP address of our server
7/14 Updated Mani admin plugin and cron job information
11/20 Added note about Project Indiana & Check Tool
2/9/08 Added information on Project Indiana & more networking info
11/9 Updated with information on Solaris 2008.5.


{(.:A.o.S:.)}FNDR.Death From Above
Ace of Spades Clan
http://www.aceofspades27.proboards52.com

This post was last modified: 11-10-2008 03:59 PM by AoS.DeathFromAbove.

04-26-2007 11:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Drocona
Forum admin
*******


Posts: 4,661
Group: Administrators
Joined: Mar 2005
Status: Offline
Post: #2
RE: TUTORIAL:  How to set up and run srcds under Solaris 10

Great job AoS.DeathFromAbove, this is greatly appreciated.
I'm sure a lot of people find it very usefull.

thanks for the hard work!


Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
04-26-2007 07:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
AoS.DeathFromAbove
Junior Member
**


Posts: 17
Group: Registered
Joined: Apr 2007
Status: Offline
Post: #3
RE: TUTORIAL:  How to set up and run srcds under Solaris 10

Hey, just to update everybody, the Solaris box is still going strong.

To celebrate, we're having a contest and giving away a free T-shirt to this month's top scorer!  Visit our website for details:

http://aceofspades27.proboards52.com/ind...1181051278

Thanks for all the help everyone here at srcds.com has given me in getting this set up.

--DFA


{(.:A.o.S:.)}FNDR.Death From Above
Ace of Spades Clan
http://www.aceofspades27.proboards52.com

06-05-2007 11:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Wrecked
Junior Member
**


Posts: 5
Group: Registered
Joined: Feb 2007
Status: Offline
Post: #4
RE: [Linux/Unix]: How to set up and run srcds under Solaris 10

thanks for this Smile
my collegue told as I don't have any linux experience, i should try solaris, cuz its the thing.
but i dont have solaris, using ubuntu and i'll try to set it up there, and maybe then i'll switch back to solaris.

thanks mate!

11-09-2008 08:19 AM
Find all posts by this user Quote this message in a reply
AoS.DeathFromAbove
Junior Member
**


Posts: 17
Group: Registered
Joined: Apr 2007
Status: Offline
Post: #5
RE: [Linux/Unix]: How to set up and run srcds under Solaris 10

Wrecked Wrote:
thanks for this Smile
my collegue told as I don't have any linux experience, i should try solaris, cuz its the thing.
but i dont have solaris, using ubuntu and i'll try to set it up there, and maybe then i'll switch back to solaris.

thanks mate!


Thanks.

There's a new version of Solaris out now, Solaris 2008.5.

I have scrds running under Solaris 2008.5 now. Everything's pretty much the same as I documented above. I just edited the tutorial with the latest info on this release.

--DFA


{(.:A.o.S:.)}FNDR.Death From Above
Ace of Spades Clan
http://www.aceofspades27.proboards52.com

This post was last modified: 11-10-2008 04:02 PM by AoS.DeathFromAbove.

11-10-2008 10:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: