V Rising: How to Host a Server on CentOS Linux

Currently there is only a Windows version of the V Rising Server available.
It is possible though to run the server on a Linux system using wine.

 

Introduction and prerequisites

Shortly after I bought this game and played around for a while in single player, I wanted to play together with friends. And since I already had a VPS (with CentOS installed) at my disposal I thought why not use that.
So I read the official guide and found out there’s only a server execuabtle for windows. I remembered other guides I’d seen showing how to use wine to run windows executables and I decided to try with this game and it worked. So here’s my guide on how to do it.
As said before and in the title I did this on a CentOS system but I guess this solution in principle would also work on other Linux distributions.I tried to make this guide easily understandable for everyone. The only things you’d need to know is how to use the terminal and how to edit files. CentOS comes with vi as a text editor which can be used to follow this guide but an explaination on how to use vi is not part of this guide.

In this guide commands start with $,# or >. Commands that start with # have to be executed when logged in as root or using sudo. Commands with $ can be executed by a regular user and commands with > are commands for the steamcmd.
$, #, > are not part of the actual commands.

Requirements

In order to run the Server we will need wine and xvfb. Wine is used to execute Windows executables on LInux and we will use xvfb to create a virtual monitor, so we don’t have to have an actual monitor attached to the server.
We also need the steamcmd to download and update the server files.
Install the steamcmd requirements with:
# yum install glibc.i686 libstdc++.i686 -y

The easiest way to install wine is by using the EPEL Repository, so we add it like this:

# yum install epel-release -y

Then to install wine and xvfb:

# yum install wine -y
# yum install xorg-x11-server-Xvfb -y

Installing steamcmd

Before we install steamcmd or the server, we should create a user that we will use to run steamcmd and later the game server itself. Using the root user for the steamcmd or the game server is a security risk. I’ll call this user steam but you can choose any name you like.
Create the user and log in as this new user:
# useradd steam
# su steam

We then move to home directory of the new user and create a directory in which we will install the steamcmd and another directory for the game server:

$ cd
$ mkdir steamcmd
$ cd steamcmd 
$ mkdir VRising

Now we download and extract the steamcmd:

$ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

 

Installing the game server

We start the steamcmd using the script that was extracted in the previous step:
$ ./steamcmd.sh

The first time starting the steamcmd will take some time and download updates. After the updating is done we can use the steamcmd and as first step we specify the previously created directory as the install directory for the game:

> force_install_dir VRising

Before we download the server files we need to log in to steam but we can use the anonymous login:

> login anonymous

The app ID for the V Rising server is 1829350 so we can install the server like this:

> app_update 1829350

After the server has been installed type

> quit

to exit the steamcmd.

Running and configuring the game server

Move to the directory where we installed the server:
$ cd VRising

And then start the server like this:

$ export WINEARCH=win64
$ xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine VRisingServer.exe -persistentDataPath ./save-data -logFile server.log

This will start the server and create the savegame in the directory we specified in the previous command as persistent data path, in this case the save-data folder.
Wait a bit and then close the server again by pressing Ctrl-C.

Configuration

Create the Settings folder inside the save-data directory:

$ mkdir save-data/Settings

Now we copy the default settings to this new directory:

