[GH-ISSUE #4748] [Bug]: Valheim Not Listening on Configured Port #2946

Closed
opened 2026-02-27 03:06:27 +03:00 by kerem · 3 comments
Owner

Originally created by @gvschilling on GitHub (Jan 14, 2025).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4748

User story

As a user, I want vhserver to listen on the configured gameport

Game

Valheim

Linux distro

Ubuntu 20.04

Command

command: start, command: details

Further information

My vhserver instance (running as a pod in k8s) is configured to run on the standard port 2456, but the server is listening on 33240 instead.

Relevant log output

./vhserver details:


Distro Details
============================================================================================================================================================
Date:         Tue Jan 14 21:46:47 UTC 2025
Distro:       Ubuntu 20.04.6 LTS
Arch:         x86_64
Kernel:       5.4.0-204-generic
Hostname:     [k8s pod name]
Environment:  docker
Uptime:       26d, 2h, 25m
tmux:         3.0a
glibc:        2.31

Server Resource
============================================================================================================================================================
CPU
Model:      Intel(R) Xeon(R) E-2124 CPU @ 3.30GHz
Cores:      4
Frequency:  3900.000MHz
Avg Load:   7.17, 6.17, 5.77

Memory
Mem:       total  used  free   cached  available
Physical:  55GB   32GB  23GB   8.0GB   23GB
Swap:      8.0GB  94MB  8.0GB

Storage
Filesystem:  /dev/rbd14
Total:       98G
Used:        2.4G
Available:   96G

Network
IP:           0.0.0.0
Internet IP:  [public ip]

Valheim Resource Usage
============================================================================================================================================================
CPU Used:  177%
Mem Used:  1%    608MB

Storage
Total:        2.4G
Serverfiles:  2.3G

Valheim Server Details
============================================================================================================================================================
Server name:      [server name]
App ID:           896660
Server IP:        0.0.0.0:2456
Internet IP:      [public ip]:2456
Server password:  [server password]
Game world:       vhserver
Save interval:    1800s
Master server:    not listed
Status:           STARTED

vhserver Script Details
============================================================================================================================================================
Script name:       vhserver
LinuxGSM version:  v24.3.4
glibc required:    2.15
Discord alert:     off
Email alert:       off
Gotify alert:      off
IFTTT alert:       off
Pushbullet alert:  off
Pushover alert:    off
Rocketchat alert:  off
Slack alert:       off
Telegram alert:    off
Update on start:   off
User:              linuxgsm
Location:          /opt/linuxgsm

Backups
============================================================================================================================================================
No Backups created

Command-line Parameters
============================================================================================================================================================
 ./valheim_server.x86_64 -name '[server name]' -password [server password] -port 2456 -world vhserver -public 0 -savedir '/opt/linuxgsm/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -crossplay -instanceid 1

Ports
============================================================================================================================================================
Change ports by editing the parameters in:
/opt/linuxgsm/lgsm/config-lgsm/vhserver

Useful port diagnostic command:
ss -tuplwn | grep valheim_server.

DESCRIPTION  PORT  PROTOCOL  LISTEN
Game         2456  udp       0
Query        1     udp       0

Status: STARTED

ss -tuplwn | grep valheim_server

udp     UNCONN   0        0                0.0.0.0:2457           0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=46))

udp     UNCONN   0        0                0.0.0.0:49582          0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=50))

udp     UNCONN   0        0                      *:33240                *:*      users:(("valheim_server.",pid=38028,fd=45))

tcp     LISTEN   0        128            127.0.0.1:46109          0.0.0.0:*      users:(("valheim_server.",pid=38028,fd=33))

Steps to reproduce

  1. Create a new vhserver instance as a Kubernetes service
  2. In the service's ports spec, have a non-standard port be setup to forward towards the standard port, i.e.:
ports:
- name: game
  nodePort: 30000
  port: 2456
  protocol: UDP
  targetPort: 2456
  1. Have the container, as a statefulset, be set to listen to the standard port, i.e.:
containers:
- name: {{ .Chart.Name }}
  securityContext:
    {{- toYaml .Values.securityContext | nindent 12 }}
  image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  imagePullPolicy: {{ .Values.image.pullPolicy }}
  ports:
  - name: game
    containerPort: 2456
    protocol: UDP
  1. Have port-forwarding setup at the router-level so that inbound traffic to port 30000 goes to the Kubernetes cluster
  2. Start the server
  3. Run the ss -tuplwn | grep valheim_server command
  4. Notice that the listening port is not 2456
  5. Have users attempt to connect to [public ip address]:30000
  6. Users fail to connect
