Testing environment locally -> Sharing Apache-MySQL-PHP

Discussions related to using VirtualBox on Mac OS X hosts.
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Hi guys,

I've got the following set up:
VB 3.1.2 - MAC OS X 10.6.2 - WINDOWS XP SP3

Everything is working fine, I can acces files & internet of my Mac through a Virtual Machine running XP.

The only problem I have is the following:
I'm currently developing dynamic websites locally that I would like to test in all verions of Internet Explorer in a virtual XP.
I've read many blogs and forums but still couldn't get this to work. I understand that XP should access my servers (Apache/MySQL + PHP) through my Mac's IP adress.
Does anyone know how I can achieve that?

Find below some screenshots of my configurations:

ifconfig command on my mac:
Image

Hosts file in my virtual XP
Image


Help would be greatly appreciated.
Thanks,
Matt
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by Perryg »

We would need to know what the ipconfig /all has to say on the Windows guest. Also how it is connected (NAT, Bridged, Host-Only...)
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Thanks for your interest Perryg.

It is connected by NAT (PCnet-FAST III)

ipconfig /all on the Windows guest:
Image
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by Perryg »

Alright, if you want to continue to use NAT you will need to do some port forwarding. If you want to make your life easier you can switch to Bridged mode if there is a router in the network, or use Host-Only and a second adapter set to NAT for the guest to get to the Internet if you don't have a router.

See section 6.3.1. Configuring port forwarding with NAT of the VBox users Guide for how to do NAT port forwarding if you want to continue to go this route.
See section 6.6. Host-only networking for a description on Host-Only
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Thanks Perryg. I'll try that.
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Now I have the first adapter set to Host-Only and a second one set to NAT.
...But I still do not understand how I can visualize my websites in Internet Explorer in the virtual XP?
what URL do I have to put in IE ?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by Perryg »

Run Ifconfig -a or ipconfig /all Linux/Windows
You should have (3) addresses 127.0.0.1=lo 10.0.x.0=NAT one other (192.168.56.X) for the host-only. (these addresses may vary some)
The host-only is how you connect. If you want to use a name rather then the ip address then put the name and address in the hosts file of the xp PC.
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

When I put the IP in Internet explorer it considers it as a search in Bing...
I am totally lost

Image
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by Perryg »

Have you setup Apache to listen on all ports and address? can you ping 192.168.56.100?
Also do you have a firewall going and could it be capturing the request?
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Sorry Perryg but I have very few knowledge on servers and network administration.

Have you setup Apache to listen on all ports and address?
How can I achieve that?

can you ping 192.168.56.100?
No, it says "time elapsed for that request"
Image

Also do you have a firewall going and could it be capturing the request?
The firewall is desactivated on my Mac
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

"Time exhausted" , not "time elapsed"
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Doesn't Apache, by default, listen to all addresses on the machine?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by Perryg »

Yes Apache by default is set that way, but I have no way of knowing from here what has or has not been changed.
So for now disable the NAT adapter and deal with the Host-Only adapter.
You must get it to where the two can communicate.

Run these in a host terminal and post the results
VBoxManage list dhcpservers
VBoxManage list bridgedifs

Also try to ping the guests ip address from the guest. See if it returns ok
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Sorry for late reply. I had screen problems with my imac 27" and couldn't use it for 2 weeks.

Find below a screenshot for the last request:

Image
matt neale
Posts: 21
Joined: 14. Jan 2010, 17:07
Primary OS: Mac OS X Leopard
VBox Version: OSE Debian
Guest OSses: XP SP3

Re: Testing environment locally -> Sharing Apache-MySQL-PHP

Post by matt neale »

Image
Post Reply