I have a cat named Mittens. Now that you are bonded with it please login or register so that I dont have to eat him for dinner.

Current time: 07-29-2010, 10:38 PM Hello There, Guest! (LoginRegister)

This ad will disappear when you log in.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run srcds On Linux
Author Message
JulioGarcia Offline
FAEG

Posts: 431
Joined: May 2009
Post: #1
gmod How to run srcds On Linux
Garry's Mod doesn't have any native Linux server support, but fortunately, it is very easy to create a garrysmod server on any one of a number of UNIX like operating systems of your choice.
This configuration document was written for FreeBSD 7.0 although the same should apply for any UNIX-like system that can run wine.
Linux 2.6 works very well, pick whichever distribution you want.
FreeBSD 7.0, 7.1 and up works very well
NetBSD 5.0 works very well and is a very small installation. http://www.netbsd.org/
OpenBSD 4.5 has not been tested but is expected to work. http://www.openbsd.org/
Nexenta has not been tested.
Mac OS X has not been tested and is probably overkill for a dedicated server if you just want to run a Gmod server. It would probably work, though.
Solaris, OpenSolaris should work fine, make sure it is x86 and use a later version of Solaris 10 or OpenSolaris for best performance.
Minix - not tried it but it should work too if you really want to get your hands dirty in the process :D
I expect to be able to get it running on ReactOS in the next few months. http://www.reactos.org/
- Server requirements:
* X (make sure you also have "Xvfb" installed if you wish to disconnect from the server and let it run without X running)
* sshd
* wine
* x86 compatible processor with SSE
- Download the installer for srcds and copy it to your server. If wget is installed on your server, you can use:
$ wget "http://www.steampowered.com/download/hldsupdatetool.exe"
- Run it using the command:
$ wine hldsupdatetool.exe
- When running the above installer, it will need an X server to output the installation dialog box to. The easiest solition is: if you are accessing the server via ssh from another UNIX or Linux machine, use the "-Y" option to ssh (e.g: ssh -Y user@10.0.0.1). You may then run the above command and the window will be tunnelled over the ssh connection and opened on the desktop of your computer instead.
- When the installer has finished, assuming you chose to install into "C:\srcds", your srcds directory will be available at "/home/user/.wine/drive_c/srcds"
- You can now change into this directory and run:
$ wine hldsupdatetool -command update -game garrysmod -dir .
- This will download the garrysmod content.
- To start the server, change into "/home/user/.wine/drive_c/srcds/orangebox" and run:
$ WINEDEBUG=-all wine srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 10 etc
- This command will open a window on your desktop machine and the server will start up.
- If you have a command line only server, or you want to disconnect from the server and allow it to continue on its own without displaying the srcds console, you will need to run the following commands on the server before you run srcds.exe:
$ Xvfb :1&
$ export DISPLAY=:1
$ cd /home/user/.wine/drive_c/srcds/orangebox
$ WINEDEBUG=-all wine srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 12 +ip 192.168.1.66 +sv_lan 0 +hostname "My UNIX server" +sv_defaultgamemode "LightRP" -autoupdate &
- Xvfb is an X server which accepts connections from applications (such as wine GUI apps) and draws them into RAM rather than Video Memory. The result is that you do not see the output and you do not have to waste resources displaying the srcds console. - This saves us having to run the real X server when all you really need is something to stop the command from complaining that there is no X server to connect to.
- How do you view the console? You don't, at least not until someone writes a lua addon that allows ssh-ing in on a different port to directly access console output (anyone want to take this on?)
- I have bash scripts in my home directory which when executed, run the above commands. Remember to put "#!/bin/bash" as the first line of the text file and to make it executable using chmod +x <filename>.
Here is an example of what the script may look like:
#!/bin/bash
export DISPLAY=:1
cd /home/user/.wine/drive_c/srcds/orangebox && WINEDEBUG=-all wine srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 12 +ip 192.168.1.66 +sv_lan 0 +hostname "My UNIX server" +sv_defaultgamemode "LightRP" -autoupdate &
- Make sure that you have run
Xvfb :1&
once before running the script. It would be useful to put this into one of your server's startup scripts to avoid having to run it each time you start the server.
- Finally, make sure that you put an "&" character after your "wine srcds.exe ... ... ..." command to send it into the background. You can then press Ctrl-D to disconnect the ssh session and leave the server running.
- WINEDEBUG -all switches off wine's error output, speeding up wine significantly.
- To shut down the server, either use
rcon quit
from within the game, or on your UNIX system, type:
ps ax
Find the process id <pid> of srcds.exe, and kill it using
kill -15 <pid>
Good luck!

A witty saying proves nothing.


[Image: pedobear432313.gif]

Check out my forum!
Click here you silly!
BITCH! DO IT ^
05-31-2009 08:43 PM
Visit this user's websiteFind all posts by this user Quote this message in a reply
FLUFFY!
Guest!

 
Post: #2
RE: How to run srcds On Linux
This is why i hat Linux.
06-17-2009 02:00 PM
Quote this message in a reply
DiscoBiscuit Offline
Administrator
*****

Posts: 559
Joined: May 2009
Post: #3
RE: How to run srcds On Linux
wat

[Image: oteyj7.png]
06-17-2009 03:28 PM
Visit this user's websiteFind all posts by this user Quote this message in a reply
JulioGarcia Offline
FAEG

Posts: 431
Joined: May 2009
Post: #4
RE: How to run srcds On Linux
Harder than hell >.<
Thats wai i liek windowz

A witty saying proves nothing.


[Image: pedobear432313.gif]

Check out my forum!
Click here you silly!
BITCH! DO IT ^
(This post was last modified: 07-02-2009 03:03 AM by JulioGarcia.)
07-02-2009 03:03 AM
Visit this user's websiteFind all posts by this user Quote this message in a reply
TheByrus Offline
Member
*

Posts: 1
Joined: Aug 2009
Post: #5
RE: How to run srcds On Linux
Thanks a lot for the post. This has actually helped me a quite a bit since I don't have the option to run a Windows server. (Nor do I really want to anyway). I just wish we could get some Linux binaries for Gmod finally and get this struggle over with x.x I gotta say I was actually very surprised that such a popular mod didn't have a Linux version to begin with. But whatever. Garry will do what he does and eventually we can hope for a Linux version to make life much simpler for those who have to/want to use it.
08-22-2009 09:10 PM
Find all posts by this user Quote this message in a reply
JulioGarcia Offline
FAEG

Posts: 431
Joined: May 2009
Post: #6
RE: How to run srcds On Linux
I Agree, My friend had to host a server from a Linux machine, Omfg Lua fail
He hosted Darkrp, But its lua died and ½ of the menus didn't work either

A witty saying proves nothing.


[Image: pedobear432313.gif]

Check out my forum!
Click here you silly!
BITCH! DO IT ^
10-15-2009 05:00 AM
Visit this user's websiteFind all posts by this user Quote this message in a reply
cakeguy Offline
is a fag
*

Posts: 48
Joined: Jun 2009
Post: #7
RE: How to run srcds On Linux
can't u just download the one for it *cry*

[Image: style3,Cake.png]

Fagz
11-03-2009 09:08 PM
Find all posts by this user Quote this message in a reply
Post Reply