10

I have a Windows XP as guest OS on VirtualBox running on Ubuntu. Inside that Guest Windows XP, I have an instance of Apache running. Now I want to connect to that Apache from the host (Ubuntu). Is it possible? How can I do that?

Phuong Nguyen
  • 703
  • 1
  • 12
  • 27

2 Answers2

7

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.

Nerdfest
  • 628
  • 5
  • 7
  • Note that you may also connect to this machine from any other as well. If you don't want that functionality, you can use firewalling. – Nerdfest Feb 07 '10 at 16:39
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

Dominik
  • 2,218
  • 14
  • 9