Skip to content

Instantly share code, notes, and snippets.

@marcioeric
Created July 29, 2024 17:41
Show Gist options
  • Save marcioeric/2ed121654483a54744d6a67b32867db0 to your computer and use it in GitHub Desktop.
Save marcioeric/2ed121654483a54744d6a67b32867db0 to your computer and use it in GitHub Desktop.
Steps to connect Rabbit MQ Server from another PC:
Reference: https://github.com/containers/podman/issues/19832
1) Run windows powershell as admin
2) run this command: wsl --list --verbose
You will get something like this, but with only podman-machine-default in your case
Note: If State is stopped, it please run Podman from podman desktop
PS C:\Windows\system32> wsl --list --verbose
NAME STATE VERSION
* podman-machine-default Running 2
docker-desktop Stopped 2
docker-desktop-data Stopped 2
3) Now we need to enter podman-machine-default VM to get IP, so run
wsl -d podman-machine-default
You will get something like this
PS C:\Windows\system32> wsl -d podman-machine-default
You will be automatically entered into a nested process namespace where
systemd is running. If you need to access the parent namespace, hit ctrl-d
or type exit. This also means to log out you need to exit twice.
[user@3457-J93BHW3 ~]$
4) Copy paste this ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 and click enter
[user@3457-J93BHW3 ~]$ ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1
172.24.89.91
5) Now you have got IP address of the machine, copy it. Type exit & press enter and do the same one more time till you get
PS C:\Windows\system32> prompt back
You should log something like this
[user@3457-J93BHW3 ~]$ ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1
172.24.89.91
[user@3457-J93BHW3 ~]$ exit
logout
[user@3457-J93BHW3 system32]$ exit
logout
PS C:\Windows\system32>
6) Now use this command and replace IP address you got from above, in my case 172.24.89.91
netsh interface portproxy add v4tov4 listenport=15672 listenaddress=0.0.0.0 connectport=15672 connectaddress=<IP Address>
7) Then run Rabbit MQ image from command prompt as
podman run --rm -it -e RABBITMQ_DEFAULT_USER=testuser -e RABBITMQ_DEFAULT_PASS=testuser123 -p 15672:15672 -p 5672:5672 rabbitmq:3-management
8) We should be able to access Rabbit MQ management portal from machine 2 like http://<IP address of machine 1>:15672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment