Venice unleashed linux dedicated server running inside Docker

logo

Venice Unleashed Linux Dedicated Server

Image size
Docker pulls
Github

This project represents the code used in order to run the Venice unleashed inside Docker. It builds on top of the wine base image and adds Venice unleashed specific code in order to run it.

How to run it

Here are the steps you should take in order to run this image.

Getting Battlefield 3 and setting up the required volume mounts

In order to be able to run the VU dedicated server you’ll need the BF3 client files on your machine. The easiest way is to download the game via Origin on a Windows machine and then transfer them over to your Linux machine (using something like rsync or SCP).

  1. Create a bf3 docker volume. Copy all the BF3 client files you previously downloaded from Origin into this docker volume.
  2. Create a instance docker volume. This is a directory containing configuration files, mods, and other necessary files to run your server. This can be empty at initial boot.
  3. Create a client docker volume. This is a directory containing the VU files like vu.exe, vu.com and entrypoint.sh. This can be empty at initial boot.

Activating the game

In order to run the VU server you have to activate the game. This process requires an Origin account which owns BF3. Please make sure the following enviroment variables are set:

Enviroment variable Description
O_EMAIL Origin account e-mail
O_PASSWORD Origin account password

Add server.key

Please go to: veniceunleashed.net/key-create then generate and download the server.key. Make sure this is saved in the instance directory. (/vu/instance/server.key)

Configuring ports

The docker image will listen to the default ports. In order to run several dedicated servers you’ll have to change this. Do this by overriding the following enviroment variables:

Enviroment variable Description Default
LISTEN Sets the host and port the VU server should listen for connections on. 0.0.0.0:25200
HARMONYPORT Sets the port the VU server should listen for MonitoredHarmony connections 7948
RCONPORT Sets the host and port the VU server should listen for RCON connections. 0.0.0.0:47200

Run it

The final step is bringing it all together. Either use docker run, docker compose or another way or running this container. Please make sure though that:

  • Battlefield files (volume bf3) is mounted at /vu/bf3
  • Instance directory (volume instance) is mounted at /vu/instance
  • Client directory (volume client) is mounted at /vu/client
  • Enviroment variables as described above are set
  • Ports are exposed.

Docker run

Run the following command. As you can see we set the required enviroment variables and then map the game files, instance and client directory. We also bind the ports the game server is running on.

docker run --name venice -it \
	-d itsteckel/vu:latest \
	-e O_EMAIL='<email>' \
	-e O_PASSWORD='<password>' \
	-e LISTEN='0.0.0.0:25200' \
	-e LISTEN='7948' \
	-e LISTEN='0.0.0.0:47200' \
	-v /location/on/host/bf3Files/:/vu/bf3 \
	-v /location/on/host/instance/:/vu/instance \
	-v /location/on/host/client/:/vu/client \
	-p 47200:47200/tcp \
	-p 7948:7948/udp \
	-p 25200:25200/udp

Docker-compose

Or run it using docker-compose. As you can see we set the required enviroment variables and then map the game files, instance and client directory. We also bind the ports the game server is running on.

---
version: 3
services:
  venice:
    image: itsteckel/vu:latest
    restart: unless-stopped
    ports:
      - 47200:47200/tcp
      - 7948:7948/udp
      - 25200:25200/udp
    environment:
      - [email protected]
      - O_PASSWORD=replaceMeWithYourOriginPassword
      - LISTEN=0.0.0.0:25200
      - HARMONYPORT=7948
      - RCONPORT=0.0.0.0:47200
    volumes:
      - bf3:/vu/bf3
      - instance:/vu/instance
      - client:/vu/client

Debugging

Cannot connect. Server resolves to local host (127.0.0.1)

If you’re hoping to host the container and connect to it locally then you’ll run into this problem. Currently there’s a error in how VU resolves the external IP when the container is in bridge network mode and you connect to it from your LAN. Try running your container in host mode if you’re hosting it in your local network. So pass --network host in docker run. See: docs.docker.com/network/host.

