Open DarwishCodes opened 2 years ago
For me it took a while in order for the router to update the port forwarding.
For me it took a while in order for the router to update the port forwarding.
Thanks for your reply. Also, sorry for late reply. I didn't figure out where the problem is till this day, But thanks so much for your reply.
The exact same problem is happening to me. I deployed it on my apple M1 mac mini, using docker-compose. I'm using a iptime router and fort forwarded from 2456-2458 to 2456-2458 on TCP & UDP.
Update: I followed steps on my intel macbook, and successed. Maybe it is a part of apple silicon problem.
I'm running into this exact issue on an ubuntu LXC, tried a couple of methods of defining and starting the server, but no luck so far.
My setup is on a Proxmox hypervisor, all ports are forwarded and the machine is accessible, but no luck.
At the moment I am using the provided default docker_compose configuration, with barely any change.
I had this same issue after restarting my container. Another restart and it was solved. It took a while for the container to spin up but that solved it.
Same issue: 'Waiting for server to listen on UDP port 2456' every 5 seconds. Clients cannot connect to the server.
Ports are forwarded by iptables on the host machine.
@DarwishCodes Is there a reason why you're trying to run this on an ARM machine? while binfmt works it tends to run at about 1/5 the performance of the intended target. that might be causing the delay in the port binding.
If you’re attempting to run the server on ARM or Apple Silicon, try using lima to create a VM and set arch: x86_64 with bridged networking. Docker for M1 uses user-level QEMU emulation, which is faster but not as accurate as system-level QEMU emulation. I was able to get it to work on my M1 mini this way.
So you set linux VM using lima and install docker in it then run this image. Is that right?
So you set linux VM using lima and install docker in it then run this image. Is that right?
Yes, with a few modifications by mixing the docker and vmnet example yamls. At the bottom is the manifest I used to initiate the VM. Change disk
, cpus
, and memory
to whatever you'd like. The important additions are arch: "x86_64"
which enables system-level (slow but accurate) QEMU emulation instead of user-level (fast but inaccurate) QEMU emulation and networks: - lima: bridged
. Note: bridged networking will create a separate hostname (lima-
As mentioned in the docs, before initialising the VM, run:
# Install socket_vmnet
brew install socket_vmnet
# Set up the sudoers file for launching socket_vmnet from Lima
limactl sudoers >etc_sudoers.d_lima
sudo install -o root etc_sudoers.d_lima /etc/sudoers.d/lima
Using the below template, run limactl start --name=valheim-server ./valheim-server.yaml
, run the docker image, then forward your ports and wait for it to connect.
# valheim-server.yaml
arch: "x86_64"
disk: 30GiB
cpus: 4
memory: 6GB
networks:
- lima: bridged
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
# This example requires Lima v0.8.0 or later
images:
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20221201/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:8a814737df484d9e2f4cb2c04c91629aea2fced6799fc36f77376f0da91dba65"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20221201/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
digest: "sha256:8a0477adcbdadefd58ae5c0625b53bbe618aedfe69983b824da8d02be0a8c961"
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
# containerd is managed by Docker, not by Lima, so the values are set to false here.
containerd:
system: false
user: false
provision:
- mode: system
# This script defines the host.docker.internal hostname when hostResolver is disabled.
# It is also needed for lima 0.8.2 and earlier, which does not support hostResolver.hosts.
# Names defined in /etc/hosts inside the VM are not resolved inside containers when
# using the hostResolver; use hostResolver.hosts instead (requires lima 0.8.3 or later).
script: |
#!/bin/sh
sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v docker >/dev/null 2>&1 && exit 0
export DEBIAN_FRONTEND=noninteractive
curl -fsSL https://get.docker.com | sh
# NOTE: you may remove the lines below, if you prefer to use rootful docker, not rootless
systemctl disable --now docker
apt-get install -y uidmap dbus-user-session
- mode: user
script: |
#!/bin/bash
set -eux -o pipefail
systemctl --user start dbus
dockerd-rootless-setuptool.sh install
docker context use rootless
probes:
- script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "docker is not installed yet"
exit 1
fi
if ! timeout 30s bash -c "until pgrep rootlesskit; do sleep 3; done"; then
echo >&2 "rootlesskit (used by rootless docker) is not running"
exit 1
fi
hint: See "/var/log/cloud-init-output.log". in the guest
hostResolver:
# hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also
# resolve inside containers, and not just inside the VM itself.
hosts:
host.docker.internal: host.lima.internal
portForwards:
- guestSocket: "/run/user/{{.UID}}/docker.sock"
hostSocket: "{{.Dir}}/sock/docker.sock"
message: |
To run `docker` on the host (assumes docker-cli is installed), run the following commands:
------
docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock"
docker context use lima-{{.Name}}
docker run hello-world
------
I'm running arm64 from Oracle Cloud. and using tonistiigi/binfmt. Please, take a look at the log :
I've port forwarded 2456.
Thanks