Welcome to Open Carnage

A resource for Halo Custom Edition and MCC modding, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time! - EST. 2012

Sign in to follow this  
Followers 0
AntiMomentum

Halo Custom Edition server with Sapp 10.2.1 - Linux- easy

Posted (edited)

Here's the github: www.halopc.org

 

**Edit 10/14/20**

--cap-drop NET_RAW and --cap-drop NET_BIND_SERVICE can be used to give the container less-than-default sudo docker run privileges (see the link about the docker run command below)

example: sudo docker run -it -p 2302:2302/udp --cap-drop NET_RAW --cap-drop NET_BIND_SERVICE antimomentum/haloce
There are probably more privilege drops that work! Feel free to try them out and post your findngs!

Updates will soon be labeled on a monthly basis to collapse this post a bit as well as moved to the bottom of this OP.
ALSO, I recently built a massive container that has a mix of about 12GB of halomap's Top 50 maps for each year available. Of course, not every map in the top listS were used, I picked and chose from each year available. But there are also more recent maps added in, particularly big ones. And some others. Big/exploring maps is sort of the theme for this container. (Not going to lie the current mapcycle needs improvement) Don't forget to pull this or your own containers to make them available forever :) The container is again massive: docker run -it -p 2302:2302/udp antimomentum/top50
You will certainly need more than 25GB to actually run that container, not including host OS space. Use sv_maplist to see the maps available in the container. (The main container below is much smaller)

 

**Edit Update 10/2/2020**
The containers no longer require the --privileged full root access! Commands have been edited accordingly here and on the github :)
Also, now runs sapp 10.2.x with or without UPX compression. The current antimomentum/haloce container now runs 10.2.1 without UPX :)

Reduced docker file build size by removing unneeded layers, saving about 1GB in compressed download/build size.
Here's some information about host access using the docker run command: https://docs.docker.com/engine/reference/run/

Running the docker daemon rootless: https://docs.docker.com/engine/security/rootless/

I'm making this post for what might be the easiest way to get a halo ce server up and running in linux. This method is 100% headless, and *might* even run in free tier cloud services. It's pretty light once it's running :)

 

Full credit for the script, attached here to the post, goes to AugusDogus on github. I fixed the docker stuff. (start.txt is start.sh on the github page if you'd rather just view it).
And full credit to þsϵυdø.þrø×϶n for removing UPX

On the github page you can view "Dockerfile" to see the commands needed to get wine installed manually in Ubuntu 16 lts server (I did this in a host OS before doing it in docker, it works), at which point you can make the /game directory and use the script. halopc.com also has more information about manual installs. The script itself so far with a wine install has worked for me in both Ubuntu 18.04 LTS server and 16.04 LTS server. That's the manual way to do it.  You can also check http://halopc.com/sv_extensions/

Here's the easiest way:
apt update

apt-get install docker.io


Now you have two options. If you want to just get a halo server up and running asap:


docker run -it -p 2302:2302/udp antimomentum/haloce

Make some coffee

Boom. Done.
Assuming you don't have port 2302 blocked, or don't need to do your own usual port forwarding at home, ect. 

The halo server name will appear blank in the game's server list but it's a special character so the the server list arranges it to the top by Server Name. It's running on Bloodgulch. Don't forget to turn off your empty server search filter! Of course, you can change the server name using sv_name in the server console :)

If you want to make your own server container images just check out the github. No need to rely on my container, you can make your own! I also recommend making a Docker account so you can save the container images you make to Docker! That way in literally THREE COMMANDS you can have your server container(s) up and running! (after you've already made them of course lol). I just went with a free account for Docker.

If you want to modify anything including even the docker run command please post your findings for less privileges. The less privileges the better of course :) The docker run command can be given less than default access, please post your findings of least privilege! Whether it be the docker run command, script, or otherwise.

To check your halo/sapp config itself, run sapp's command in the halo console: pl
If it says it's a server function only! you messed something up, but not too bad to keep things from booting lol. Make sure you're using sapp 10.2 or 10.2.1

To run multiple container servers in Ubuntu 18.04 LTS server:

For a VPS install Putty first on your Windows PC to connect to your server, then: 

apt-get install -y screen

screen -S empty