The container doesn’t need this when you host it in a data center elsewhere. Passing along a -joinaddr to vu.com or vu.exe doesn’t help either by the way.

Crashes

A normal output does show some Wine errors:

Skipping update as '/vu/client/vu.com' exists.
Found server.key
Activating with ******@****.com
wine: Unhandled page fault on read access to 000000B8 at address 1000653A (thread 0090), starting debugger...
[2020-12-24 00:24:19+00:00] [info] Server Instance directory: /vu/instance
[2020-12-24 00:24:19+00:00] [info] Initializing the VeniceEXT engine v1.0.8...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Loading VeniceEXT module 'vu-compass-1.0.2'.
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [vu-compass-1.0.2] Compiling client module...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [vu-compass-1.0.2] Compiling client script 'config.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [vu-compass-1.0.2] Compiling client script 'ui.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [vu-compass-1.0.2] Compiling client script 'utils.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [vu-compass-1.0.2] Compiling client script '__init__.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Successfully loaded VeniceEXT module 'vu-compass-1.0.2'.
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Loading VeniceEXT module 'tactical-freelook'.
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [tactical-freelook] Compiling client module...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [tactical-freelook] Compiling client script 'freelook.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [tactical-freelook] Compiling client script '__init__.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Successfully loaded VeniceEXT module 'tactical-freelook'.
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Loading VeniceEXT module 'balanced-reinforcements'.
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [balanced-reinforcements] Loaded VeniceEXT server script: __init__.lua
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [balanced-reinforcements] Compiling client module...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [balanced-reinforcements] Compiling shared script 'config.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] [balanced-reinforcements] Compiling shared script 'timers.lua'...
[2020-12-24 00:24:19+00:00] [info] [VeniceEXT] Successfully loaded VeniceEXT module 'balanced-reinforcements'.
[2020-12-24 00:24:20+00:00] [info] Initializing Venice Unleashed Server (Build 17384)...
[2020-12-24 00:24:20+00:00] [info] Mounting the VU game data File System.
[2020-12-24 00:24:23+00:00] [info] Remote Administration interface is listening on port 0.0.0.0:47200
[2020-12-24 00:24:23+00:00] [info] Successfully read startup configuration data.
[2020-12-24 00:24:23+00:00] [info] Loaded 0 entries from the player banlist file.
[2020-12-24 00:24:23+00:00] [info] Establishing connection to the Zeus Backend...
[2020-12-24 00:24:23+00:00] [info] Venice Unleashed dedicated server initialization finished.
[2020-12-24 00:24:24+00:00] [info] Successfully established connection to the Zeus Backend!
[2020-12-24 00:24:24+00:00] [info] Authenticating server with the Zeus Backend...
[2020-12-24 00:24:24+00:00] [info] Successfully authenticated server with Zeus (Server GUID: 386de7222f5e41efba4ccc183*******).
[2020-12-24 00:24:24+00:00] [info] Checking for updates...
[2020-12-24 00:24:26+00:00] [info] Update check complete. No new updates available.

crashing regularly

Please check your mods. Try running the server without any mods. Mods might be trying to write/read memory or do operations at certain moments during the game (loading) which can make the game server crash.

Not starting up

Follow these steps to debug your server not starting.

  • Please make sure that the server works well on Windows first. For instance that the origin credentials and server.key are valid.
  • Make sure the container is able to read your Battlefield files. Run chmod to set the right permissions.
  • run DISPLAY=:1 xwd -root -silent | convert xwd:- png:/vu/client/screenshot.png in your docker container to render the X11 windows. It’ll save it to /vu/client/screenshot.png. This might give you more of an indication as to what is going wrong.
8 Likes

What is the advantage over the “normal” method?

A big advantage of Dockerizing applications is that you don’t get the “it works on my machine” problem, where your local machine might have a different software environment than where you’re actually planning on running it.

Are you activating the game on every launch?

I’m new to docker but with the help of the documentation and the Github repositories I wanted to setup a VU Server, however I have some problems…

I think your Docker-compsoe script is missing the volume definitions at the bottom of the file, as described here. This is what I used:

---
version: 3
services:
  venice:
    image: itsteckel/vu:latest
    restart: unless-stopped
    ports:
      - 47200:47200/tcp
      - 7948:7948/udp
      - 25200:25200/udp
    environment:
      - [email protected]
      - O_PASSWORD=replaceMeWithYourOriginPassword
      - LISTEN=0.0.0.0:25200
      - HARMONYPORT=7948
      - RCONPORT=0.0.0.0:47200
    volumes:
      - bf3:/vu/bf3
      - instance:/vu/instance
      - client:/vu/client
volumes:
  bf3:
  instance:
  client:

After adding them the server seams to try to start, however it waits for the wineserver indefinitely. Here it the output to the terminal I get:

alex@Srv:/vu$ docker-compose up
Starting vu_venice_1 ... done
Attaching to vu_venice_1
venice_1  | Skipping update as '/vu/client/vu.com' exists.
venice_1  | Found server.key
venice_1  | Found Battlefield 3 client files
venice_1  | Activating with **********@*******.***
venice_1  | Starting Z:\vu\client\vu.com
venice_1  | wine: Unhandled page fault on read access to 000000B8 at address 00C4653A (thread 011c), starting debugger...
venice_1  | Start waiting on wineserver
venice_1  | waiting ...
venice_1  | waiting ...
venice_1  | waiting ...
venice_1  | waiting ...
venice_1  | waiting ...

I’m unsure how to debug this further, as I’m new to docker. The output suggests that it is stopping on the last line of the entrypoint.sh of the vu container when calling the waitonprocess.sh to wait for the
wineserver to exit.
I gladly provide more logs, when someone can tell me how I would get them or point me in the right direction.
For testing purposes I use VirtualBox with Ubuntu 20.04 64bit.

A helping hand would gladly be appreciated.

For your testing purposes it might be easier though for now to just bind it to a directory on the host.

Please try logging into your container and checking if:

  • The mounts. See for instance if /vu/bf3 is populated with files.
  • The user inside docker has access to your game files

You can debug these kind of docker problems by first starting the container and then getting a shell in it. You do this by overriding the run (CMD), so add this to your docker-compose:

---
version: 3
services:
  venice:
    image: itsteckel/vu:latest
    restart: unless-stopped
    command: /bin/bash
    ...

Now your container should stay alive and not execute the entrypoint.sh that would normally run the server and then exit after an error.

Then log into your container and debug it doing:

docker exec -it {container name} /bin/bash

You can get your container name by doing

docker ps

You’re likely right about missing the volumes in the docker-compose. I’ll add it. Thanks!

Thank you for the response and pointing me in the right direction.

The problem was that I had two factor authentication enabled and a dollar sign in my password. This resulted in a failed authentication attempt.

Adding command: /bin/bash to my docker-compose file sadly didn’t keep the container running. After some googleing if found command: tail -f /dev/null, which worked for me. After checking the mounted volumes, which were fine, I ran the entrypoint.sh manually in the container to see if any errors are produced and were able to debug the bugs mentioned above.

Now other people can connect to the server from outside of my network but I can’t connect from the computer that is hosting the virtual machine. Which is strange. I will try to move the server to different ports in case of conflicts between the server and the client.

There also seems to be a lock out mechanism for to many activations in a row on an origin account. After testing a while I seam to no longer be able to authenticate the server with the account I used before but it works again when using a different account.
Currently a failed authentication results in the behavior I experienced in my last post, maybe it would be good if this could be changed to accurately show the error. However, I currently don’t know how this would be implemented.

Thanks for the help setting this up!

