factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
1.02k stars 232 forks source link

Cannot find local game on LAN - Docker on UnRAID #124

Closed jrhamilt closed 5 years ago

jrhamilt commented 6 years ago

Also posted in the factorio reddit: https://www.reddit.com/r/factorio/comments/7tsm9k/cannot_find_local_game_on_lan_docker_and_unraid/

I cannot find a local game on LAN using Docker in UnRAID. I can connect via IP address. not typically a problem, but I need to simplify this for my kids.

I have a bit of a unique setup. I have an UnRAID server that is my NAS and my backup solution for the house. It has the ability to run Docker containers, and as such I'm using your repository

I can successfully connect to this game server correctly through the IP Address, and it appropriately plays the correct save, and everything else. Problem is, that I just don't see it in the LAN list. I run vanilla, with one QoL mod, teleportation. linkmod:teleportation Any help would be appreciated! Edit: I do have Visibility over Lan enabled.

dtandersen commented 6 years ago

Try using host networking. https://github.com/dtandersen/docker_factorio_server/issues/88

jrhamilt commented 6 years ago

This didn't work. I still can connect to the server through IP and port, but it doesn't show up in the LAN list... When I've used the full client to host a game, it has shown up in the LAN list, so not sure what I'm missing at this point.

ZATGamer commented 6 years ago

I run mine on an unraid server also. Works just fine for me, I can find my game in Public and the LAN Menus.

My Container settings: (see image)

image

jrhamilt commented 6 years ago

Well... Those are the same settings I have on the container... What about in the configs section? Anything unique in server-settings?

{
  "name": "myServer on unRAID",
  "description": "Family Server",
  "tags": ["game", "tags"],

  "_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
  "max_players": 0,

  "_comment_visibility": ["public: Game will be published on the official Factorio matching server",
                          "lan: Game will be broadcast on LAN"],
  "visibility":
  {
    "public": false,
    "lan": true
  },

  "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
  "username": "",
  "password": "",

  "_comment_token": "Authentication token. May be used instead of 'password' above.",
  "token": "",

  "game_password": "",

  "_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
  "require_user_verification": false,

  "_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
  "max_upload_in_kilobytes_per_second": 0,

  "_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
  "minimum_latency_in_ticks": 0,

  "_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
  "ignore_player_limit_for_returning_players": false,

  "_comment_allow_commands": "possible values are, true, false and admins-only",
  "allow_commands": "admins-only",

  "_comment_autosave_interval": "Autosave interval in minutes",
  "autosave_interval": 10,

  "_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
  "autosave_slots": 5,

  "_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
  "afk_autokick_interval": 0,

  "_comment_auto_pause": "Whether should the server be paused when no players are present.",
  "auto_pause": true,

  "only_admins_can_pause_the_game": true,

  "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
  "autosave_only_on_server": true,

  "_comment_non_blocking_saving": "Highly experimental feature, enable only at your own risk of losing your saves. On UNIX systems, server will fork itself to create an autosave. Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.",
  "non_blocking_saving": false,

  "_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
  "admins": []
}
ZATGamer commented 6 years ago

I think you need to add a password for access to the server:

"game_password": "set me",

here is mine with usernames and passwords changed.

{
  "name": "Barragree.net",
  "description": "Barragree.net Private Server",
  "tags": ["game", "tags"],

  "_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
  "max_players": 0,

  "_comment_visibility": ["public: Game will be published on the official Factorio matching server",
                          "lan: Game will be broadcast on LAN"],
  "visibility":
  {
    "public": true,
    "lan": true
  },

  "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
  "username": "UsernameHere",
  "password": "",

  "_comment_token": "Authentication token. May be used instead of 'password' above.",
  "token": "Tokenfromthefactiorowebsite",

  "game_password": "you whish you knew",

  "_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
  "require_user_verification": true,

  "_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
  "max_upload_in_kilobytes_per_second": 0,

  "_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
  "minimum_latency_in_ticks": 0,

  "_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
  "ignore_player_limit_for_returning_players": false,

  "_comment_allow_commands": "possible values are, true, false and admins-only",
  "allow_commands": "admins-only",

  "_comment_autosave_interval": "Autosave interval in minutes",
  "autosave_interval": 10,

  "_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
  "autosave_slots": 5,

  "_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
  "afk_autokick_interval": 0,

  "_comment_auto_pause": "Whether should the server be paused when no players are present.",
  "auto_pause": true,

  "only_admins_can_pause_the_game": true,

  "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
  "autosave_only_on_server": true,

  "_comment_non_blocking_saving": "Highly experimental feature, enable only at your own risk of losing your saves. On UNIX systems, server will fork itself to create an autosave. Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.",
  "non_blocking_saving": true,

  "_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
  "admins": ["user1", "user2"]
}
dtandersen commented 6 years ago

I'll leave this open for a bit for troubleshooting, but I don't think anything needs to change on this end.

jrhamilt commented 6 years ago

I appreciate you leaving it open. I tend to agree, it's likely not on your end. I've tried making it public, and adding the password. Neither thing worked.

I do notice that I have trouble with my hostname on this (and other linux servers) propagating in my network. Don't know if that's related from a broadcast perspective, but if they are related, perhaps solving one solves all?

TrueOsiris commented 6 years ago

This is a consequence of how docker works and unraid firewalling. I was also forced to publish the factorio hosts on the public server (with passwords), because I did not want to mess with iptables on the unraid host. You could, besides a bridged network, add an extra network to the docker container, like macvlan, and add a route on the unraid host. I however, would recommend against that, because of security.

SuperSandro2000 commented 5 years ago

I think changing the network mode to host should resolve this issue.

j9ac9k commented 1 year ago

I come from the google search results; had the same issue, but instead of needing to be set to "host" networking, I had to set a custom bridge option (which I noticed was one of the network devices).

image

Thanks for maintaining this docker image!