Originally created by @gvschilling on GitHub (Jan 14, 2025). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4748 ### User story As a user, I want vhserver to listen on the configured gameport ### Game Valheim ### Linux distro Ubuntu 20.04 ### Command command: start, command: details ### Further information My vhserver instance (running as a pod in k8s) is configured to run on the standard port 2456, but the server is listening on 33240 instead. ### Relevant log output # ./vhserver details: ```shell Distro Details ============================================================================================================================================================ Date: Tue Jan 14 21:46:47 UTC 2025 Distro: Ubuntu 20.04.6 LTS Arch: x86_64 Kernel: 5.4.0-204-generic Hostname: [k8s pod name] Environment: docker Uptime: 26d, 2h, 25m tmux: 3.0a glibc: 2.31 Server Resource ============================================================================================================================================================ CPU Model: Intel(R) Xeon(R) E-2124 CPU @ 3.30GHz Cores: 4 Frequency: 3900.000MHz Avg Load: 7.17, 6.17, 5.77 Memory Mem: total used free cached available Physical: 55GB 32GB 23GB 8.0GB 23GB Swap: 8.0GB 94MB 8.0GB Storage Filesystem: /dev/rbd14 Total: 98G Used: 2.4G Available: 96G Network IP: 0.0.0.0 Internet IP: [public ip] Valheim Resource Usage ============================================================================================================================================================ CPU Used: 177% Mem Used: 1% 608MB Storage Total: 2.4G Serverfiles: 2.3G Valheim Server Details ============================================================================================================================================================ Server name: [server name] App ID: 896660 Server IP: 0.0.0.0:2456 Internet IP: [public ip]:2456 Server password: [server password] Game world: vhserver Save interval: 1800s Master server: not listed Status: STARTED vhserver Script Details ============================================================================================================================================================ Script name: vhserver LinuxGSM version: v24.3.4 glibc required: 2.15 Discord alert: off Email alert: off Gotify alert: off IFTTT alert: off Pushbullet alert: off Pushover alert: off Rocketchat alert: off Slack alert: off Telegram alert: off Update on start: off User: linuxgsm Location: /opt/linuxgsm Backups ============================================================================================================================================================ No Backups created Command-line Parameters ============================================================================================================================================================ ./valheim_server.x86_64 -name '[server name]' -password [server password] -port 2456 -world vhserver -public 0 -savedir '/opt/linuxgsm/.config/unity3d/IronGate/Valheim' -saveinterval 1800 -backups 4 -backupshort 7200 -backuplong 43200 -crossplay -instanceid 1 Ports ============================================================================================================================================================ Change ports by editing the parameters in: /opt/linuxgsm/lgsm/config-lgsm/vhserver Useful port diagnostic command: ss -tuplwn | grep valheim_server. DESCRIPTION PORT PROTOCOL LISTEN Game 2456 udp 0 Query 1 udp 0 Status: STARTED ``` # ss -tuplwn | grep valheim_server ```shell udp UNCONN 0 0 0.0.0.0:2457 0.0.0.0:* users:(("valheim_server.",pid=38028,fd=46)) udp UNCONN 0 0 0.0.0.0:49582 0.0.0.0:* users:(("valheim_server.",pid=38028,fd=50)) udp UNCONN 0 0 *:33240 *:* users:(("valheim_server.",pid=38028,fd=45)) tcp LISTEN 0 128 127.0.0.1:46109 0.0.0.0:* users:(("valheim_server.",pid=38028,fd=33)) ``` ### Steps to reproduce 1. Create a new vhserver instance as a Kubernetes service 2. In the service's ports spec, have a non-standard port be setup to forward towards the standard port, i.e.: ```yaml ports: - name: game nodePort: 30000 port: 2456 protocol: UDP targetPort: 2456 ``` 3. Have the container, as a statefulset, be set to listen to the standard port, i.e.: ```yaml containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: game containerPort: 2456 protocol: UDP ``` 4. Have port-forwarding setup at the router-level so that inbound traffic to port 30000 goes to the Kubernetes cluster 6. Start the server 7. Run the `ss -tuplwn | grep valheim_server` command 8. Notice that the listening port is not 2456 9. Have users attempt to connect to [public ip address]:30000 10. Users fail to connect
Author
Owner

