Jump to content
Sign in to follow this  
Kindling

ARMA III on Linux servers via WINE

Recommended Posts

You may already be aware that it's possible to run ARMA II under WINE on Linux. Though you can't run the ARMA III game itself due to WINE lacking certain DirectX11 features (amongst other issues), it is possible to run the 'server' part of the application, even if you lack any sort of GPU rendering ability.

I'm working on a bash script to automate most of this with features such as mod management and the ability to run multiple server applications easily on a single server. Until then, I'll provide a rough tutorial as to how to accomplish this with a basic knowledge of the Linux command-line.

Installation

Before anything else, make sure that you're using the user account you want to use to run the server application - 'root' will not do. I created the 'arma' user.

The first step is to install the xvfb application. This will provide a very basic X framebuffer. It's slow as molasses but it's just enough to run basic applications, which is all we need. It's also a good idea to grab the 'screen' application. Let's assume that you're using Ubuntu or Debian:

sudo apt-get install xvfb screen

Now start a new screen on the server - the use of the screen application is beyond the scope of this post, but you can check out this tutorial if you want to learn more (it's probably one of the most useful Linux applications for a server).

screen -S arma

Now start an xvfb framebuffer so we can run some X applications:

Xvfb :99 -screen 0 1024x768x16 -ac &

To make things a bit easier, we might want to grab a window manager, too. Blackbox is tiny and will work just fine for this. Note that we are setting the DISPLAY variable so every command you type in this terminal will now be aware of our xvfb framebuffer:

apt-get install blackbox
export DISPLAY=:99
blackbox &

Since you'll be working with a server and (presumably) have no monitor or direct access, we'll need to setup VNC so we can actually interact with the display. X11VNC is perfect for the job:

sudo apt-get install x11vnc
x11vnc -storepasswd
x11vnc -display :99 -usepw &

Be sure to set a password, or anybody could connect to your VNC port and control the screen! Note that when starting x11vnc like this - without the '-forever' option - the x11vnc session is only good for one connection. Once you've closed it, x11vnc will exit and you can no longer connect via VNC until you have run the command again. I think this is best from a security standpoint - you'll need to manually start the VNC server whenever you want to access the GUI, which protects your Steam account. For the same reason, I suggest using good passwords on both VNC and the private key you use to authenticate yourself for SSH.

Now you need to install WINE then Steam and ARMA III:

NOTE: You must install WINE version 1.5.25 or above or you will get an error regarding DirectX11 dlls!

For Ubuntu, add this PPA before installing WINE.

sudo apt-get install wine1.5 winetricks

winetricks --no-isolate -q steam

Download a VNC viewer while this is busy - TightVNC viewer is fine. Use the client to connect to your IP address or hostname and type in your password - you should now see Steam. Login and download the game.

Configuration

Terox has an excellent guide on how to configure the server - there are no real differences. If the game doesn't run with the '-server' switch, check the terminal - you may be missing some DLLs. If you're missing x3daudio, try 'winetricks -q xact'. 'winetricks -q d3dx11_42' also may be required, but Steam generally installs everything alongside the game. Another possible issue is in configuration files - instead of being in your Documents directory, the Arma3Alpha.cfg and .profile files will be in '~/Arma 3 Alpha'. You'll place your server A3TestConfig.cfg file into '~/.wine/drive_c/Program Files (x86)/Steam/SteamApps/common/Arma 3'.

Automation

NoPlanB has kindly provided a bash script to ease the process of starting and stopping the ARMA III server application.

Prefixes

You can create multiple 'prefixes' or instances of WINE. Each of them has separate settings and C drives - they act as totally separate Windows installations with much lower overhead than VMs. You'll need to use winetricks to install any required drivers/DLLs separately for each prefix.

To switch to another prefix, use the command:

export WINEPREFIX=/home/arma/.prefixname

Where '.prefixname' equals the name of a currently existing prefix or a new one to be created. The default prefix is '.wine', you can create as many as you want and switch between them whenever you wish with the above command, any commands executed after the above that involve WINE will run under that prefix (if it doesn't exist, you can use 'wineboot' or 'winecfg' with VNC to initialize it). The above command also works in shell scripts.

Using prefixes you can run multiple servers, each in their own WINE containers.

Troubleshooting

Current dev version will not launch - The current development build is giving a stack overflow error. I'd suggest holding off on updating to the latest dev build for now.

Lots of ALSA errors - Any errors related to ALSA are likely due to your host device lacking a sound card. You can create a fake, 'dummy' soundcard with the command:

modprobe snd-dummy

Checksum error from Winetricks regarding Steam - If Steam has been updated recently, Winetricks may still have the old installer's checksum and throw 'checksum errors' when trying to install Steam. In this case, you can replace the hash listed for SteamInstall.msi. Download the latest version of Steam from the Steam website (Install Steam, at the top right) then search for 'SteamInstall.msi' in the winetricks script and replace the string of random numbers and letters after the URL (on the w_download line) with the string of numbers and letters you get from the command:

sha1sum ~/Downloads/SteamInstall.msi

I've seen a few crashes, but they've been unpredictable and spaced out. Please let me know if you find a crash that you can replicate.

Firewall

Here's a basic stateful firewall to apply to the server (copy-paste it into nano or vim, save the file as '/root/firewall.sh' and 'chmod +x /root/firewall.sh' to make it executable. Now edit the /etc/rc.local file and put '/root/firewall.sh' before 'exit 0' to run it on every boot).

# For both IPv6 and IPv4
for iptables in "iptables" "ip6tables"
do
       # Drop all previous rules
       $iptables -F
       # Allow VNC (you could add a '-s 80.1.2.3' here, for example, to only allow connections from 80.1.2.3.
       # Replace with your own IP to prevent anybody else from connecting to VNC.)
       $iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
       # Allow ARMA server
       $iptables -A INPUT -p udp --dport 2302 -j ACCEPT
       $iptables -A INPUT -p udp --dport 2303 -j ACCEPT
       $iptables -A INPUT -p udp --dport 2305 -j ACCEPT
if [ "$iptables" == 'ip6tables' ]; then
       # Filter all packets that have RH0 headers:
       $iptables -A INPUT -m rt --rt-type 0 -j DROP
       $iptables -A FORWARD -m rt --rt-type 0 -j DROP
       $iptables -A OUTPUT -m rt --rt-type 0 -j DROP
       # Allow Link-Local addresses
       $iptables -A INPUT -s fe80::/10 -j ACCEPT
       $iptables -A OUTPUT -s fe80::/10 -j ACCEPT
       # Allow multicast
       $iptables -A INPUT -d ff00::/8 -j ACCEPT
       $iptables -A OUTPUT -d ff00::/8 -j ACCEPT
       # Allow ICMPv6 everywhere
       $iptables -A INPUT  -p icmpv6 -j ACCEPT
       $iptables -A OUTPUT -p icmpv6 -j ACCEPT
       $iptables -A FORWARD -p icmpv6 -j ACCEPT
fi
       # Allow SSH
       $iptables -A INPUT -p tcp --dport 22 -j ACCEPT
       # Allow loopback interface
       $iptables -A INPUT -i lo -j ACCEPT
       # Stateful so any connection initiated by the server is allowed
       $iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
       $iptables -A INPUT -p icmp -m conntrack --ctstate NEW -j ACCEPT
       $iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
       # Drop anything that doesn't match the above rules
       $iptables -A INPUT -j DROP
       $iptables -A FORWARD -j DROP
done

Edited by Kindling
Maintenance

Share this post


Link to post
Share on other sites

thanks for posting it ;)

Share this post


Link to post
Share on other sites

Hi!

We've just bought a dedicated Linux server and we're trying to follow your guide, our version is Ubuntu 12.04. We've some troubles while running the exe on wine thanks to a shell script:

#! /bin/bash
wine arma3.exe -server -config=A3TestServer.cfg -nosound -nosplash -maxmem=2047 -port=2310

The terminal output shows some errors that we couldn't correct:

err:module:import_dll Library d3d11.dll (which is needed by L"SteamApps\\common\\Arma 3\\arma3.exe") not found

err:module:LdrInitializeThunk Main exe initialization for L"SteamApps\\common\\Arma 3\\arma3.exe" failed, status c0000135

We had the "x3daudio" problem and we've corrected that thanks to your guide, we've also run the "d3dx11_42" winetricks request and it's installed...

Any advice?

EDIT: the problem may be that the parameter "-server" is not loaded but I don't get why since even by using the terminal and executing

wine arma3.exe -server

the errors outputs are the same.

Edited by Hornet_it
Information updated

Share this post


Link to post
Share on other sites

Hi there. I usually start the server via Steam, with the parameters applied by right-clicking the game in the Steam library then choosing Properties and applying them in the 'Launch Options' dialog. Whenever I start the client via WINE, Steam seems to be launched automatically - I think it's dropping the launch options.

Try using 'wine steam.exe -applaunch 107410' in your script, instead. Though this still pops up with a Steam 'Fullscreen or Windowed mode' prompt, you can use 'xdotool' to confirm the default in your script. Perhaps after a short 'sleep'.

Share this post


Link to post
Share on other sites
Hi there. I usually start the server via Steam, with the parameters applied by right-clicking the game in the Steam library then choosing Properties and applying them in the 'Launch Options' dialog. Whenever I start the client via WINE, Steam seems to be launched automatically - I think it's dropping the launch options.

We tried even via steam but it's not working, probably for the same problem... It actually tries to run the game instead of using the parameter "-server" and I really don't know why. I'm not a linux expert so I'll probably just wait for the linux dedicated server release or pay for a windows server license.

Thank you anyway

Share this post


Link to post
Share on other sites

That's very strange. I don't see why it's not working - the -server parameter should really be accepted both ways. When you installed through Steam, all the DirectX libraries should have been installed. Can you verify that you have both /home/arma/.wine/drive_c/windows/system32/d3d11.dll and /home/arma/.wine/drive_c/windows/syswow64/d3d11.dll? If not, you may want to run DXSETUP.exe under the Arma 3/DirectX folder to ensure that all the correct DLLs are installed. Also, in your bash script be sure to add DISPLAY=:99 before your command (or even export DISPLAY=:99) to make the commands in the script aware of the xvfb framebuffer.

Share this post


Link to post
Share on other sites

Well... The problem is that we can't install the directx, which version of wine are you using?

We have previously installed the stable version 1.4 and for the VNC, we're using a software called X2Go, I completely ignored your guide part about that...

this is the error we get when we try to install the directx

X Error of failed request:  BadValue (integer parameter out of range for operation)
 Major opcode of failed request:  147 (RENDER)
 Minor opcode of failed request:  34 (RenderCreateLinearGradient)
 Value in failed request:  0x0
 Serial number of failed request:  1703
 Current serial number in output stream:  1763

We're upgrading to the latest wine build just to see if the compatibility issue may be fixed...

Share this post


Link to post
Share on other sites

I'm using 1.5.25, the latest version. X2Go doesn't use VNC - it uses the NoMachine NX protocol which is markedly different. I'm not sure if this would have any effect on getting the server running - it shouldn't do, but you should try the full procedure I covered above if updating WINE and double-checking application parameters in Steam doesn't help, just in case. Steam should have installed DirectX itself - you could try again installing it in silent mode, using 'wine dxsetup.exe /silent' or 'wine dxsetup.exe /q' (I forget which). Looking at the WINE git repository, the first implementation of d3d11 was mid-december 2012 so it is unlikely that WINE 1.4 would support even the server component of ARMA 3 as it was released more than a year ago.

Share this post


Link to post
Share on other sites
I'm using 1.5.25, the latest version. X2Go doesn't use VNC - it uses the NoMachine NX protocol which is markedly different. I'm not sure if this would have any effect on getting the server running - it shouldn't do, but you should try the full procedure I covered above if updating WINE and double-checking application parameters in Steam doesn't help, just in case. Steam should have installed DirectX itself - you could try again installing it in silent mode, using 'wine dxsetup.exe /silent' or 'wine dxsetup.exe /q' (I forget which). Looking at the WINE git repository, the first implementation of d3d11 was mid-december 2012 so it is unlikely that WINE 1.4 would support even the server component of ARMA 3 as it was released more than a year ago.

Thanks for the answer, we've actually found that the WINE version was our problem, now we've other problems with PlayOnLinux which was previously installed by one of the server admin (Unfortunately I wasn't available to help during the server installation)... Steam is kinda divided into 2 or more directories because of that and whenever we try to start the server now it doesn't recognize that steam is already running. We're trying to just uninstall WINE and PlayOnLinux and follow your guide from the installation point. Hopefully everything is going to work!

Thanks again, hopefully I'll post again with a solution.

EDIT: Everything's solved, server is up and running! Thanks for the help, if anyone else would have the same problem follow this guide and if you have PlayOnLinux or an older version of WINE update and uninstall PlayOnLinux!

Edited by Hornet_it
Updated Information

Share this post


Link to post
Share on other sites

I keep getting this error when trying to install steam with winetricks, even after following the instructions carefully...

Am I completely missing something? I'm running this via ssh in an Ubuntu 12.10 VPS using the latest version of WINE.

wine cmd.exe /c echo '%ProgramFiles%' returned empty string

wine cmd.exe /c echo '%ProgramFiles%' returned unexpanded string '%SystemDrive%\Program Files' ... can be caused a corrupt wineprefix, an old wine, or by not owning /home/arma/.wine

Edited by deltahawk5

Share this post


Link to post
Share on other sites

That's an odd error - have you tried clearing out the .wine directory with 'rm -rf .wine', running 'wineboot' and trying to install Steam again? You only have a single version of WINE installed, right?

You could also try wine regedit (once you have xvfb and VNC setup) and adding the following values to 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' in the registry:

"ProgramFiles"="C:\\Program Files"

"SystemDrive"="C:"

Also, what's the output of:

wine cmd.exe /c echo '%SystemDrive%'
wine cmd.exe /c echo '%ProgramFiles%'

If you run them manually?

Share this post


Link to post
Share on other sites

Thanks for your guide, most helpful!

I had two issues to get steam up and running in wine: First one was a checksum mismatch (apparently SteamInstall.msi was updated after winetricks), so I updated the winetricks script with the sha1 checksum from the downloaded SteamInstall.msi, second was crashing of wine after a lot of alsa related messages, which was resolved by loading the alsa dummy sound card driver with

modprobe snd-dummy

All was fine after solving these two points.

Share this post


Link to post
Share on other sites

Hi all,

Arma2 installed on wine, the server start but Steam want go offline :( I dont understand why. My credentials are saved on remote system. I try to edit the steam.cnf to force offline mode but steam wont start if offline ....

Share this post


Link to post
Share on other sites
out of curiosity, is there any benefit to running a server over wine?

As opposed to running the native dedicated server on Linux? You have the ability to load extension DLLs that are required for some plugins and you can run Windows-specific utilities. Of course, with no current dedicated Linux binaries you can't run the server any other way on a Linux system at the moment.

As opposed to running on Windows? You have more control over low-level aspects of your server (eg. tweaking scheduler), Linux's system overhead is much lower (even running WINE), you have all the Linux administrative perks (Linux is architecturally more secure, much more stable and is free and open source).

Hi all,

Arma2 installed on wine, the server start but Steam want go offline :( I dont understand why. My credentials are saved on remote system. I try to edit the steam.cnf to force offline mode but steam wont start if offline ....

What does Steam do when you attempt to run it in offline mode, simply exit or does it still try to run online? I've never tried running it always-offline, I simply use Steam -> Go Offline in the menu when required. Have you tried that?

Share this post


Link to post
Share on other sites

Hello,

when I click go offline in the upper-left menu of steam, nothing happen. Nor leaving credential on the server. I solved with a brutal steam process kill.

Arma start fine and smooth but after random time crash. I am monitorig server resources (cpu, ram, rw) and is all ok. I run a wasteland with 50 players ingame, we play for 15 minutes and then it crash. I run a simple edit mission with 2 players ingame, some AI .... it crash after 10 minutes ....

peppe

Share this post


Link to post
Share on other sites

Looks like I have the same problems as @HitmanFF, but the ALSA errors remain. When I try modprobe as arma user, there are alot of permission errors, doing is as root and redoing it as arma seems to work (doesn't output anything) and the error remains.

fixme:heap:HeapSetInformation (nil) 1 (nil) 0
[2013-03-28 16:34:24] Startup - updater built Mar 25 2013 21:39:34
fixme:advapi:EventRegister {47a9201e-73b0-42ce-9821-7e134361bc6f}, 0x3f005530, 0x3f036b40, 0x3f036b38
fixme:advapi:EventRegister {58a9201e-73b0-42ce-9821-7e134361bc70}, 0x3f005530, 0x3f036b78, 0x3f036b70
fixme:advapi:EventRegister {3fa9201e-73b0-43fe-9821-7e145359bc6f}, 0x3f005530, 0x3f036b08, 0x3f036b00
fixme:advapi:EventRegister {1432afee-73b0-42ce-9821-7e134361b433}, 0x3f005530, 0x3f036bb0, 0x3f036ba8
fixme:advapi:EventRegister {4372afee-73b0-42ce-9821-7e134361b519}, 0x3f005530, 0x3f036be8, 0x3f036be0
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2013-03-28 16:34:24] Checking for update on startup
[2013-03-28 16:34:24] Checking for available updates...
fixme:winhttp:WinHttpDetectAutoProxyConfigUrl discovery via DHCP not supported
[2013-03-28 16:34:25] Nothing to do
[2013-03-28 16:34:25] Verifying installation...
[2013-03-28 16:34:25] Verification complete
fixme:advapi:EventRegister {47a9201e-73b0-42ce-9821-7e134361bc6f}, 0x3f005530, 0x3f036b40, 0x3f036b38
fixme:advapi:EventRegister {58a9201e-73b0-42ce-9821-7e134361bc70}, 0x3f005530, 0x3f036b78, 0x3f036b70
fixme:advapi:EventRegister {3fa9201e-73b0-43fe-9821-7e145359bc6f}, 0x3f005530, 0x3f036b08, 0x3f036b00
fixme:advapi:EventRegister {1432afee-73b0-42ce-9821-7e134361b433}, 0x3f005530, 0x3f036bb0, 0x3f036ba8
fixme:advapi:EventRegister {4372afee-73b0-42ce-9821-7e134361b519}, 0x3f005530, 0x3f036be8, 0x3f036be0
fixme:process:SetProcessShutdownParameters (00000100, 00000000): partial stub.
fixme:iphlpapi:NotifyAddrChange (Handle 0x566d6bc, overlapped 0x547af68): stub
fixme:winsock:WSALookupServiceBeginW (0x566d7bc 0x00000ff0 0x566d804) Stub!
[0328/163426:ERROR:network_change_notifier_win.cc(111)] WSALookupServiceBegin failed with: 8
err:pulse:pulse_contextcallback Context failed: Connection refused
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:dbghelp:elf_search_auxv can't find symbol in module
fixme:advapi:EventUnregister deadbeef: stub
fixme:advapi:EventUnregister deadbeef: stub
fixme:advapi:EventUnregister deadbeef: stub
fixme:advapi:EventUnregister deadbeef: stub
fixme:advapi:EventUnregister deadbeef: stub

Fun note: With wine 1.4.1 it started without any problems, but arma3 didn't because of d3d11. Any clues what I'm doing wrong?

Edit: To clarify, I can install and update steam, but nothing after that.

Edited by Katos

Share this post


Link to post
Share on other sites

Hello

1st the last my post I mean arma3, not arma2.

Now the server goes fine without crash, 30 players on domination. Solved steam issue too. Now waiting for an anticheat, ping and TK adds ... Tnx in advance Bis.

Peppe

Share this post


Link to post
Share on other sites

hi, someone can provide help to run Arma 3 in ubuntu server?

sorry for my english!!!

Edited by bullkanox

Share this post


Link to post
Share on other sites

Hi,

I've some trouble to locate the right path for the .Arma3AlphaProfile and the right command line parameter.

I have the username.Arma3AlphaProfile and the username.vars.Arma3AlphaProfile in the /home/username/Documents/Arma 3 Alpha/ directory.

The command line option is: -profiles="/home/username/Documents/Arma 3 Alpha/username.Arma3AlphaProfile"

But no positive results. I change the viewdistance but without results.

Peppe

Share this post


Link to post
Share on other sites

Hi peppe, try this -profiles="/home/username/Documents/Arma\ 3\ Alpha/username.Arma3AlphaProfile"

Share this post


Link to post
Share on other sites

Unfortunately, I don't think this'll work on a RHEL box. All about glibc versions and such.

Edit: Fixed by using the correct versions.

Edited by Jimbo

Share this post


Link to post
Share on other sites
Thanks for the answer, we've actually found that the WINE version was our problem, now we've other problems with PlayOnLinux which was previously installed by one of the server admin (Unfortunately I wasn't available to help during the server installation)... Steam is kinda divided into 2 or more directories because of that and whenever we try to start the server now it doesn't recognize that steam is already running. We're trying to just uninstall WINE and PlayOnLinux and follow your guide from the installation point. Hopefully everything is going to work!

Thanks again, hopefully I'll post again with a solution.

EDIT: Everything's solved, server is up and running! Thanks for the help, if anyone else would have the same problem follow this guide and if you have PlayOnLinux or an older version of WINE update and uninstall PlayOnLinux!

By the way, how did you get past the dxd11.dll error?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×