Anvil Game Studios

Author Topic: How to host a Holdfast: Nations at War server on Linux  (Read 2013 times)

0 Members and 1 Guest are viewing this topic.

Offline Captain Conner

  • Petty Officer
  • *
  • Posts: 69
  • Lead Developer at Oasis Hosting
    • Oasis Hosting
  • Faction: British Empire
  • Nick: Captain_Conner
How to host a Holdfast: Nations at War server on Linux
« on: September 22, 2017, 11:06:10 pm »
This is a tutorial on how to host your own Holdfast: Nations at War on a Linux operating system.

This took me a lot of time and effort to get working and figure out what has to be installed and modified exactly. To host your own server, but without the hassle take a look at our Holdfast: Nations at War servers. You can get your own server for less than 1.50 EUR /month with 35% discount if you use code "holdfastlaunch" at checkout.



Note: This has only been tested on Ubuntu 16.04

1) Make sure no previous version of Wine has been installed, if it has, uninstall it completely and don't forget to run apt-get autoremove to clean up the remaining files.

2) Add the right architecture, execute:
Code: [Select]
dpkg --add-architecture i3863) Download the latest version of Wine, we recommend the development build as it contains multiple fixes that this requires:
Code: [Select]
wget -nc https://dl.winehq.org/wine-builds/Release.key
apt-key add Release.key
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu
apt-get install software-properties-common
apt-get install apt-transport-https
sudo apt-get update
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
apt-get install --install-recommends winehq-devel
apt-get install winetricks

4) Install Mono, a .NET runtime library for Wine.
Mono 4.6 download: https://www.sendspace.com/file/jss2rk
Install it with:
Code: [Select]
wine msiexec /i wine-mono-4.6.0.msi
5) Install Xvfb, which is a virtual display adapter. Holdfast needs the ability to output graphics, although it does not use it.

Code: [Select]
apt-get install xvfb
To start the virtual adapter:
Code: [Select]
Xvfb :0 -screen 0 1024x768x16 &
6) Install DirectX, Holdfast needs this as well. We recommend using version 9 as it fully supported by Wine:
Code: [Select]
winetricks directx9
7) Install all the Holdfast server files to a folder on your server

8) Once you have downloaded the server files, navigate to the folder and execute this command to start the server:

Code: [Select]
DISPLAY=:0.0 wine "/home/your/path/here/Holdfast NaW.exe" -startserver -batchmode -screen-width 640 -screen-height 480 -screen-quality Fastest -framerate 60 -servercarbonplayers 0 -serverConfigFilePath /home/your/path/here/config.txt -logFile /home/your/path/here/logs_output/outputlog_server5_coastalsiege.txt -logArchivesDirectory /home/your/path/here/logs_archive -s "YOURIPHERE" -p YOURPORTHERE -l "94.130.66.231" -o 7101
Replace "/home/your/path/here" with the path to the Holdfast server folder and hit enter. It will output a lot of warnings, however this is normal.


Congratulations, your server should now be up!


If you could not make your Holdfast server work on your Linux operating system, consider buying a cheap server from Oasis Hosting ( https://oasis-hosting.net/gameservers/holdfastnaw/ ) - Servers start 1.50 EUR /month for both Naval AND Land battles. Use discount code "holdfastlaunch" for 35% discount!
« Last Edit: October 01, 2017, 07:54:49 pm by Captain Conner »
Looking for an affordable game server? Look no further.


Offline Illuminati

  • Ordinary Seaman
  • *
  • Posts: 25
  • Infravider
    • Infravider
  • Faction: Prussia
  • Nick: Illuminati
Re: Hot to host a Holdfast: Nations at War server on Linux
« Reply #1 on: September 22, 2017, 11:11:05 pm »
+1

Offline Felix Buxton

  • Midshipman's Mate
  • *
  • Posts: 4
  • ArcticServers.co.uk Rep.
    • Arctic Servers (.co.uk)
  • Faction: British Empire
  • Nick: Felix
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #2 on: September 22, 2017, 11:15:59 pm »
A nice release, helps the community.  ;)

Offline Refleax

  • Anvil Game Studios
  • Purser
  • ******
  • Posts: 862
  • May good health be yours!
    • Holdfast: NaW
  • Faction: Neutral
  • Nick: Refleax
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #3 on: September 22, 2017, 11:18:51 pm »
Stickied. Thank you very much!

   Facebook     |        Twitter     |        Community Discord

Offline Dodo

  • Surgeon's Mate
  • *
  • Posts: 48
    • Beyond Servers
  • Faction: French Empire
  • Nick: Dodo
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #4 on: September 22, 2017, 11:21:23 pm »
The development version is not necessary, the stable one works as well.
Furthermore, there is no need of directX to make this work.

But cool.

EDIT: A newer version of mono can be found here: http://dl.winehq.org/wine/wine-mono/4.7.1/

Offline Captain Conner

  • Petty Officer
  • *
  • Posts: 69
  • Lead Developer at Oasis Hosting
    • Oasis Hosting
  • Faction: British Empire
  • Nick: Captain_Conner
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #5 on: September 22, 2017, 11:30:00 pm »
The development version is not necessary, the stable one works as well.
Furthermore, there is no need of directX to make this work.

But cool.

