Ubuntu server (natty) is running on my Ubuntu (natty) by VirtualBox OSE, How to only I can access my server NOT every internal IP in my LAN and both can access the internet. now I sharing the Internet by bridge, It's good for access my virtual server. but everyone on my LAN can see too.
Another possibility is to use NAT networking and forward port 80 to your VM.
That way your server should be able to access everything (internet and LAN), your server will not be visible to your lan. Connections to the port 80 of your real computer will actually connect to port 80 in your virtualised server.
You can check your web server from your host (real computer) pointing a browser to localhost.
You configuration should look like this:
Note that you don't need to fill the IP field.
So, lets see if I understand your requirements:
Probably the easiest way to do this is using the bridging option. Then on your server, set up UFW (Uncomplicated FireWall) to Drop (the GUI for UFW, called GUFW, calls this DENY) traffic from your LAN. Of course, make an exception for the host. This should block traffic to your VM from your LAN except pings. If you want to block pings, you may have to tweak some of UFW built in rules. (I could add more about this if you need it).
The other option is to set up a shared interface between the host and VM. Then on the host make an /etc/network/interfaces with a static address. You would do the same on the VM (except with a different address). Then you would login to your router for your LAN and add a route to the address block you used for your VM/Host shared interface using the host computer as the gateway. (You will probably want to have the host connect to the router with a static address so that you don't have to change the route all the time). You'll want to edit