screen -S halo1 docker run -it -p 2302:2302/udp antimomentum/haloce
press ctrl a + d

screen -S halo2 docker run -it -p 2305:2305/udp antimomentum/haloce wineconsole haloceded.exe -port 2305 

press ctrl a + d

ect


With your server images: 

screen -S empty

screen -S halo1 docker run -it -p 2302:2302/udp YourDockerUsername/YourServerImage1

ctrl a + d

screen -S halo2 docker run -it -p 2306:2306/udp YourDockerUsername/YourServerImage2 wineconsole haloceded.exe -port 2306

ctrl a + d

screen -S halo3 docker run -it -p 2307:2307/udp YourDockerUsername/YourServerImage3 wineconsole haloceded.exe -port 2307
 

And so on :) 
Note: The halo1, halo2, halo3 names for screen are made up as you enter the command. No screen pre-configurations are done here :)

Using Putty with the screen command allows you to close the putty window without your halo server containers closing :) 

*10/2/20*: Single core cpu usage runs at 20-40% with 2 full containers. Should be able to squeeze in a 3rd if you think it'll fill. If you think only 2 or less of your server containers will max out to 16 players, at the same time,  you could run like 6+ containers on a single core machine with 1GB of RAM.

 

 

start.txt

Edited by AntiMomentum

Share this post


Link to post
Share on other sites

Tiddy-bits:

Posted (edited)

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.

Edited by Vaporeon
add warning

Share this post


Link to post
Share on other sites

Posted (edited)

On 10/1/2020 at 2:07 AM, Vaporeon said:

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.


So far the resource usage is light with 6 containers running. Granted, I'll know more at a time when players are on to fill at least one or two of the halo servers up.  I'm less concerned with install size personally.

And yes, to be perfectly clear, running as root is opening up to attack. Configuring it to not require root will be the next step for this project. At this point it is functional not secure. It's certainly not in a state where someone would want to set up a server and leave it.

*Edit 10/2*
I put an edit in op, but the antimomentum/haloce container now runs 10.2.1 with UPX removed.

Edited by AntiMomentum

Share this post


Link to post
Share on other sites

Posted (edited)

11 hours ago, Vaporeon said:

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.

Deobfuscated binaries? Where are these avaliable at?

 

@OP

Maybe I'm retarded but whats the point of using docket for this? Getting kind of annoyed about everything being packaged in this or that way, using this software to run, etc. Is it just to make it easier for normies to run?

Edited by Enclusion

Share this post


Link to post
Share on other sites

Posted (edited)

1 hour ago, Enclusion said:

@OP

Maybe I'm retarded but whats the point of using docket for this? Getting kind of annoyed about everything being packaged in this or that way, using this software to run, etc. Is it just to make it easier for normies to run?


No worries. Even plenty of admins I've talked too have only heard the name Docker lol. There are different uses, but being able to have the same environment and quickly is generally the idea. Like virtual machines. Especially useful for software developers, if they write code in one version of an OS they don't necessarily have to worry about it working in others. But in this case for example if you built images of your own halo servers and the game dns master server never goes down, your image will always work on a basic linux machine with internet (there are probably exceptions of course). 

You can even take the automation further with docker-compose.
So say you have 6 different halo servers. You've built an image for each one. You'll never have to do that part again. From there on a fresh host linux install they can all be running in about 4 commands after you copy in the yml. apt update, apt install docker, apt-get install docker-compose, docker-compose up lol (My docker-compose file isn't working. After I deal with the root account issue I'll be fixing up the docker-compose.yml). The halo servers themselves don't have to worry about talking with each other. Docker handles the container networking. They are separate from each other as far as they know which can actually make things easier. 

Even in just network administration it's nice. Because once you have the containers' own network(s) set up that's generally done too even if you are using the same containers in different physical host machines with seperate networking info.

Now imagine you're big data like Google. You now use Kubernetes to control your docker-compose/containers on a vast scale. Load balancing, containerizing databases, controlling hardware resources, ect. A developer pushes a code update, Kubernetes updates the containers safely and you move on. A user makes a new account and the account is accessible from anywhere quickly. Kubernetes takes extra configuration too though. I've never used it. But this is one way that sort of stuff happens

Edited by AntiMomentum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.