Connect to guest from host - Virtual Box [closed]

Solution 1:

Change the guests's network adapter settings to 'bridged' and it will get an IP address just like any other machine on your internal network. You can then communicate with it as if it were a physical machine.

Solution 2:

If your VirtualBox network is set to NAT, you are able to make the connection from your host by configuring the guest from the commandline using something along the lines of

VBoxManage setextradata <GUEST_NAME> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/HTTP/HostPort" 8080
VBoxManage setextradata <GUEST_NAME> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/HTTP/GuestPort" 80
VBoxManage setextradata <GUEST_NAME> "VBoxInternal/Devices/pcnet/0/LUN#0/Config/HTTP/Protocol" TCP

and then connecting in your browser to http://localhost:8080