How can I run LAMP (Linux, Apache, MySQL, PHP) in a virtual machine (Ubuntu in virtual box) and make it so the web server is accessible locally (and ONLY locally) on the host OS via an ip address?
Would the host OS’s firewall override the VM’s firewall?
The IP address would probably be manually set, and I am no network guru (or even noob) but if you use a different subnet than the host I don’t know if it would be accessible or not.
You can use ‘host only’ adapter in the virtual box network settings.
http://img547.imageshack.us/img547/7633/hostonly.png](http://img547.imageshack.us/i/hostonly.png/)
Uploaded with ImageShack.us
On my machine it’s called vboxnet0:
~> /sbin/ifconfig -a
vboxnet0 Link encap:Ethernet HWaddr 0A:00:27:00:00:00
inet addr:192.168.56.1 Bcast:192.168.56.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:63 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:12361 (12.0 Kb)
Then it’s as simple as ensuring the guests firewall is open (port 80 i’m guessing) and access the guests IP from the host. This IP will be within the vboxnet0 subnet.
Thanks that worked!