Making a dedicated Battlefield 2 server for Linux using FreeBSD. First of all, you need a decent server. My Proliant dual 500 wasn’t enough, it crashed with an Illegal Exception error. I tried it with a single proc 933 with 2GB RAM. This worked. Start by downloading the BF2 server files. There is a mirror list at http://www.eagames.com/official/battlefield/battlefield2/us/downloads.jsp. If you just want to start downloading take this link: http://server13.download.filefront.com/lixcsqangi+/pub2/Battlefield_2/Official_Server_Files/Dedicated_Server/bf2-linuxded-1.1.2484.0-installer.zip Keep in mind that links might change, and this could go 404. Once fetched you need to unzip the file with 'unzip '. In this case: unzip bf2-linuxded-1.1.2484.0-installer.zip You will keep a shell file, bf2-linuxded-1.1.2484.0-installer.sh. Chmod it so it can be executed with 'chmod 755 bf2-linuxded-1.1.2484.0-installer.sh' or 700 if you don’t want others to be able to read the file. Execute the file by typing './bf2-linuxded-1.1.2484.0-installer.sh'. You will need to agree with 2 license agreements, one of DICE, the game creators, and one of punkbuster. After this it will ask you an installation directory, just give any full path where you want to install the game, i.e.: /home/yourusername/bf2ded. Now you can continue with the Linux base installation. You need a Linux emulator for the libraries, I use the suse 9.3 port because I heard this one has been used before (the Utternerd BF2 servers). You will need two extra libraries that are default not installed in the suse port, namely libgcc and libstdcxx. For the libgcc you need a patch because the ports seem to be bugged for some reason. The libgcc isn’t a default option. Beneath is the patch. Copy/paste this in /usr/ports/emulators and name it something (like suse.patch). You could also fetch the patch from http://www.in-nomine.org/~asmodai/suse93.patch. But since this is not my site, the link could go 404. <-- start copy here--> diff -ruN /usr/ports/emulators/linux_base-suse-9.3/distinfo linux_base-suse-9.3/distinfo --- /usr/ports/emulators/linux_base-suse-9.3/distinfo Wed Jul 20 18:42:54 2005 +++ linux_base-suse-9.3/distinfo Thu Sep 1 15:43:25 2005 @@ -44,8 +44,6 @@ SIZE (rpm/i386/suse/9.3/rpm-4.1.1-208.i586.rpm) = 2181671 MD5 (rpm/i386/suse/9.3/termcap-2.0.8-879.i586.rpm) = 6e4e4fcf574e00605f5125ee2b37dd43 SIZE (rpm/i386/suse/9.3/termcap-2.0.8-879.i586.rpm) = 57820 -MD5 (rpm/i386/suse/9.3/compat-gdbm-1.8.0-5.i586.rpm) = 1d9d7555512976df295f2056e10035e0 -SIZE (rpm/i386/suse/9.3/compat-gdbm-1.8.0-5.i586.rpm) = 32236 MD5 (rpm/i386/suse/9.3/compat-2004.11.13-3.i586.rpm) = ac80e2fdec4d1b6ef38f3505bc7d68ee SIZE (rpm/i386/suse/9.3/compat-2004.11.13-3.i586.rpm) = 1477784 MD5 (rpm/i386/suse/9.3/libstdc++-3.3.5-5.i586.rpm) = 19c725c87caab2e2b7a441c4c46b2049 @@ -58,16 +56,14 @@ SIZE (rpm/i386/suse/9.3/imlib2-1.1.1-7.i586.rpm) = 204624 MD5 (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 9ac4f7cbf78f9cac45d6fc01b0947e9d SIZE (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 107928 -MD5 (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 9ac4f7cbf78f9cac45d6fc01b0947e9d -SIZE (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 107928 MD5 (rpm/i386/suse/9.3/freetype-1.3.1-1160.i586.rpm) = 01d0011e2933b341076f8ca7f5662f39 SIZE (rpm/i386/suse/9.3/freetype-1.3.1-1160.i586.rpm) = 276050 MD5 (rpm/i386/suse/9.3/freetype2-2.1.9-4.i586.rpm) = 9f29c01114914399b90ef9d70ec0da9c SIZE (rpm/i386/suse/9.3/freetype2-2.1.9-4.i586.rpm) = 517975 MD5 (rpm/i386/suse/9.3/fontconfig-2.2.99.20050218-8.i586.rpm) = ef11d39caa92131a4d21b57069ba7c5d SIZE (rpm/i386/suse/9.3/fontconfig-2.2.99.20050218-8.i586.rpm) = 169707 -MD5 (rpm/i386/suse/9.3/xorg-x11-libs-6.8.2-30.2.i586.rpm) = bf172532bb283a38b4a03863754443c3 -SIZE (rpm/i386/suse/9.3/xorg-x11-libs-6.8.2-30.2.i586.rpm) = 2863557 +MD5 (rpm/i386/suse/9.3/xorg-x11-libs-6.8.2-30.i586.rpm) = 157af92553ef427871b9831110c12ec3 +SIZE (rpm/i386/suse/9.3/xorg-x11-libs-6.8.2-30.i586.rpm) = 2861024 MD5 (rpm/i386/suse/9.3/xorg-x11-Mesa-6.8.2-30.i586.rpm) = 7dc81ae384f3e922acbd5fe5b7cf34fe SIZE (rpm/i386/suse/9.3/xorg-x11-Mesa-6.8.2-30.i586.rpm) = 8295266 MD5 (rpm/i386/suse/9.3/giflib-4.1.3-5.i586.rpm) = c6fe303ab52707a477beb4f4f76ccbcc @@ -78,10 +74,6 @@ SIZE (rpm/i386/suse/9.3/libmng-1.0.9-4.i586.rpm) = 158448 MD5 (rpm/i386/suse/9.3/libpng-1.2.8-3.i586.rpm) = ba1f3162f4c1345038210f0fb5b5fe23 SIZE (rpm/i386/suse/9.3/libpng-1.2.8-3.i586.rpm) = 177563 -MD5 (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 9ac4f7cbf78f9cac45d6fc01b0947e9d -SIZE (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 107928 -MD5 (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 9ac4f7cbf78f9cac45d6fc01b0947e9d -SIZE (rpm/i386/suse/9.3/libtiff-3.7.1-7.2.i586.rpm) = 107928 MD5 (rpm/i386/suse/9.3/SDL-1.2.8-4.i586.rpm) = d0507d45533e2ef3b363f5caef60affd SIZE (rpm/i386/suse/9.3/SDL-1.2.8-4.i586.rpm) = 199261 MD5 (rpm/i386/suse/9.3/openmotif21-libs-2.1.30MLI4-124.i586.rpm) = 40fcbf4a53614466318a6a7eb018e98a @@ -90,8 +82,6 @@ SIZE (rpm/i386/suse/9.3/openmotif-libs-2.2.3-11.i586.rpm) = 1175534 MD5 (rpm/i386/suse/9.3/gnome-filesystem-0.1-211.4.i586.rpm) = 0c196574ca0c7513de8c274dbc8f8681 SIZE (rpm/i386/suse/9.3/gnome-filesystem-0.1-211.4.i586.rpm) = 24529 -MD5 (rpm/i386/suse/9.3/glib-1.2.10-593.i586.rpm) = 3ff2326165e48f16f7e824dfd9f326c6 -SIZE (rpm/i386/suse/9.3/glib-1.2.10-593.i586.rpm) = 116950 MD5 (rpm/i386/suse/9.3/glib2-2.6.3-4.i586.rpm) = 71a28026ecedd0b0a1b2501d8380f56c SIZE (rpm/i386/suse/9.3/glib2-2.6.3-4.i586.rpm) = 498935 MD5 (rpm/i386/suse/9.3/gtk-1.2.10-885.i586.rpm) = 6b66523f81287ac0e9bfa2b2bc0ff89d @@ -128,3 +118,5 @@ SIZE (rpm/i386/suse/9.3/setserial-2.17-580.i586.rpm) = 24031 MD5 (rpm/i386/suse/9.3/arts-1.4.0-10.i586.rpm) = 37cfd45f86faa3cec9d9347ab648745d SIZE (rpm/i386/suse/9.3/arts-1.4.0-10.i586.rpm) = 1254193 +MD5 (rpm/i386/suse/9.3/libgcc-3.3.5-5.i586.rpm) = 44de8b72646bb60245ad57c045f06e19 +SIZE (rpm/i386/suse/9.3/libgcc-3.3.5-5.i586.rpm) = 52308 diff -ruN /usr/ports/emulators/linux_base-suse-9.3/files/rpmlist.conf linux_base-suse-9.3/files/rpmlist.conf --- /usr/ports/emulators/linux_base-suse-9.3/files/rpmlist.conf Wed Jul 20 18:42:54 2005 +++ linux_base-suse-9.3/files/rpmlist.conf Thu Sep 1 15:43:25 2005 @@ -34,7 +34,7 @@ freetype1|freetype-1.3.1-1160.i586.rpm|optional|off freetype2|freetype2-2.1.9-4.i586.rpm|optional|off fontconfig|fontconfig-2.2.99.20050218-8.i586.rpm|optional|off -xorglibs|xorg-x11-libs-6.8.2-30.2.i586.rpm|optional|off +xorglibs|xorg-x11-libs-6.8.2-30.i586.rpm|optional|off xorgmesa|xorg-x11-Mesa-6.8.2-30.i586.rpm|optional|off sdl|SDL-1.2.8-4.i586.rpm|optional|off openmotif21|openmotif21-libs-2.1.30MLI4-124.i586.rpm|optional|off @@ -59,3 +59,4 @@ kdelibs|kdelibs3-3.4.0-20.5.i586.rpm|optional (15 MB)|off setserial|setserial-2.17-580.i586.rpm|optional|off arts|arts-1.4.0-10.i586.rpm|optional|off +libgcc|libgcc-3.3.5-5.i586.rpm|optional|off <-- stop copy here--> Remove the linux_base-suse-9.3 port in /usr/ports/emulators and cvsup, just to be sure you have the latest version and you don’t have leftovers from some previous failed attempt. It might be smart to also delete the /var/db/ports/linux_base/options file, to have a clean start. Now that you have a clean suse 9.3 port and you have the patch file in /usr/ports/emulators. Now do the following: cd /usr/ports/emulators patch -p0 < suse93.patch cd linux_base-suse-9.3 make install clean You will get a GUI screen giving you the option to (de)select some libraries etc for the port. Be sure to select the libgcc and libstdcxx! Once its done, clean up the patch. rm ../suse93.patch After this BF2 won’t run yet, because it’s 'missing' ld-linux.so.2. This is not true however, it's just a symlink to ld-2.3.4.so. The problem is in some other library, which I found out when I looked into the start.sh, it redirects to the bin directory, and runs the bf2 executable. After I typed 'ldd bf2' it came with the following output: bf2: libz.so.1 => /lib/libz.so.1 (0x28902000) libncurses.so.5 => /lib/libncurses.so.5 (0x28913000) libdice_py.so => not found libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x28959000) libm.so.6 => /lib/libm.so.6 (0x28a17000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x28a3a000) libc.so.6 => /lib/libc.so.6 (0x28a42000) libdl.so.2 => /lib/libdl.so.2 (0x28b5c000) libpthread.so.0 => /lib/libpthread.so.0 (0x28b61000) /lib/ld-linux.so.2 (0x288e8000) You can see the libdice_py.so is missing. This library can be found in your BF2 bin dir. All you need to do is make a symlink from /compat/linux/lib/ to this library in your bf2/bin dir. I.e.: ln -s /home/yourusername/bf2/bin/libdice_py.so /compat/linux/lib/libdice_py.so After this, you're finished and can start configuring your BF2 server by editing the serversettings.con. Remember to open the right ports on your firewall, otherwise your server won't show up in the lists and players won't be able to connect. The list of needed ports can be pull of the EA website, http://www.eagames.com/official/battlefield/battlefield2/us/editorial.jsp?src=communityupdate_061405 Good luck! /Niels