Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running zwift with zoffline (offline Server) #177

Open
5 tasks done
hollysheep opened this issue Nov 13, 2024 · 10 comments
Open
5 tasks done

Running zwift with zoffline (offline Server) #177

hollysheep opened this issue Nov 13, 2024 · 10 comments

Comments

@hollysheep
Copy link

Checklist

  • I have given details of my install including Distribution, Wayland/ XOrg, Parameters Used, echo $XAUTHORITY, etc.
  • I have provided logs showing any errors, if available (use DEBUG=1 zwift)
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of previous issue.

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

...

@netbrain
Copy link
Owner

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 #155)

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

@quietvoid
Copy link
Contributor

You might want to check #34

@hollysheep
Copy link
Author

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
Copy link
Owner

netbrain commented Nov 14, 2024

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

You will have to add the flags yourself manually

@hollysheep
Copy link
Author

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

@netbrain
Copy link
Owner

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

@hollysheep
Copy link
Author

Seems to work.

I need this to edit the hosts file (the short version --add-hosts host1;host2;host3:192.168.10.38 didn't work)
--add-host=us-or-rly101.zwift.com:192.168.10.38 --add-host=secure.zwift.com:192.168.10.38 --add-host=launcher.zwift.com:192.168.10.38

volume mapping works with this:
-v /home/$USER/cacert.pem:/home/user/.wine/drive_c/'Program Files (x86)'/Zwift/data/cacert.pem

First i tried to edit the files directly in the container after running podman run -it --entrypoint=bash --rm ... but thats not possible??? The files will be deleted when i logout and start the container?

@hollysheep
Copy link
Author

It was not easy to 'extract' the content of cacert.pem. To copy files from the container to the host i need the container id. But there is no id when i run podman container ls.

@netbrain
Copy link
Owner

The container is by design autoremoved (--rm) on exit. Simply remove this flag if you want a persistent container.

@netbrain
Copy link
Owner

The container is named, so it probably works as it's Id. Zwift-$USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants