netbrain / zwift

Easily zwift on linux
The Unlicense
279 stars 32 forks source link

Running zwift with zoffline (offline Server) #177

Open hollysheep opened 4 days ago

hollysheep commented 4 days ago

Checklist

Describe the issue

I want to run zwift in Linux with my zoffline Server (https://github.com/zoffline/zwift-offline). For that i need to redirect zwift to the Server or localhost when Server is running in the same device. I have to edit the hosts file and some files for authentification.

Problem: where can i find that files?

Distribution Details

Ubuntu 24.04, xorg

Reproduction steps

  1. Installing zwift in linux
  2. installing zoffline
  3. ...

netbrain commented 4 days ago

For manipulating the hosts file you might want to look into the --add-host flag.

you can also probably do some volume mapping with -v in order to override other files.

But in essence you probably want to start the container in interactive mode. start with running zwift with DEBUG=1 zwift

This should show you your podman or docker command that it runs. Copy that and add the-it flag and--entrypoint=bash to make it run interactively (as described here https://github.com/netbrain/zwift/issues/155)

you should then be running a bash terminal within the container, where you can experiment with zwift-offline. Good luck!

quietvoid commented 4 days ago

You might want to check https://github.com/netbrain/zwift/pull/34

hollysheep commented 4 days ago

When i run DEBUG=1 zwift i see this line:

podman run --rm --privileged --network bridge --name zwift-ich --security-opt label=disable --hostname ich-zwift -e DISPLAY=:0.0 -e ZWIFT_UID=1000 -e ZWIFT_GID=1000 -e PULSE_SERVER=/run/user/1000/pulse/native -v zwift-ich:/home/user/.wine/drive_c/users/user/Documents/Zwift -v /run/user/1000/pulse:/run/user/1000/pulse -d --device=/dev/dri:/dev/dri -e DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -v /run/user/1000/bus:/run/user/1000/bus -e XAUTHORITY=/home/ich/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/ich/.Xauthority:/home/ich/.Xauthority --userns keep-id:uid=1000,gid=1000 docker.io/netbrain/zwift:latest

Then i run this command with INTERACTIVE=1 (INTERACTIVE=1 podman run ...)? As i understand this will add -it and --entrypoint=bash? When i do this zwift starts without any output in the terminal.

you can also probably do some volume mapping with -v in order to override other files.

is -v a option for the command zwift or podman?

netbrain commented 4 days ago

No INTERACTIVE=1 is not a thing yet. Just a feature request.

You will have to add the flags yourself manually

hollysheep commented 18 hours ago

But i don't understand where to add this flags? Is this a feature of Podman/Docker or your Zwift Container?

netbrain commented 10 hours ago
podman run -it --entrypoint=bash --rm --privileged --network bridge --name zwift-ich --security-opt label=disable --hostname ich-zwift -e DISPLAY=:0.0 -e ZWIFT_UID=1000 -e ZWIFT_GID=1000 -e PULSE_SERVER=/run/user/1000/pulse/native -v zwift-ich:/home/user/.wine/drive_c/users/user/Documents/Zwift -v /run/user/1000/pulse:/run/user/1000/pulse --device=/dev/dri:/dev/dri -e DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -v /run/user/1000/bus:/run/user/1000/bus -e XAUTHORITY=/home/ich/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/ich/.Xauthority:/home/ich/.Xauthority --userns keep-id:uid=1000,gid=1000 docker.io/netbrain/zwift:latest