# HOWTO: Install and setup Wolfenstein Enemy Territory



## tangram (May 5, 2009)

*Update 26/03/2012:*
Step 3 is no longer required as the port as a specific dependency on linux-f10-xorg-libs. 
*Update 25/05/2012:*
Ever since EvenBalance stopped supporting Enemy Territory step 5 should be ignored. Please refer to HowTo: Get etkey and Punbuster files on Enemy Territory.
________________________________________________________________________

Wolfenstein: Enemy Territory is a free multiplayer FPS that takes place in the World World II pitting two teams (Allies and Axis) against each other for victory.

The game was originally going to be a retail expansion pack for Return To Castle Wolfenstein but the project was canceled, Activision however decided to release it during 2003 for free.

In this post I'll detail the steps required to install and update Enemy Territory, the ET Pro mod, PunkBuster and XQF on FreeBSD.

*1) Install and update Enemy Territory*

Become the superuser:


```
% su
```

And install the required port:


```
# cd /usr/ports/games/linux-enemyterritory
# make install clean
```

This will pull Enemy Territory's installer from the web. If any port options pop up stick with the defaults and choose OK to continue.

If you don't have the Linux Compatibility Environment proceed to step 2, otherwise jump to step 3.

*2) Enable the Linux Compatibility Environment*

Enemy Territory needs both FreeBSD's Linux kernel module and near-minimal installation of a Linux distribution. By default, FreeBSD 7.x uses Fedora Core Linux 4.

The games/linux-enemyterritory pulls in emulators/linux_base-fc4 so we just need to load the Linux kernel module at boot time. To do so run:


```
# echo 'linux_enable="YES"' >> /etc/rc.conf
```

*3) Fixing library issues*

It was verified that at times library issue crop up upon starting the game. 

To check if you have a library issue run:


```
# ldd /usr/local/lib/enemyterritory/et.x86
```

If the output is:


```
# ldd /usr/local/lib/enemyterritory/et.x86
/usr/local/lib/enemyterritory/et.x86:
        libdl.so.2 => /lib/libdl.so.2 (0x281e4000)
        libX11.so.6 => not found
        libXext.so.6 => not found
        libm.so.6 => /lib/obsolete/linuxthreads/libm.so.6 (0x281e9000)
        libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x2820f000)
        /lib/ld-linux.so.2 (0x281c7000)
```

You have library issues and need to install x11/linux-xorg-libs:


```
# cd /usr/ports/x11/linux-xorg-libs ; make install clean
```

Re-run [cmd=]ldd[/cmd] and you should have the following output:


```
# ldd /usr/local/lib/enemyterritory/et.x86
/usr/local/lib/enemyterritory/et.x86:
        libdl.so.2 => /lib/libdl.so.2 (0x281e6000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x281eb000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x282be000)
        libm.so.6 => /lib/obsolete/linuxthreads/libm.so.6 (0x282cd000)
        libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x282f3000)
        /lib/ld-linux.so.2 (0x281c7000)
```

*4) Install the ET Pro mod*

Next let's install Enemy Territory's best mod: ET Pro.


```
# cd /usr/ports/games/linux-enemyterritory-etpro
# make install clean
```

Now ET Pro will show under the Mods options in the games' main menu.

*5) Update PunkBuster*

Now start the game, create a player profile and quit. By doing so a .etwolf directory will be created in your home directory which includes a folder containing PunkBuster.

Point to http://www.evenbalance.com/index.php?page=pbsetup.php scroll down and follow the Linux download to download PunkBuster update application.

Change directory to where you've downloaded the pbsetup.run and:


```
# su
# chmod +x pbsetup.run
# exit
% cp pbsetup.run ~/.etwolf/pb
% ./pbsetup.run
```

PunkBuster will ask to fetch updates and prompt for a License Agreement. Afterwards point to "Add a Game option", choose Enemy Territory and its installation path.

