This is a good idea because you could install almost anything on the virtual machine.
How to use it ?
First, setup the Operating system.
You could download a Virtual Appliance which is an image with an installed OS.
VirtualBox Virtual Appliances
Second, After you setup the OS you'll have to setup webserver, database etc.
Third, give an IP
then you access it as: http://192.168.0.100
if you have given that IP.
You could setup the viritual machine will be accessible from the LAN you'll have to check the network settings otherwise only the host machine will see it.