$ cp VRisingServer_Data/StreamingAssets/Settings/*.json save-data/Settings
The Settings folder now contains two configuration files, ServerHostSettings.json for host configuration like server name, password, ports, etc and ServerGametSettings.json for game settings like crafting rates, damage multipliers etc.
You can use your preferred text editor to edit the settings in those files.

Using systemd to control the server

We now could use the command we used before to start the server but this would require us to always keep the terminal we’re using open to keep the server running. Instead we will systemd to configure the server as service that runs in the background.
To make things easier we will first create shell script to start the server. Create a new file using a text editor of your choice with the following content:
#!/bin/bash
export WINEARCH=win64
/usr/bin/xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' /usr/bin/wine VRisingServer.exe -persistentDataPath server1_saves/ -logFile server.log

Save the file as run_server.sh in directory of the game server. Make the file an excutable with this command:

$ chmod ug+x run_server.sh

This is everything we need to do as the steam user. We can now switch back to a user with root privileges using

$ exit

Create a new file for the systemd service with the following content:

[Unit]
After=network.target

[Service]
User=steam
Group=steam
WorkingDirectory=/home/steam/steamcmd/VRising
ExecStart=/home/steam/steamcmd/VRising/run_server.sh

[Install]
WantedBy=multi-user.target

and save the file as

/etc/systemd/system/VRising.service

We can now use systemctl to start and stop the server. To start the server use:

# systemctl start VRising

If we want to stop the server we can use:

# systemctl stop VRising

We can also check if the process is still running:

# systemctl status VRising

Note that if the server crashes this might still show that the process is active because only the server process crashed but wine is still running.

Configuring the firewall

Now that we got the server running using systemd, the only thing left to do is to configure the firewall.
Unless you changed this in ServerHostSettings.json the game uses the udp ports 9876 and 9877.
Add rules for these two ports to the firewall:
# firewall-cmd --add-port=9876/udp
# firewall-cmd --add-port=9877/udp

Then we persist the new rules so the port stay open even after a restart and reload the firewall:

# firewall-cmd --runtime-to-permanent
# firewall-cmd --reload

 

Updating the game

Updating is simple. First shut down the server and just like when installing the game login to the user we created for the steamcmd and start the steamcmd:
# systemctl stop VRising
# su steam
$ cd ~/steamcmd
$. ./steamcmd

Login to anonymous steam profile, update the game, wait for the update to finish and close the steamcmd:

> login anonymous
> app_update 1829350
> quit

The game is now updated and we can start the server again.

# systemctl start VRising

Thanks to shiranai for his great guide, all credit to his effort. you can also read the original guide from Steam Community. enjoy the game.

Related Posts:

Post Author: Robins Chew

2 thoughts on “V Rising: How to Host a Server on CentOS Linux

    C

    (May 30, 2022 - 5:28 am)

    Cannot run systemctl … it errors

    ● VRising.service
    Loaded: loaded (/etc/systemd/system/VRising.service; disabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Mon 2022-05-30 01:26:07 EDT; 25s ago
    Process: 23093 ExecStart=/home/steam/steamcmd/VRising/start.sh (code=exited, status=203/EXEC)
    Main PID: 23093 (code=exited, status=203/EXEC)

    May 30 01:26:07 6ad960e986 systemd[1]: Started VRising.service.
    May 30 01:26:07 6ad960e986 systemd[1]: VRising.service: main process exited, code=exited, status=203/EXEC
    May 30 01:26:07 6ad960e986 systemd[1]: Unit VRising.service entered failed state.
    May 30 01:26:07 6ad960e986 systemd[1]: VRising.service failed.

    user

    (May 30, 2022 - 5:38 am)

    Okay I got the systemctl to work but when starting the server, it doesn’t start..

    [[email protected] VRising]$ ./start.sh
    0009:fixme:ntdll:NtQuerySystemInformationEx Relationship filtering not implemented: 0x4
    0009:fixme:ntdll:NtQuerySystemInformationEx Relationship filtering not implemented: 0x4
    CreateDirectory ” failed: Path not found.
    (current dir: )
    CreateDirectory ” failed: Path not found.
    (current dir: )
    0009:fixme:win:EnumDisplayDevicesW ((null),0,0x22f1f0,0x00000000), stub!
    0009:fixme:win:EnumDisplayDevicesW (L”\\\\.\\DISPLAY1″,0,0x22f1f0,0x00000000), stub!
    0009:fixme:win:EnumDisplayDevicesW ((null),1,0x22f1f0,0x00000000), stub!
    XDG_RUNTIME_DIR (/run/user/0) is not owned by us (uid 1000), but by uid 0! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don’t do that.)
    ALSA lib confmisc.c:767:(parse_card) cannot find card ‘0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
    ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
    ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: Permission denied
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default
    ALSA lib confmisc.c:767:(parse_card) cannot find card ‘0’
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: Permission denied
    ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: Permission denied
    ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
    ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: Permission denied
    ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: Permission denied
    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default
    0057:fixme:kernelbase:AppPolicyGetThreadInitializationType 0xfffffffffffffffa, 0x7f25e0c2fdc0
    0009:fixme:wbemprox:client_security_SetBlanket 0x7f25e07df2a0, 0x7f256c105d80, 10, 0, (null), 3, 3, (nil), 0x00000000
    0009:fixme:wbemprox:client_security_Release 0x7f25e07df2a0
    0009:fixme:wbemprox:wbem_services_CreateInstanceEnum unsupported flags 0x00000030
    0009:fixme:wbemprox:wbem_services_CreateInstanceEnum unsupported flags 0x00000030
    0009:fixme:keyboard:X11DRV_GetKeyboardLayout couldn’t return keyboard layout for thread 0012
    0009:fixme:keyboard:X11DRV_GetKeyboardLayout couldn’t return keyboard layout for thread 0012
    0009:fixme:ntdll:EtwEventRegister ({f72b578f-cae9-556a-01dc-b94f14b3cbd9}, 0x13f001100, 0x13f05b018, 0x13f05b038) stub.
    0009:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x13f0504be, 13) stub
    0009:fixme:ntdll:EtwEventRegister ({66f0a0b9-f747-5080-bdb9-4974c990ecd2}, 0x13f001100, 0x13f05b050, 0x13f05b070) stub.
    0009:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x13f0504dc, 19) stub
    0009:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
    0061:fixme:wbemprox:wbem_locator_ConnectServer unsupported flags
    0061:fixme:wbemprox:client_security_SetBlanket 0x7f25e07df2a0, 0x7f256cc61560, 10, 0, (null), 3, 3, (nil), 0x00000000
    0061:fixme:wbemprox:client_security_Release 0x7f25e07df2a0
    0061:fixme:wbemprox:wbem_locator_ConnectServer unsupported flags
    0061:fixme:wbemprox:client_security_SetBlanket 0x7f25e07df2a0, 0x7f256cc61560, 10, 0, (null), 3, 3, (nil), 0x00000000
    0061:fixme:wbemprox:client_security_Release 0x7f25e07df2a0
    0061:fixme:wbemprox:enum_class_object_Next timeout not supported
    0009:fixme:ntdll:EtwEventRegister ({b77d8a36-ef0c-4976-8d22-08f986f56cfb}, 0x138879800, 0x1393101a0, 0x1393afa88) stub.
    0064:fixme:kernelbase:AppPolicyGetThreadInitializationType 0xfffffffffffffffa, 0x7f255f01fdc0
    0065:fixme:winhttp:get_system_proxy_autoconfig_url no support on this platform
    0065:fixme:winhttp:WinHttpDetectAutoProxyConfigUrl discovery via DHCP not supported
    005b:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering
    005b:fixme:iphlpapi:NotifyAddrChange (Handle 0x7f255fc10410, overlapped 0x7f255fc10418): stub
    005b:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering
    0009:fixme:wbemprox:client_security_SetBlanket 0x7f25e07df2a0, 0x7f256d69ac90, 10, 0, (null), 3, 3, (nil), 0x00000000
    0009:fixme:wbemprox:client_security_Release 0x7f25e07df2a0
    0009:fixme:wbemprox:wbem_services_CreateInstanceEnum unsupported flags 0x00000030
    0009:fixme:wbemprox:wbem_services_CreateInstanceEnum unsupported flags 0x00000030
    0009:fixme:wbemprox:wbem_services_CreateInstanceEnum unsupported flags 0x00000030
    0009:fixme:ntdll:EtwEventRegister ({35167f8e-49b2-4b96-ab86-435b59336b5e}, 0x7f2625d62e30, 0x3d23, 0x7f259442c6b0) stub.
    0009:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x7f255c64a950, 65) stub

Leave a Reply

Your email address will not be published. Required fields are marked *