On the main PunkBuster window click on Enemy Territory to select it and press "Check for Updates". Quit PunkBuster after updating it.

*6) Install XQF*

One can use the in game browser to search for server. However I recommend installing and using the XQF Game Server Browser as it a lot more flexible and complete:


```
# cd /usr/ports/games/xqf
# make install clean
```

XQF should identify the installed Enemy Territory so select the game and press "Update" to have XQF pull an updated server list.

*7) Fix sound issues*

ET uses Linux's OSS sound infrastructure so you might come across issues. Here's how to enable sound on Enemy Territory under FreeBSD 7.x:


```
% su
# sysctl hw.snd.compat_linux_mmap=1
# echo "hw.snd.compat_linux_mmap=1" >> /etc/sysctl.conf
# exit
```

With the above commands sound will be enabled immediately and also at boot time.

And we're done!

(The above HOWTO is a copy of my blog post)


----------



## neurosis (Jun 1, 2009)

Can anyone tell me why when I try to launch et I get the following error? 


```
et
./et.x86: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
```

I love the writeup! I just cant seem to get past this error. I am running  FreeBSD 7.2-RELEASE


----------



## ale (Jun 1, 2009)

neurosis said:
			
		

> Can anyone tell me why when I try to launch et I get the following error?
> 
> 
> ```
> ...



What is the brand of your gpu?
If nvidia, are you using a linux_base different than fc4 and/or compat.linux.osrelease > than 2.4.2?


----------



## tangram (Jun 1, 2009)

neurosis said:
			
		

> Can anyone tell me why when I try to launch et I get the following error?
> 
> 
> ```
> ...



I've also ran into this issue once. At the time I rebuild all my ports through `# portmaster -af` and didn't pin point the exact source of the issue.

Mind you that I use linux_base-fc4.


----------



## ale (Jun 1, 2009)

@tangram
Do you have x11/linux-xorg-libs installed


----------



## tangram (Jun 1, 2009)

V51!

(That means yes in Enemy Territory speak )


----------



## ale (Jun 1, 2009)

And do you have /usr/compat/linux/usr/X11R6/lib/libX11.so.6 ?


----------



## tangram (Jun 1, 2009)

`%  ldd /usr/local/lib/enemyterritory/et.x86`:

```
/usr/local/lib/enemyterritory/et.x86:
        libdl.so.2 => /lib/libdl.so.2 (0x281e6000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x281eb000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x282be000)
        libm.so.6 => /lib/obsolete/linuxthreads/libm.so.6 (0x282cd000)
        libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x282f3000)
        /lib/ld-linux.so.2 (0x281c7000)
```

`# locate libX11.so.6`:

```
/usr/compat/linux/usr/X11R6/lib/libX11.so.6
/usr/compat/linux/usr/X11R6/lib/libX11.so.6.2
/usr/local/lib/libX11.so.6
```

`% ls -l /usr/compat/linux/usr/X11R6/lib/libX11*`:

```
lrwxrwxrwx  1 root  wheel      13 Apr  2 12:37 /usr/compat/linux/usr/X11R6/lib/libX11.so.6@ -> libX11.so.6.2
-rwxr-xr-x  1 root  wheel  862428 Apr  2 12:37 /usr/compat/linux/usr/X11R6/lib/libX11.so.6.2*
```


@ neurosis

Run the same commands and post the results.


----------



## ale (Jun 1, 2009)

@tangram
maybe there was a misunderstanding...is et working for you?


----------



## tangram (Jun 1, 2009)

