quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.89k stars 478 forks source link

I need a bit of help with web server passthrough #1377

Closed BrancuAlexandru closed 4 months ago

BrancuAlexandru commented 4 months ago

So, I use quickemu for web development. If I start a VM on my machine and also start a web server at localhost:4000, how can I access that inside the VM? I imagine I have to use the actual IP, so 127.0.0.1, but that doesn't work because it's the VM's localhost. So... what do I do here?

philclifford commented 4 months ago

you need to talk to the host's IP on the same network as the VM - typically ".2" so if you do hostname -I on the VM and get 10.0.2.15 or similar your host will be 10.0.2.2 (if you ssh into your vm and w or who -u you'll see where you came from ). You may need to allow access in your firewall rules. You may also need to tweak your webserver to run on all IPs on the host or at least include the 10.0.2.2 address.