A small update:
There is an activation limit per day for servers, so restarting the container often is ill advised.

Moving the Server to different Ports did not solve my issue of not being able to connect to the server from the same network. Clients in the same network seam to try to connect to 127.0.0.1 when trying to join the server. I don’t really understand why though. Joining over cellular data or from another networks works fine.

haven’t hit this problem yet. But I’ll change it so that it writes a file after activation and stops it from reactivating.

With regards to the 127.0.0.1 error. I’ve ran into the same issue. Try this:

If you’re hoping to host the container and connect to it locally then you’ll run into this problem. Currently there’s a error in how VU resolves the external IP when the container is in bridge network mode and you connect to it from your LAN. Try running your container in host mode if you’re hosting it in your local network. So pass --network host in docker run. See: docs.docker.com/network/host.

The container doesn’t need this when you host it in a data center elsewhere. Passing along a -joinaddr to vu.com or vu.exe doesn’t help either by the way.

1 Like

Hey, I’m having the same issue as TheAlibiks:

Found server.key
Found Battlefield 3 client files
Activating with ***
Starting Z:\vu\client\vu.com
wine: Unhandled page fault on read access to 000000B8 at address 00C4653A (thread 0118), starting debugger…
Start waiting on wineserver
waiting …
waiting …
waiting …

But i did get a screenshot out of it:

@TheTaques Do you have 2FA enabled on the Origin account you are trying to run this with? If so, disable it.

Another way of debugging the issues, is to manually run the commands from entrypoint.sh which handle the activation and starting the server. That way you get output in your CLI interface.
So, when you run DISPLAY=:1 wine /vu/client/vu.com -gamepath /vu/bf3 -activate -o_mail $O_EMAIL -o_pass $O_PASSWORD on the commandline interface manually, you will get a response and will possibly tell you, that you have 2FA enabled. Change the variables of course with the correct values. :wink:

@teckel Another issue I stumbled upon is the amount of activations. Each and every time the container is started, the game sends an authentication request to see if the account has BF3 activated. Perhaps there is a way of caching that? When testing things out an admin might restart the container a lot and stumble upon this issue (as I am doing at the moment).

Hey there,

I managed to get this docker image running on my unraid server but I fail to connect to it with the error The server you tried joining is not compatible with your client.

Server logs

Skipping update as '/vu/client/vu.com' exists.
Found server.key
Found Battlefield 3 client files
Activating with ***@***.com
0050:err:ole:start_rpcss Failed to start RpcSs service
Starting /vu/client/vu.com
[2021-02-03 16:16:45+00:00] [info] Server Instance directory: /vu/instance
[2021-02-03 16:16:45+00:00] [info] Initializing the VeniceEXT engine v1.1.0...
[2021-02-03 16:16:46+00:00] [info] Initializing Venice Unleashed Server (Build 17487)...
[2021-02-03 16:16:46+00:00] [info] Mounting the VU game data File System.
[2021-02-03 16:16:49+00:00] [info] Remote Administration interface is listening on port 0.0.0.0:47200
[2021-02-03 16:16:49+00:00] [info] Successfully read startup configuration data.
[2021-02-03 16:16:49+00:00] [info] Loaded 0 entries from the player banlist file.
[2021-02-03 16:16:49+00:00] [info] Establishing connection to the Zeus Backend...
[2021-02-03 16:16:49+00:00] [info] Venice Unleashed dedicated server initialization finished.
[2021-02-03 16:16:50+00:00] [info] Successfully established connection to the Zeus Backend!
[2021-02-03 16:16:50+00:00] [info] Authenticating server with the Zeus Backend...
[2021-02-03 16:16:50+00:00] [info] Successfully authenticated server with Zeus (Server GUID: *******************************).
[2021-02-03 16:16:50+00:00] [info] Checking for updates...
[2021-02-03 16:16:50+00:00] [info] Successfully established connection to the Zeus Backend!
[2021-02-03 16:16:50+00:00] [info] Authenticating server with the Zeus Backend...
[2021-02-03 16:16:50+00:00] [info] Successfully authenticated server with Zeus (Server GUID: *******************************).
[2021-02-03 16:16:50+00:00] [info] Checking for updates...
[2021-02-03 16:16:50+00:00] [info] Downloading list of files to update.
[2021-02-03 16:16:50+00:00] [info] Downloading newest update files...
[2021-02-03 16:16:53+00:00] [info] Update successfully downloaded. It will be applied on the next client restart.
[2021-02-03 16:16:56+00:00] [info] Registering team 0 with 0 player slots and 4 squad slots.
[2021-02-03 16:16:56+00:00] [info] Registering team 1 with 16 player slots and 4 squad slots.
[2021-02-03 16:16:56+00:00] [info] Registering team 2 with 16 player slots and 4 squad slots.
[2021-02-03 16:16:56+00:00] [info] Registering a new game with Zeus...
[2021-02-03 16:16:57+00:00] [info] Monitored Harmony server listening on 0.0.0.0:7948.
[2021-02-03 16:16:57+00:00] [info] Game successfully registered with Zeus. The server is now accepting connections.
[2021-02-03 16:18:19+00:00] [info] Player 'IwishIcanFLighT' is requesting to join the server as a player.
[2021-02-03 16:18:19+00:00] [info] Player 'IwishIcanFLighT' has established a connection to the server.

