I’m always working on a Mac machine, but sometimes I need to debug an issue that only affects windows machines and more specifically IE. For that, I usually use VirtualBox with a free VM from Microsoft for debugging.
I never remember what to do to access a server running on my Mac from my Windows VM. So I’m writing this, for me. And I guess for you too!
- Shutdown your VM
settingsfor the VM and select
- make Sure the
Attached todropdown is set to
- Add a new rule. In my case, I want to forward port
4502on my guest to port
4502on my host. leave the IP fields empty
Finding Your Host Local IP
Now you need to find the host (Mac) local IP that is assigned to you by your router, this typically starts with
you can find this in MacOs by following this SO answer point #3
basically run the one of the following commands to get your local IP:
ipconfig getifaddr en0if connected via a wireless connection.
ipconfig getifaddr en1if connected via ethernet.
ipconfig getifaddr en3if connected via a Thunderbolt-to-ethernet adaptor.
Accessing Server Running on Your Host From Your Guest
now that you have the IP, you can use it to access the forwarded port from your guest VM.
In my case, the IP of the host turned out to be
192.168.10.20 so, in my windows VM I can access the URL: