Linux GSM: Creating Call of Duty 2 server with mods on OVH Debian VPS

Published: 04/10/2021

Installing the CoD2 server with LinuxGSM

I came into an error when running:

  • ./cod2server install

Installing Call of Duty 2 Server
=================================
verifying cod2-lnxded-1.3-full.tar.xz with MD5...OK
extracting cod2-lnxded-1.3-full.tar.xz...tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
FAIL

To solve this I had to install xz-utils:

  • apt-get install xz-utils

After this I ran again the installation:

  • ./cod2server install

Everything went smooth.

Modding the CoD2 server with LinuxGSM and zPAM

I wanted to install the zPAM mod in my server. Apparently LinuxGSM does not support mods. So you have to follow a tricky path.

The mod I chose is the zPAM v3.1 beta6 cause it looks well done, updated, mantained and expecially open source.

This is what I had to do:

  • sudo su -
  • cd /home/cod2server/lgsm/config-lgsm/cod2server
  • nano common.cfg

This config file allows us to overwrite the settings issued by the default server configuration.

I added here some lines like this:

  • defaultmap="mp_burgundy"
  • maxplayers="16"
  • startparameters="+set sv_punkbuster 1  +set fs_basepath ${serverfiles} +set fs_game "mods/zpam310_beta6" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}"

Then, with my cod2server user:

  • sudo su - cod2server
  • ./cod2server restart

If this does not work you can try to edit the file "_default.cfg" instead. Initially I thought I had to do so, but then I discovered that "common.cfg" will overcome the settings coming from "_default.cfg" so in order to avoid problems I followed that path. Better not to edit the default configs if possible.

"_default.cfg" is the default configuration loaded for our CoD2 Server. Comments in the file say that it will be overwritten automatically but it doesn't seem to do so.

The important part is:

  • set fs_game "mods/zpam310_beta6" (or whatever folder to enable your mod)
  • set sv_punkbuster 1 (or set to "0" if you want to disable it)

Updating Punkbuster

So in this Linux server I encountered a problem with Punkbuster because, when I enabled it, the server kicked me when playing in the gameserver because the Punkbuster versions between client and server were mismatching.

Moreover, apparently the server installed by LinuxGSM was running an old PB version.

Years ago it was possible to automatically update the punkbuster by running pb_sv_update in the server console. But this does not work anymore as EvenBalancce, the company who made PB, is not supporting CoD2 anymore. Same for the client files then, the PB Setup program was once used to keep the service updated, but this can't be done anymore, apparently.

The only way I found was to update both client and server PB files manually.

I had to trust what I found online of course, but seems it worked.

Linux Punkbuster server files

I found the files on PBBans website. No idea if the files can be trusted, I gave it a try since this is just a test VPS installation. I uploaded the files on this website and you can find them here:

So I went back on my VPS, if you run the following commands as root you will need to change owners and groups with chown afterwards.

Watch out because there are 2 different "pb" folders, don't ask me why.

  • /home/cod2server/.callofduty2/pb - the right one
  • /home/cod2server/serverfiles/pb - the wrong one, if you upload the files here they have no effect on the server, at least in my case.

Now you can run the following commands:

  • cd /home/cod2server/.callofduty2
  • cp pb pb_backup (copy the original folder as a backup)
  • cd pb
  • wget -O pb.zip https://www.gaminghouse.community/uploads/cod2/cod2_linux.zip
  • unzip pb.zip -d pb2 (unzip the files in another directory just to be sure)
  • mv pb2/* ./ (move pb2 files into pb)
  • if you ran wget as root, you'll need to change owner like this: chown -R cod2server:cod2server ./ (eventually the same on pb_backup)
  • if you want you can rm pb2
  • if you are still root, go with su - cod2server
  • ./cod2server restart

The Punkbuster files should now be updated. You can connect to your server and see if you get error messages.

Windows Punkbuster client files

You can download the files for Windows from our website:

Loading a Punkbuster config file for your server

If you are trying to setup the zPAM like me, the correct folder, as I mentioned above, where to put the pbsvuser.cfg (or whatever file it is) is "/home/cod2server/.callofduty2/pb" (in my case of course).

You can then edit your common.cfg (see above) in order to add a command like "+exec {$systemdir}/pb/pbsvuser.cfg" in the startup line.

  • startparameters="+set sv_punkbuster 1  +set fs_basepath ${serverfiles} +set fs_game "mods/zpam310_beta6" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap} +exec {$systemdir}/pb/pbsvuser.cfg"

Setting pb_sv_guidrelax

I searched online and this is what I found:

This setting was added to server version 1.011 to set options for the locked-down guid system. This setting is cumulative based on adding the values for the conditions desired: 1=UNKN Guid, 2=WRONGIP Guid, 4=DUPLICATE Guids. The current default for this setting is 7 (1+2+4) which means that PB will not kick (relax kicking) for any of the three cases. We recommend kicking for at least UNKN guids. Below are the possible combinations:

  • 0 = Will kick ALL (UNKN guid, wrong ip guid and duplicate guid)
  • 1 = Kick for wrong ip guid and duplicate guid.
  • 2 = Kick for UNKN guid, and duplicate guid.
  • 3 = Kick for duplicate guid.
  • 4 = Kick for UNKN guid and wrong ip guid.
  • 5 = Kick for wrong ip guid.
  • 6 = Kick for UNKN guid
  • 7 = Don't kick for UNKN guid, wrong ip guid and duplicate guid (kick no one).

example: pb_sv_guidrelax 7 will prevent your server from kicking players using the same cd keys or using cracked cd keys.

Installing SFTP client to browse files more easily

In order to browse server files easily I decided to install an SFTP server on my Debian VPS. I followed this guide from vitux.com. Maybe because of my lack of experience but I also had to install "ufw" to open TCP ports 20 and 21 to allow SFTP connections.

Basically I installed the vsftpd Debian package and enabled it with systemctl. If you follow the mentioned guide all should work fine.

Then of course I used Filezilla as a client on my PC to connect and browser files and folders.

Conclusions

This was quite a hard work but it was the first time I tried and it was also fun and interesting.

Let me know in the comments if this worked for you, or send me an email if you need some help. You can also find me on Steam, Reddit, or Discord.

Comments

All comments will be subject to approval after being sent. They might be published after several hours.

*
*