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 Demo Encounters Issues on WSL 2 #101

Closed
Hezhexi2002 opened this issue Oct 24, 2024 · 2 comments
Closed

Running Demo Encounters Issues on WSL 2 #101

Hezhexi2002 opened this issue Oct 24, 2024 · 2 comments

Comments

@Hezhexi2002
Copy link

Description:
I am currently attempting to run the demo within a WSL 2 environment. Despite configuring my .wslconfig file with the recommended settings (networkingMode=mirrored and hostAddressLoopback=true) from microsoft/WSL#10494, I am encountering difficulties accessing the demo application via http://localhost:8081.

When I initially tried mapping the container's port to localhost:8080, I received an error indicating that the port was already in use:

docker: Error response from daemon: driver failed programming external connectivity on endpoint suspicious_joliot (4d6e890f2e22eb4f19366388765105e795725b20f90b1f55fb61f3bf77680a5c): failed to bind port 0.0.0.0:8080/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use.

As a result, I modified the Docker run command to map the container's port to localhost:8081 instead, but the service remains inaccessible from the Windows host.

Steps to Reproduce:
Configured .wslconfig file with the following settings:

[experimental]
#autoMemoryReclaim=gradual # 可以在 gradual 、dropcache 、disabled 之间选择
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
sparseVhd=true
hostAddressLoopback=true

Verified that Docker is up to date (docker -v confirms version 27.3.1).

 docker -v                                                                                                                      
Docker version 27.3.1, build ce12230

Ran the Docker container using the command with port 8081:

docker run --rm \
    -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
    -v $HOME/.anthropic:/home/computeruse/.anthropic \
    -p 5900:5900 \
    -p 8501:8501 \
    -p 6080:6080 \
    -p 8081:8081 \
    -it ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest

Attempted to access the application through http://localhost:8081.
Expected Behavior:

After starting the Docker container, the application should be accessible through http://localhost:8081.

Observed Behavior:

The service seems to be launched successfully but I can't access the http://localhost:8081 from my browser.here is the output and screenshot on browser:

docker run --rm \                                                                                                              ─╯
   -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
   -v $HOME/.anthropic:/home/computeruse/.anthropic \
   -p 5900:5900 \
   -p 8501:8501 \
   -p 6080:6080 \
   -p 8081:8080 \
   -it ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest
Xvfb started successfully on display :1
Xvfb PID: 9
starting tint2 on display :1 ...
starting mutter
starting vnc
PORT=5900
starting noVNC
noVNC started successfully
✨ Computer Use Demo is ready!
➡️  Open http://localhost:8080 in your browser to begin
x11vnc process crashed, restarting...
x11vnc stderr output:
24/10/2024 09:06:21 No client after 60 secs.
24/10/2024 09:06:21 deleted 32 tile_row polling images.
starting vnc
PORT=5900
2024-10-24 09:06:47.965 Did not auto detect external IP.
Please go to https://docs.streamlit.io/ for debugging hints.
x11vnc process crashed, restarting...
x11vnc stderr output:
24/10/2024 09:07:28 No client after 60 secs.
24/10/2024 09:07:28 deleted 32 tile_row polling images.
starting vnc
PORT=5900
x11vnc process crashed, restarting...
x11vnc stderr output:
24/10/2024 09:08:35 No client after 60 secs.
24/10/2024 09:08:35 deleted 32 tile_row polling images.
starting vnc
PORT=5900

image

System Details:

Operating System: Windows 11
WSL Version: 2.2.4.0
Linux Distribution: Ubuntu 20.04
Docker Version: 27.3.1

Is there any additional configuration required in the .wslconfig file or elsewhere to ensure that the services are correctly exposed and accessible from the Windows host? Is the port mapping issue related to the networkingMode=mirrored setting?

@Hezhexi2002
Copy link
Author

By temporarily disabling the mirrored network mode in .wslconfig I solved this problem

@Hezhexi2002

This comment was marked as off-topic.

@x5a x5a closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants