I'm following a simple guide on the internet about how to create a local server for a specific game on a virtual machine
I did all the steps without problems, but when I test, I can't connect to the server
Someone told me it's happening because my virtual machine IP is 192.168.0.X and it should be 192.168.1.X
I tried to set a static IP, but this didn't work
My question is: How do I make it work using 192.168.0.X IP?
Thanks in advance.
This is the guide I'm following:
Step 1 : Create the linux and prepare it
1) Create Virtual machine on Virtual box with this setup
- core : 2
- ram : 4 gb
- disk space : 50Gb
2) Install Ubuntu 20.04.4
- You must install SSH
3) Execute the following commands
Expand|Select|Wrap|Line Numbers
- - sudo apt update
- - sudo apt upgrade
- - sudo apt install nano
- - sudo apt install net-tools
- - sudo apt install screen
- - sudo apt install unzip
Expand|Select|Wrap|Line Numbers
- - nano /etc/ssh/sshd_config
- - Change or add line: PermitRootLogin yes
- service ssh restart
6) Then setup database
- sudo apt install postgresql
Step 2 : Setup the postgres database
1) Change your user to postgres
Expand|Select|Wrap|Line Numbers
- - su postgres
- - Then write: psql ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'test';
Expand|Select|Wrap|Line Numbers
- - cd /etc/postgresql/12/main
- - Then: sudo su
- - Then: nano pg_hba.conf
- - Change this: host all all 127.0.0.1/32 md5
- - To this: host all all 0.0.0.0/0 md5
Expand|Select|Wrap|Line Numbers
- - nano postgresql.conf
- - Change this: #listen_addresses = 'localhost' # what IP address(es) to listen on;
- - To this: listen_addresses = '*' # what IP address(es) to listen on;
- service postgres restart
Step 3 : Setup the database
1) Change to postgres user
Expand|Select|Wrap|Line Numbers
- - su postgres
- - Copy your database.out to the VM in the folder /home
Expand|Select|Wrap|Line Numbers
- - psql -f database.out
- - Copy your worlds.sql to the VM in the folder /home
Expand|Select|Wrap|Line Numbers
- - INSERT INTO "public"."worlds" VALUES (1010, 'CHANNEL_NAME', 'YOUR_IP', 5712, 0, 150, 1, '002.003.05.67', 1, 0, 1, 100);
Expand|Select|Wrap|Line Numbers
- - psql -d fnaccount -f worlds.sql
- - Copy your serverstatus.sql to the VM in the folder /home
Expand|Select|Wrap|Line Numbers
- - INSERT INTO "public"."serverstatus" VALUES (1010, 'WorldServer', 'YOUR_IP', 5712, '127.0.0.1', 5712, 0);
- INSERT INTO "public"."serverstatus" VALUES (1011, 'ZoneServer', 'YOUR_IP', 10166, '127.0.0.1', 10166, 0);
- INSERT INTO "public"."serverstatus" VALUES (-2, 'MissionServer', 'none', -1, '127.0.0.1', 7654, 1628266391);
- psql -d fndb1 -f serverstatus.sql
Step 4 : Launch the server
Expand|Select|Wrap|Line Numbers
- - Copy paste server folder in /home of your VM
- - sudo su
- - sudo chmod 777 /home/server -R **
- - Change all password database in files
- - Start the server with: ./start