EDIT: A newer version of mono can be found here: http://dl.winehq.org/wine/wine-mono/4.7.1/

For me it did require DirectX, that is why I listed it.

Thanks for the new mono version by the way.
Looking for an affordable game server? Look no further.


Offline Walki

  • Anvil Game Studios
  • Master's Mate
  • ******
  • Posts: 40
  • Creator of Things
    • 51st Regiment of Foot
  • Faction: Neutral
  • Nick: Walki
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #6 on: September 30, 2017, 11:21:04 am »
You actually have two 3s in the tutorial.
The first 3.) seems a bit off.

Code: [Select]
wget -nc https://dl.winehq.org/wine-builds/Release.key
apt-key add Release.key
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu
apt-get install software-properties-common
apt-get install apt-transport-https
sudo apt-get update
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
apt-get install --install-recommends winehq-devel
apt-get install winetricks

First off, you are adding the Ubuntu wine repository twice, there is obviously no reason for that. apt-add-repository is part of software-properties-common (at least in Debian), which means the correct order would be:

Code: [Select]
wget -nc https://dl.winehq.org/wine-builds/Release.key
apt-key add Release.key
apt-get install software-properties-common
apt-get install apt-transport-https
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu
[sudo] apt-get update
apt-get install --install-recommends winehq-devel
apt-get install winetricks

You can cut this down even further, since there is no real reason to use apt-transport-https since we are pulling from a public repository. You can also cut installing software-properties-common and then adding the repository manually using the bash >> operator.

Debian (stretch):

Required packages:
Code: [Select]
dpkg --add-architecture i386
apt-get update && apt-get upgrade -y
apt-get install -y gnupg gnupg1 gnupg2 wget zip vim curl

Code: [Select]
curl -o Release.key https://dl.winehq.org/wine-builds/Release.key
apt-key add Release.key
echo "deb http://dl.winehq.org/wine-builds/debian stretch main" >> /etc/apt/sources.list
apt-get update
apt-get install -y --install-recommends winehq-stable

As Dodo has mentioned in your second 3), you can download the latest version of mono directly from winehq, no need to do the step via sendspace (I would recommend transfer.sh for this purpose btw ;), since you can wget that link and it doesn't come with ads). As of this post the newest version of mono is 4.7.1.

Code: [Select]
curl http://dl.winehq.org/wine/wine-mono/4.7.1/wine-mono-4.7.1.msi | wine msiexec /i

Tidy up
Code: [Select]
rm wine-mono-4.7.1.msi Release.key

Step 5, from first post. Setting up the virtual screen.
Code: [Select]
apt-get install xvfb
Xvfb :0 -screen 0 1024x768x16 &

Now onto downloading the game. Getting SteamCMD and launching in Windows mode:

Code: [Select]
mkdir /home/holdfast && cd /home/holdfast
curl -o steamcmd_linux.tar.gz "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" && tar zxf steamcmd_linux.tar.gz
./steamcmd.sh +@sSteamCmdForcePlatformType windows +force_install_dir holdfastserver
Steam>
Code: [Select]
login [username]
 ... Enter Password & 2-Factor Auth Code
app_update 589290

Note: Repeat this step later if you want to update your server. You can also put this into a bash script obviously. If your server ever breaks you can use app_update 589290 validate to check the file integrity.

Now follows a rather dirty step, get the server files from DropBox: https://www.dropbox.com/sh/ppkfny3r9kcnz8x/AADiIXOrlAWPh-XbhPpimw0ja?dl=0

Code: [Select]
cd /home/holdfast/holdfastserver
curl -L -o holdfast_naw_public_servers.zip https://www.dropbox.com/sh/ppkfny3r9kcnz8x/AADiIXOrlAWPh-XbhPpimw0ja?dl=1
unzip -o holdfast_naw_public_servers.zip

Now we can finally start our server
Code: [Select]
DISPLAY=:0.0 wine "/home/holdfast/holdfastserver/Holdfast NaW.exe" -startserver -batchmode -screen-width 640 -screen-height 480 -screen-quality Fastest -framerate 60 -servercarbonplayers 0 -serverConfigFilePath /home/holdfast/holdfastserver/serverconfig.txt -logFile /home/holdfast/holdfastserver/logs_output/outputlog_server5_coastalsiege.txt -logArchivesDirectory /home/holdfast/holdfastserver/logs_archive -s "YOURIP" -p 20100 -l "94.130.66.231" -o 7101
« Last Edit: April 19, 2018, 03:45:16 pm by Walki »

Offline Korvyr

  • Ordinary Seaman
  • *
  • Posts: 73
  • 89th Gaming Community
  • Faction: Neutral
  • Nick: Palpatine
Re: How to host a Holdfast: Nations at War server on Linux
« Reply #7 on: March 13, 2018, 09:30:28 pm »
I actually recommend people use the development version found here for wine:

https://wine-staging.com/installation.html

I had no end of trouble using the packaged version of wine on CentOS and Ubuntu. The staging versions are extremely unstable, but contain patches for each of the issues I kept running into.

I suppose it depends on your setup. Give the packaged versions a run, and if that fails, try a development version of wine. If you can't find a development package for your GNU sauce of choice, you can also try compiling it yourself:

https://wiki.winehq.org/Building_Wine