Tuesday 28 September 2010

Setting up server for virtual IDE

Hi,

Finally after several times of experimenting of setting up LAMP development server on Windows7, I decide to stay on VirtualBox.
You can get it on Virtualbox.org website, download installer and install it to on your machine, thats easy.
I will not go into deeper details how to install Linux server on VirtualBox, thats easy, if you need that too post it here.
The issue what I would like to discuss to day is network settings, so. We have machine - server but hot to connect to it?
If you google for that possible
recommendations are:

VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222

VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestftp/Protocol" TCP
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestftp/GuestPort" 21
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestftp/HostPort" 2221

VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8880

VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqltcp/Protocol" TCP
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqltcp/GuestPort" 3306
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqltcp/HostPort" 3336

VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqludp/Protocol" UDP
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqludp/GuestPort" 3306
VBoxManage setextradata "Ubuntu910server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestmysqludp/HostPort" 3336

Which actually are not giving you anything you can get into great mess with how to find your adaptor, then number - Adatoptor 1; 2 or....?
As to http://www.virtualbox.org/manual/ch06.html#natforward documentation available here we are able to mange this in a lot of easier way(ohh yes your network adapter should be on NAT settings);

VboxManage modifyvm "Name of machine" --natpf<1-N> "guest,,,,,,"

This is teory, but in practice it looks;

VboxManage modifyvm "Name of machine" --natpf1 "guesthttp,,tcp,,8880,,80"

This example tells that all requests to Hosts port 8880 should be forwarded to por 80 on guest which is of course Apaches default port. Having done this try to browse on http://localhost:8880 and if you have older Apache, you should see good old : It Works!
Same as you did with http requests your are able to set up all port forwarding you need, you can use same ports from  my old code example.
When this is ready you have all your development server working - faster easier, lighter as Linux is.

Happy developing.

No comments:

Post a Comment