Of course it is (else I wouldn't post the HOWTO).

I did say that I once ran into the same problem and that I've since fixed it. At the time I fixed it by running `# portmaster -af` (yeah... I killed the fly with a cannon) and ET is running ever since.

The commands I've posted should help neurosis troubleshooting .


----------



## ale (Jun 1, 2009)

tangram said:
			
		

> Of course it is (else I wouldn't post the HOWTO).


Gosh, sorry!
I got confused twice. Probably I'm doing too many things together.


----------



## neurosis (Jun 1, 2009)

```
# ldd /usr/local/lib/enemyterritory/et.x86
/usr/local/lib/enemyterritory/et.x86:
        libdl.so.2 => /lib/libdl.so.2 (0x281e4000)
        libX11.so.6 => not found
        libXext.so.6 => not found
        libm.so.6 => /lib/obsolete/linuxthreads/libm.so.6 (0x281e9000)
        libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x2820f000)
        /lib/ld-linux.so.2 (0x281c7000)
```



```
# locate libX11.so.6
/usr/jails/web/usr/local/lib/libX11.so.6
```




```
# ls -l /usr/compat/linux/usr/X11R6/lib/libX11*
ls: /usr/compat/linux/usr/X11R6/lib/libX11*: No such file or directory
```


```
# pkg_info |grep linux_base
linux_base-fc-4_14  Base set of packages needed in Linux mode (for i386/amd64)
```


I see my issue must be in there somewhere. missing directory. I will look back later. I am pressed for time right at the moment.


----------



## ale (Jun 1, 2009)

Do you have x11/linux-xorg-libs installed ?


----------



## neurosis (Jun 2, 2009)

I installed the linux-xorg libs and et tries to start now. But now I get this error. 


```
...loading libGL.so.1: Initializing OpenGL display
...setting mode 4: 800 600
Using XFree86-VidModeExtension Version 2.2
XF86DGA Mouse (Version 2.0) initialized
XFree86-VidModeExtension Activated at 800x600
Using 8/8/8 Color bits, 24 depth, 0 stencil display.
X Error of failed request: BadMatch (invalid parameter attributes)
  Major opcode of failed request: 155
  Minor opcode of failed request: 5
  Serial number of failed request: 48
ERROR: couldn't create font (glGenLists)
GL_RENDERER: (null)
----- CL_Shutdown -----
RE_Shutdown( 1 )
-----------------------
----- CL_Shutdown -----
-----------------------
Sys_Error: Q_strncpyz: NULL src
```

Then it locks my screen in to a bad resolution.


----------



## ale (Jun 2, 2009)

Do you have _Load  "glx"_ in /etc/X11/xorg.conf, in the _Section "Module"_ part?
What is the brand of your gpu?
What is the output of _glxinfo | grep vendor_ and _glxinfo | grep render_ ?


----------



## neurosis (Jun 2, 2009)

I have the glx line in my xorg.conf

My gpu is nvidia. I am running the nvidia drivers "i believe" not sure how to make sure but I have the line 
	Driver      "nvidia"

in my xorg.conf as well. There is no splash screen as I am used to seeing however. 

I have no command glxinfo..  I get command now found.


----------



## ale (Jun 2, 2009)

Can you try starting X with `$ startx -- -logverbose 6` and add as attachment /var/log/Xorg.0.log ?


----------



## neurosis (Jun 2, 2009)

Ok... here it is. It was very big so I had to archive it.


----------



## ale (Jun 2, 2009)

This could be a problem:
	
	



```
(II) LoadModule: "glx"
(II) Loading /usr/local/lib/xorg/modules/extensions//libglx.so
(II) Module glx: vendor="X.Org Foundation"
        compiled for 1.6.1, module version = 1.0.0
        ABI class: X.Org Server Extension, version 2.0
(==) AIGLX disabled
```
If you installed the nvidia driver, the vendor should be NVIDIA.
In fact you have an error about that.

Maybe your driver is not correctly installed and/or your xorg.conf is not configured correctly.
I'd try removing the driver with _kldunload nvidia && pkg_delete -ix nvidia-driver_ and reinstalling again with _cd /usr/ports/x11/nvidia-driver && make install clean && kldload nvidia_.

Then read 
/usr/local/share/doc/NVIDIA_GLX-1.0/html/chapter-04-section-02.html
to check is xorg.conf is configured correctly or install and run x11/nvidia-xconfig.


----------



## neurosis (Jun 2, 2009)

I installed the nvidia driver from nvidia's site. Is it as simple to remove? Ive tried to remove it in the past with no luck unfortunately as I dont believe it comes with an uninstall option.


----------



## ale (Jun 2, 2009)

This is IMHO, one of the reasons why the port should be used.
If you want to remove it, try looking at [thread=2171]this thread[/thread].
Maybe another option could be reinstalling the same version again.

@tangram
sorry for polluting you howto with posts about xorg and driver configuration, hopefully a moderator could help moving them to a new thread


----------



## neurosis (Jun 2, 2009)

yes.. very sorry as well.  maybe if someone has this issue they can find it useful. 

(I figured this part out  )

Can we move this conversation somewhere else? Maybe to that other thread?


----------



## tangram (Jun 2, 2009)

@ale
No problem. We just need to solve this issue. It also happened to me a few months ago, now to neurosis and on the PC-BSD forum there are some posts stating the same kind of problems.

But yeah... hopefully a moderator can move slice and dice this thread .

@neurosis
That crash on ET as it starts up is most likely due to graphic drivers not being well installed. Try to deinstall NVIDIA's drivers and reinstall. There's an HOWTO on this forum subsection.


----------



## tangram (Jun 4, 2009)

I've just installed a fresh copy of FreeBSD with the X distribution to simulate the problem.

I've started with `# pkg_add -r linux-enemyterritory`, enabled Linux compatibility layer and ran `#  ldd /usr/local/lib/enemyterritory/et.x86` which gave me the same results as neurosis.

A simple `# pkg_add -r linux-xorg-libs` fixed the library problem.


----------



## neurosis (Jun 4, 2009)

Thanks tangram and ale! I Was able to get it working! I found that I did have a very bad Nvidia driver install and they were not working properly. The driver was difficult to get rid of but is working now. 

Tangram, I found the same. Once I installed the linux-xorg-libs the issue of the missing library went away. Maybe that should be added to the HOWTO.   Ive installed ET in past versions of FreeBSD and did not have this same issue. I am not sure what has changed. 

Thanks again. Too bad we cant get a moderator to clean the fat out of this thread now.  Sorry for making a mess in here.


----------



## DutchDaemon (Jun 4, 2009)

Who says 'we can't'? Can't remember you or anyone else asking.

If Tangram and Ale agree, I will simply cut off everything below the orginal HOWTO. Or move it off to a separate thread.


----------



## tangram (Jun 4, 2009)

I'll update the HOWTO referring the possible issue.

As for for the thread... I don't see much of a problem to let it be as it is. Maybe someone will appreciate the troubleshooting


----------



## dennylin93 (Jul 4, 2009)

tangram said:
			
		

> Point to http://www.evenbalance.com/index.php?page=pbsetup.php scroll down and follow the Linux download to download PunkBuster update application.



Should I download the GUI version or the command-line one?


----------



## ale (Jul 5, 2009)

The command-line one should be fine.


----------



## ale (Jul 5, 2009)

@tangram
A suggestion...
even if it's not caused by the et port, you could add an update about the problem using nvidia-driver with a linux_base > fc4


----------



## tangram (Jul 6, 2009)

dennylin93 said:
			
		

> Should I download the GUI version or the command-line one?



I usually use the GUI version. But it should work with the command line version also.


----------



## tangram (Jul 6, 2009)

ale said:
			
		

> @tangram
> A suggestion...
> even if it's not caused by the et port, you could add an update about the problem using nvidia-driver with a linux_base > fc4



I still use linux_base-fc4 so I haven't come across any issues. What does happen exactly?


----------



## ale (Jul 6, 2009)

It doesn't work! I've tested it since linux_base-fc6 was commited in the ports tree.
About a month ago, after some discussions in the freebsd-bugs ml and a thread in the nv forum, a temporary solution was found.
The solution is to download the linux driver. The version has to be the same of the installed FreeBSD driver. For example, I have nvidia-driver-180.60 installed from ports, so I had to download NVIDIA-Linux-x86-180.60-pkg0.run
Then the linux driver should be unpacked somewhere. 
Once done, /compat/linux/usr/lib/libnvidia-tls.so.180.60 should be replaced with NVIDIA-Linux-x86-180.60-pkg0/usr/lib/tls/libnvidia-tls.so.180.60 from the dir where the linux driver has been unpacked.
Nvidia said that they will ship a driver that install the correct version of the library. In the meanwhile, this is the solution.
I've tested it on CURRENT, where I had linux_base-f9 and now linux_base-f10.

Again, this is not an et problem, it's an Nvidia one. You can see the same using rtcw or other linux-games.


----------



## tangram (Jul 6, 2009)

I wasn't aware of that problem. Hope they fix the driver in time for the forthcoming FreeBSD 8.0 ports freeze.


----------



## inf3rno (Apr 25, 2020)

I got

```
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
```
and some

```
X Error of failed request: GLXBadContext
```

Looks like some sort of wine patch is required and it is not installed, at least I found this one: https://forums.freebsd.org/threads/...pengl-libraries-on-64-bit-freebsd-10-1.52217/ It is weird, I mean the game is native linux, why would I need wine for it?

edit:
Ohh mine error message does not contain any mention of wine but theirs does. I'll copy the whole message.


```
ET 2.60b linux-i386 May  8 2006
----- FS_Startup -----
Current search path:
/root/.etwolf/etmain
/usr/local/lib/enemyterritory/etmain/pak2.pk3 (22 files)
/usr/local/lib/enemyterritory/etmain/pak1.pk3 (10 files)
/usr/local/lib/enemyterritory/etmain/pak0.pk3 (3725 files)
/usr/local/lib/enemyterritory/etmain/mp_bin.pk3 (6 files)
/usr/local/lib/enemyterritory/etmain

----------------------
3763 files in pk3 files
execing default.cfg
couldn't exec language.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok

------- Input Initialization -------
Joystick is not active.
------------------------------------
Bypassing CD checks
----- Client Initialization -----
----- Initializing Renderer ----
-------------------------------
----- Client Initialization Complete -----
----- R_Init -----
...loading libGL.so.1: Initializing OpenGL display
...setting mode 4: 800 600
Using XFree86-VidModeExtension Version 2.2
XF86DGA Mouse (Version 2.0) initialized
XFree86-VidModeExtension Activated at 800x600
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Using 8/8/8 Color bits, 24 depth, 0 stencil display.
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 151
  Minor opcode of failed request: 3
  Serial number of failed request: 59
X Error of failed request: GLXBadContext
  Major opcode of failed request: 151
  Minor opcode of failed request: 5
  Serial number of failed request: 61
X Error of failed request: GLXBadContext
  Major opcode of failed request: 151
  Minor opcode of failed request: 26
  Serial number of failed request: 61
ERROR: couldn't create font (glGenLists)
GL_RENDERER: (null)
----- CL_Shutdown -----
RE_Shutdown( 1 )
X Error of failed request: GLXBadContext
  Major opcode of failed request: 151
  Minor opcode of failed request: 4
  Serial number of failed request: 65
-----------------------
----- CL_Shutdown -----
-----------------------
Sys_Error: Q_strncpyz: NULL src
```

I wonder if this is caused by the 800x600 resolution or something else? The screen is on 1920x1080 currently. I can add a config to the game, maybe that solves it.

edit2:

Ok it is definitely not the resolution. I'll try to look around maybe I find something. Linux topics write about this and it is caused by multiple opengl library installation and using the wrong one or something like that. I don't want to remove libGL.so.1 as they suggested, I somehow doubt it would work here, because I don't have multiple drivers with multiple opengl versions. I think I open a new thread, this one is pretty old.


----------



## inf3rno (Apr 26, 2020)

I needed 
	
	



```
pkg install linux-nvidia-libs
```
 too. Now it works!!!


----------



## skeletonboss12 (Jul 7, 2020)

does not launch

---- finished R_Init -----
Sys_LoadDll(/home/rudest/.etwolf/etmain/ui.mp.i386.so)...  
Sys_LoadDll(/home/rudest/.etwolf/etmain/ui.mp.i386.so) failed:
"/home/rudest/.etwolf/etmain/ui.mp.i386.so: cannot open shared object file: No such
file or directory"
Sys_LoadDll(/usr/local/lib/enemyterritory/etmain/ui.mp.i386.so)... ok
Sys_LoadDll(ui) found **vmMain** at 0x37013f40
Sys_LoadDll(ui) succeeded!
Received signal 11, exiting...
Shutdown tty console


----------



## skeletonboss12 (Jul 8, 2020)

Also cannot seem to use punkbuster with this method.

./pbsetup.run: error while loading shared libraries: libpng12.so.0: cannot open sh
ared object file: No such file or directory

I do have linux-c7-libpng installed as well as linux compatibilityenabled and its modules loaded


----------



## skeletonboss12 (Jul 8, 2020)

Okay so I am using the cmd line version of pbsetup.run now, however either this script or i am confused about the path,

It does not wnt to accept .wolf, /usr/local/share/iortcw as a path, and don't know what else to try because those are literally the only install paths for this program i can find


----------



## inf3rno (Jul 29, 2020)

skeletonboss12 said:


> Okay so I am using the cmd line version of pbsetup.run now, however either this script or i am confused about the path,
> 
> It does not wnt to accept .wolf, /usr/local/share/iortcw as a path, and don't know what else to try because those are literally the only install paths for this program i can find


It is ".etwolf" not ".wolf" in the home dir of the user.


----------



## inf3rno (Jul 29, 2020)

Any idea why I don't get fullscreen when starting with a non-privileged user? I get fullscreen with root only, but I definitely won't start it with root because the client can be hacked.
Another problem that it cannot make a config file for the user. I guess I have to add privileges for the folder it tries to write, but I have no idea what folder it is.


----------



## inf3rno (Jul 29, 2020)

inf3rno said:


> Any idea why I don't get fullscreen when starting with a non-privileged user? I get fullscreen with root only, but I definitely won't start it with root because the client can be hacked.
> Another problem that it cannot make a config file for the user. I guess I have to add privileges for the folder it tries to write, but I have no idea what folder it is.


I think I solved the write issue. I made the folder with root persmissions, I changed owner with chown, now it looks like I can write the files in it when running the game. I still cannot run the game in full screen. I have no idea how to solve this.

edit:
I managed to solve the fullscreen issue. It turned out I accidentally wrote 1920x1280 instead of 1920x1080. Now it is ok. I just need to update the punkbuster somehow. Won't be easy to find the old version which supports ET.


----------



## inf3rno (Aug 3, 2020)

The old punkbuster necessary is no longer available from evenbalance. Here is the pbsetup.run: https://fearless-assassins.com/files/file/385-punkbuster-setup-for-32-bit-linux-ames-gui-version/ but it does not work. For me it writes that "/bin/sh: pbsetup.run: not found" or if I run it as root, then it writes "pbsetup.run: Command not found". I guess it requires a binary that is not installed, but I have no idea how to debug it.


----------



## inf3rno (Aug 18, 2020)

I ended up copying the files from here: https://fearless-assassins.com/files/file/1815-punkbuster-linux-files-for-et/ They work. Now I just need to find a solution for the sound, because the sound fix you suggested does not work either. Probably my DAC is not supported. I need to turn off vsync and turn on adaptive sync somehow too. It will be fun.


----------



## ekvz (Aug 21, 2020)

When trying to run Enemy Territory in 2020 it might be worth looking at https://www.etlegacy.com/. While it has way more dependencies the overall compatibility is likely better and it won't expect any kind of long dead and forgotten anticheat tool to function.


----------

