2025-05-09 5:39:57 PM
Status:
Tags:
Linux (Ubuntu 24.04 no GUI) server with pure cmangos forks (SUCCESS)
Start by forking cmangos' mangos-classic, classic-db, and playerbots: - https://github.com/cmangos/mangos-classic - https://github.com/cmangos/classic-db - https://github.com/cmangos/playerbots
My forks: - https://github.com/Edgetune/mangos-classic - https://github.com/Edgetune/classic-db - https://github.com/Edgetune/playerbots
Most of the instructions below are from the official CMaNGOS instructions and a little bit from nirv's video and instructions (https://www.youtube.com/watch?v=pa-kLvQEMpk and https://abs.freemyip.com:84/api/public/dl/RDnKyR00?inline=true (second link was formerly located here: https://nirv.mooo.com:84/api/public/dl/RDnKyR00?inline=true)).
Note
I recommend enabling SSH on your server so that you can paste in commands.
- Prerequisites for Building CMaNGOS with Playerbots on Ubuntu
🧰 Install Required Packages
Open your terminal and run:
sudo apt install build-essential gcc g++ automake git-core autoconf make patch libmysql++-dev mysql-server libtool libssl-dev grep binutils zlib1g-dev libbz2-dev cmake libboost-all-dev
Upgrade your default compiler version to GCC 12 to avoid potential problems:
sudo apt install g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12
Also ensure MySQL is running (and set to start on boot):
sudo systemctl enable --now mysql
sudo systemctl status mysql
- Clone Your Forks
Choose and create a working directory (e.g., ~/cmangos) and clone:
mkdir -p ~/cmangos && cd ~/cmangos
git clone https://github.com/Edgetune/mangos-classic.git
git clone https://github.com/Edgetune/classic-db.git
git clone https://github.com/Edgetune/playerbots.git
cd mangos-classic
git remote add upstream https://github.com/cmangos/mangos-classic.git
git remote set-url --push upstream no_push
cd ..
cd classic-db
git remote add upstream https://github.com/cmangos/classic-db.git
git remote set-url --push upstream no_push
cd ..
cd playerbots
git remote add upstream https://github.com/cmangos/playerbots.git
git remote set-url --push upstream no_push
cd ..
- Create Folders
mkdir ~/cmangos/run && mkdir ~/cmangos/build
- Replace
playerbotsRepo with Your Fork
Edit mangos-classic/src/CMakeLists.txt:
nano mangos-classic/src/CMakeLists.txt
Find these lines:
GIT_REPOSITORY "https://github.com/cmangos/playerbots.git"
GIT_TAG "master"
Replace them with:
GIT_REPOSITORY "https://github.com/Edgetune/playerbots.git"
GIT_TAG "filter/update-playerbot-blacklist"
Save and exit the file.
- Build Mangos with Playerbots
cd ~/cmangos/build
cmake ../mangos-classic \
-DCMAKE_INSTALL_PREFIX=../run \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_EXTRACTORS=ON \
-DPCH=1 \
-DDEBUG=0 \
-DBUILD_PLAYERBOTS=ON \
-DBUILD_DEPRECATED_PLAYERBOT=OFF \
-DBUILD_AHBOT=ON \
-DBUILD_MODULES=ON
make -j$(nproc)
make install
Note
I believe that DBUILD_DEPRECATED_PLAYERBOT will be set to OFF by default, so that line likely isn't necessary.
- Go to the configuration directory and copy these config files to their correct names:
cd ~/cmangos/run/etc
cp ahbot.conf.dist ahbot.conf
cp anticheat.conf.dist anticheat.conf
cp mangosd.conf.dist mangosd.conf
cp realmd.conf.dist realmd.conf
- For the PlayerBot config file, copy this (the one named
aiplayerbot.conf.distalready sitting in~/cmangos/run/etc/won't work. Just leave it there or delete it.):
cp ~/cmangos/mangos-classic/src/modules/PlayerBots/playerbot/aiplayerbot.conf.dist.in ~/cmangos/run/etc/
cp ~/cmangos/run/etc/aiplayerbot.conf.dist.in ~/cmangos/run/etc/aiplayerbot.conf
Extract files from the client
- Copy your Vanilla WoW 1.12 client to your Ubuntu VM
mkdir /home/wowdev/client
scp -r [email protected]:"/mnt/external_1/JohnDoe/Discs and EXEs/WoW Clients/World of Warcraft 1.12/*" /home/wowdev/client/
- Copy all the extractor files to your WoW client directory
cp -v /home/wowdev/cmangos/run/bin/tools/* /home/wowdev/client
- Set the executable flag on the shell scripts
cd /home/wowdev/client
chmod +x ExtractResources.sh MoveMapGen.sh
Note
Ensure the Data directory starts with an uppercase D because extraction is case-sensitive on Linux.
- Run the data extraction:
bash ./ExtractResources.sh
Note
Answer "y" to the question about the data extraction when it asks.
The "high-resolution" question doesn't have to do with graphics, it has to do with maps and pathing, I think. I went with high-resolution this time.
Wait for it to finish. It took my VM (4 cores, 8192MB RAM) just over 35 minutes. It was strange though because my terminal window just closed at that point so I'm just assuming it was done.
- Move the folders
maps,dbc, andvmaps- optionallymmaps,CreatureModelsandCameras- that have been created to~/cmangos/run/bin.
In my case, I didn't have a CreatureModels folder after the extraction. I copied the other optional folders though. And I deleted the buildings folder since the CMaNGOS installation instructions say it's unnecessary.
mv maps dbc vmaps mmaps CreatureModels Cameras /home/wowdev/cmangos/run/bin/
rm -r Buildings
Setting up database
- Ensure mysql is in your path:
which mysql
If that outputs something like /usr/bin/mysql, then you're good to go.
- Check if your MySQL root user has a password:
sudo mysql -u root -p
- If it asks for a password and you know it, great — you're ready.
- If it asks and you don’t know it, you’ll need to reset it.
- If it lets you in without a password, you’re using Unix socket authentication (typical on Ubuntu).
- If it lets you in with your Ubuntu password, you're likely using Unix socket authentication. Check that by running the following command:
sudo mysql
If that lets you in without a password (besides the password for using sudo), you're using Unix Socket Authentication.
- Create the mangos default MySQL user that has full privileges:
Log in to MySQL with root:
sudo mysql
Inside the MySQL prompt, run:
CREATE USER 'mangos'@'localhost' IDENTIFIED BY 'mangos';
GRANT ALL PRIVILEGES ON *.* TO 'mangos'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
- Run the install script:
cd ~/cmangos/classic-db
sudo ./InstallFullDB.sh
Choose option 9 to quit. The InstallFullDB.config file will be generated next to the InstallFullDB.sh. Open the InstallFullDB.config file and ensure the following three configurations are set to these values:
sudo nano InstallFullDB.config
CORE_PATH="/home/wowdev/cmangos/mangos-classic"
AHBOT="YES"
PLAYERBOTS_DB="YES"
CORE_PATH was already correct for me, but I had to switch the other two lines to YES.
- Run the install script again:
sudo ./InstallFullDB.sh
- Choose option 4 to do the
Full installation (create all DB and MySQL user, root required). Enterrootfor the root username and type your system password (assuming you're using Unix socket authentication, otherwise, enter whatever password you set for root). - Choose option 1 to do the
Full default CMaNGOS-core and Classic-DB installation (all DB with MySQL user). TypeDeleteAllto confirm. Wait for it to complete. - Choose option 9 to go back to the main menu and then option 9 again to exit.
Edit configs, change realm server, start server
- Make any desired changes to .conf files in ~/cmangos/run/etc and save them.
- I just changed
aiplayerbot.confand left all the other files untouched. - Create a
logsdirectory and editmangosd.conf:
mkdir ~/cmangos/run/bin/logs
sudo nano ~/cmangos/run/etc/mangosd.conf
# Make sure these two lines look like this:
DataDir = "."
LogsDir = "logs"
- If you need to change the server's IP address from the default 127.0.0.1 so that other machines can connect to the server, do that now:
# Set your server's IP in the database and set your realm name.
sudo mysql -u root
SHOW DATABASES;
USE classicrealmd;
SELECT * FROM realmlist WHERE id=1;
UPDATE realmlist
SET name = 'Malygos', address = '192.168.1.64'
WHERE id = 1;
EXIT;
Note
With the UPDATE command, you can press enter to go to a new line and MySQL will be fine with it as long as you eventually enter a command that ends with a semi-colon, then it will execute it all.
- Set your WoW client realmlist.wtf file to point to your server's IP address (172.28.3.117 in my case).
Note
Before starting mangosd, it is worth disabling bin logs. If you don't and it happens to be enabled by default, your first server startup could take hours. If you ensure it's disabled, it should only take 5 minutes or so to start up.
Check if it's enabled by logging into MySQL:
sudo mysql
Run this SQL command:
SHOW VARIABLES LIKE 'log_bin';
If it isn't already off, exit MySQL, and open the main MySQL configuration file in a text editor:
sudo nano /etc/mysql/mysql.conf.d/mysql.conf
Or, depending on your system, it could also be:
sudo nano /etc/mysql/my.cnf
If you have both, try editing mysql.conf first and try the other if that doesn't work.
Find and remove or comment out (by adding # in front of the line) the following lines if present:
log_bin = /var/log/mysql/mysql-bin.log
server-id = 1
binlog_format = mixed
Add this in that file underneath the [mysqld] section:
[mysqld]
log_bin = 0
skip-log-bin
log_bin=OFF
disable_log_bin
Save and exit the file.
Restart MySQL with:
sudo systemctl restart mysql
Then, verify that it's disabled with the command from the top.
Update: NONE of those config options worked for me so I consulted the official MySQL documentation to get this solution:
sudo systemctl edit mysql
Add this section into the top between the comment blocks where it says it won't get ignored:
[Service]
ExecStart=
ExecStart=/usr/sbin/mysqld --skip-log-bin
Reload systemd:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
Restart MySQL:
sudo systemctl restart mysql
Confirm that log bin is off with:
sudo mysql -e "SHOW VARIABLES LIKE 'log_bin';"
Someone on Discord also says that running in debug mode will significantly increase the time it takes to do anything. I guess that probably applies with me using the RelWithDebInfo build. I wonder if I can just use normal release for my testing.
- Start the server by running these files after using cd to move to the ~/cmangos/run/bin/ directory. If you don't move there it will have trouble finding config files (Run them in separate terminal windows):
cd ~/cmangos/run/bin
./mangosd -c ~/cmangos/run/etc/mangosd.conf -a ~/cmangos/run/etc/ahbot.conf
cd ~/cmangos/run/bin
~/cmangos/run/bin/realmd -c ~/cmangos/run/etc/realmd.conf
- Create your account and set GM level in the mangosd window:
account create [username] [password]
account set gmlevel [username] [0 to 3]
- Start up your WoW client, log in, and play!