Beside the RpcSs service error that I can’t find why it’s happening and how to fix it, the server still seems to start just fine and is visible on the server browser. Build 17487 matched on both client & server.

I also noted the log saying Update successfully downloaded. It will be applied on the next client restart. which happens at every restart not matter what.

Any help is welcome!

Did you try to restart the container and apply the update?
if that doesn’t help; remove the vu.com file in the client folder, and restart the container again. The entrypoint.sh script will re-download the client again for you.

Yes I already tried that as well. No luck… :confused:

If you already did that, than you have the latest client on the server-side. Guess that only leaves the client-side. Reinstall Venice Unleashed on the PC and try again. Make sure the folder %LOCALAPPDATA%\VeniceUnleashed is either empty or gone after uninstalling, before reinstalling.

Yep also tried that. After launching VU for the first time after installing, it prompts me with a client restart required to apply the latest patch, at this point my server is not visible in the browser (but the other severs are). Once the client restarted, my server is visible but I still get the same error.

From what I can understand, both the server and the client seems to require a restart for applying the patch downloaded at launch, but only the client really applies it since the server always has the log Update successfully downloaded. It will be applied on the next client restart. at restart. It’s also weird that this line implies the server thinks he’s a client. :thinking:

For Venice Unleashed you always get a server and client in the package. It isn’t any different on Linux, as it uses Wine to run the applications (even the authentication is done through Wine) in a win32 emulated environment. :wink:

Thanks for the clarification.

I’ve been experimenting here and there with the container trying to figure out what wrong. I found out that after installing a fresh client of VU on my Windows machine, the client does indeed download files in a .luc folder in the AppData folder of VU:

Folder structure of the Appdata folder:

image

Once restarted, these files are transformed into a bootstrapper.exe file:

updatedone

I’ve been exploring the container using docker exec -it <id> bash to figure out if this .luc folder exist, but couldn’t find it.

My new assumption is that the server seems to try to download these new files but cannot apply them at restart, so maybe it is looking for this .luc folder and fails to proceed with the update.

Does anyone with a working docker instance of VU has this .luc folder ?

DICE should hire you lol

Does anyone with a working docker instance of VU has this .luc folder ?

The .luc folder does not exists on my Linux machine, perhaps it’s in the container, but I haven’t checked it.

As far as I know .luc should be files with compiled (lua) plugins, which shouldn’t be on the server side. It compiles the plugins upon starting. At least on my Linux machine and Docker instance.