@rtdean commented on GitHub (Jan 21, 2025):

This might be an issue with the Valheim dedicated server executable itself, possibly in relation to the crossplay setting. When crossplay is enabled:

If you’re using the Crossplay backend (enabled
using the “
-crossplay” argument), you do not
need to do Port Forwarding on your Router. The
Port number is still used to distinguish between
multiple servers on the same public IP address.

What I suspect might be happening here (haven't broken out the debugger yet) is that crossplay is changing the networking path and a different port is being opened up to connect with the PlayFab backend

<!-- gh-comment-id:2605535273 --> @rtdean commented on GitHub (Jan 21, 2025): This might be an issue with the Valheim dedicated server executable itself, possibly in relation to the crossplay setting. When crossplay is enabled: If you’re using the Crossplay backend (enabled using the “ -crossplay” argument), you do not need to do Port Forwarding on your Router. The Port number is still used to distinguish between multiple servers on the same public IP address. What I suspect might be happening here (haven't broken out the debugger yet) is that crossplay is changing the networking path and a different port is being opened up to connect with the PlayFab backend
Author
Owner

@gvschilling commented on GitHub (Jan 21, 2025):

@rtdean This does look to be crossplay-related. I turned off crossplay (removed the switch from startparameters in the vhserver.cfg file), saw the server now listening to *:2456, and am now able to connect.

I then:

  1. Stopped the server (./vhserver stop)
  2. Installed the crossplay-related dependencies (sudo apt update && sudo apt install libatomic1 libpulse0 libpulse-dev)
  3. Started the server again (./vhserver start)
  4. Could no longer connect

This Reddit link seems to explain that it is in fact a crossplay issue with PlayFab.

I can go ahead and close this ticket out, but I have two suggestions:

  1. Make crossplay "opt in" rather than "opt out." This may just be my personal preference here with how I am using LGSM/vhserver, but it doesn't feel intuitive that an OOTB feature would prevent "expected" behavior from working (that being, when I define a port, I expect that to be the port that my server is listening on and the port that folks use to connect to me)
  2. Make turning crossplay on/off "cleaner." For example, being able to just add crossplay="false" in my vhserver.cfg file, versus having to copy the full startparameters value out of the _default.cfg file.
    • May be even simpler to have crossplay="-crossplay" in the _default.cfg file and then add "... ${crossplay} ..." to the startparameters value in the _default.cfg file. Then, when turning off crossplay, all one needs to do is add crossplay="" in their vhserver.cfg file
<!-- gh-comment-id:2605657344 --> @gvschilling commented on GitHub (Jan 21, 2025): @rtdean This does look to be crossplay-related. I turned off crossplay (removed the switch from `startparameters` in the `vhserver.cfg` file), saw the server now listening to `*:2456`, and am now able to connect. I then: 1. Stopped the server (`./vhserver stop`) 2. Installed the crossplay-related dependencies (`sudo apt update && sudo apt install libatomic1 libpulse0 libpulse-dev`) 3. Started the server again (`./vhserver start`) 4. Could no longer connect [This Reddit link](https://www.reddit.com/r/valheim/comments/xshlyk/comment/jgh0588/) seems to explain that it is in fact a crossplay issue with PlayFab. I can go ahead and close this ticket out, but I have two suggestions: 1. Make crossplay "opt in" rather than "opt out." This may just be my personal preference here with how I am using LGSM/vhserver, but it doesn't feel intuitive that an OOTB feature would prevent "expected" behavior from working (that being, when I define a port, I expect that to be the port that my server is listening on and the port that folks use to connect to me) 2. Make turning crossplay on/off "cleaner." For example, being able to just add `crossplay="false"` in my `vhserver.cfg` file, versus having to copy the full `startparameters` value out of the `_default.cfg` file. * May be even simpler to have `crossplay="-crossplay"` in the `_default.cfg` file and then add `"... ${crossplay} ..."` to the `startparameters` value in the `_default.cfg` file. Then, when turning off crossplay, all one needs to do is add `crossplay=""` in their `vhserver.cfg` file
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:3832339435 --> @github-actions[bot] commented on GitHub (Feb 2, 2026): This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2946
No description provided.