From e1e2cf83ac7de229194b8c0a8a13b1dde4d418d3 Mon Sep 17 00:00:00 2001 From: robot-ranger Date: Sat, 13 Jan 2024 12:58:53 -0800 Subject: [PATCH 1/2] wsl port configuration --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index dc0ccae..b2e5663 100644 --- a/README.md +++ b/README.md @@ -227,3 +227,34 @@ docker run --rm -it -p 5900:5900 -v "${HOME}/urcaps:/urcaps" myursim This will install the URCap when running the container and without having to restart the simulator. + +## Run in WSL2; access URsim from Windows Web Browser + +URsim Docker can be run in WSL without Docker Desktop. Launching the container is the same as above. + +Accessing the VNC requires +1) forwarding ports from windows to WSl +AND +2) launch the container with port forwards from WSL (docker Host) to the container + +### 1) forwarding ports from windows to WSl + +See here: https://learn.microsoft.com/en-us/windows/wsl/networking#accessing-a-wsl-2-distribution-from-your-local-area-network-lan + +Per the Microsoft link above, run the following to add a portproxy port forward from windows to wsl. For example: the following command forwards port 6080 for the web-VNC client: +```bash +netsh interface portproxy add v4tov4 listenport=6080 listenaddress=0.0.0.0 connectport=6080 connectaddress=(wsl hostname -I) +``` +you can view the current portproxy rules and the one you just created with: +```bash +netsh interface portproxy show all +``` + +__NOTE__: You may need to add a firewall rule to windows firewall allowing connections to this port as well + +### 2) Launch the container with port forwards: +```bash +docker run --rm -it -p 5900:5900 -p 6080:6080 universalrobots/ursim_e-series +``` +Identify WSL Distro IP address. From your WSL terminal, run `ifconfig`, and find your WSL IP (typically `eth0`) +Access the web-vnc client in a browser at http://[__*WSL Distro IP*__]:6080 From 11590059cf1234e4b21273937213bd54a3a6d36c Mon Sep 17 00:00:00 2001 From: robot-ranger Date: Sat, 13 Jan 2024 13:02:43 -0800 Subject: [PATCH 2/2] note about multiple ports --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b2e5663..37bcbda 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,8 @@ Per the Microsoft link above, run the following to add a portproxy port forward ```bash netsh interface portproxy add v4tov4 listenport=6080 listenaddress=0.0.0.0 connectport=6080 connectaddress=(wsl hostname -I) ``` +Replace 6080 with 5900 if using a VNC client instead of the No-VNC web client. Or repeat the above for each port. + you can view the current portproxy rules and the one you just created with: ```bash netsh interface portproxy show all