husarnet/husarnet

Husarnet Remote Vscode DevContainer WSL2

Fibo27 opened this issue · 4 comments

Fibo27 commented

Hi

I have the following configuration:

  1. Robot: Ubuntu 20.04, ROS2 Foxy on docker, connected to Home_Network with IP Add 192.168.1.xxx
  2. PC: Windows 11 laptop. I use HyperV to create a virtual machine and am running Ubuntu 20.04 with ROS2 Foxy and VSCode on it which is connected to Home_Network with IP Add 192.168.1.yyy. I use the Settings of HyperV to create a network adapter which is linked to my Wifi adapter of the PC
  3. I use VSCode with Remote Development on the virtual machine on my PC to launch a Devcontainer on the Robot using SSH tunnel - this setup is working fine.

Instead of using HyperV, I plan to use WSL2 with Ubuntu plus ROS2 Humble on my PC as i want to use NVDIA GPU on my PC for advanced image processing sent by the Robot camera. However, as you know WSL2 uses a WSL2 adapter whose IP address is different than the LAN Wifi address (it is usually 172.xxx.xxx.xxx) and so I am not able to access the messages which are being generated by the Robot. I would like to use Husarnet VPN (similar setup when you are connecting via the Internet) but would still want to use VScode and open a Devcontainer on the Robot. Is there a way that i can achieve this? I have gone through your various tutorials but i want to know if the above setup can be activated. Thanks

ympek commented

Setup like this should work with Husarnet out of the box. Just install Husarnet everywhere (i.e. on the robot, inside WSL, and on Windows host too), and join them to the same group in the Dashboard. Then just use Husarnet ipv6 addresses and/or hostnames in all places where you would normally put IPv4 addresses (like for example setting up remote development in VSCode)
Let us know if you encounter any issues.

Fibo27 commented

Can you confirm that the setup will work with WSL2 as well. I know that it will work with WSL1

ympek commented

Yes. I don't see any impediments.

Fibo27 commented

Hi should be using one of the configurations from this tutorial https://husarnet.com/blog/ros2-docker/ ?