Howdy! Recently I have faced the inconvenience that I have to develop parts of application beeing friendly-configurable on Linux and at the same time installing them on Windows is a nightmare.
What to do when do you develop on Windows, but you need the production environment based on Linux and you don’t want to buy server? Install Linux locally on Windows and run server on VirtualBox installed on Windows. The same story concerns the situation, when the production server have a lot of shit dependencies you don’t want to have on your developing environment, even it is Linux.
So how to connect VirtualBox Linux server from Windows?
- Download the VirtualBox and Linux distribution you want to install (.iso format will be convinience). I
have coised Ubuntu, because of rapid installation.
- Create a new virtual machine for your Linux. More info.
- Mount your .iso and install Linux on VirtualBox. Installation is really user-friendly.
- Now go to the setting of your virtual machine -> network adapters settings -> and change your network adapter to NAT. More info.
- Check if everything is ok, in particular that network adaper on virtual machine obtained the IP address. Just type:
/sbin/ifconfig
or:
/sbin/ifconfig | grep addr
Note the assigned IP address.
- Try to ping your virtual machine from host operating system, where VirtualBox is running:
ping virtaul_machine_ip_address
- If everything is ok, your machines works mutualy. Now, install Open SSH server on your linux. For ubuntu:
sudo apt-get install openssh-server
- Now, you can open the connection on your host device. On windows, you can use Putty for connect to the virtual machine’s command line.
My Ubuntu’s command line from Windows 8. Localy.
Happy coddin’!
„Bridged” mode also works. The virtual machine is then visible in the same network. It is not behind the NAT. And interwebs still work.
Bridge works pretty well, thats how I use it :). Also, you can connect via ssh, but if your virtual machine runs on the computer you are currently working on, I find it pretty okay just to use virtual box window.
Try vagrant. Install with one command. Everything works on demand.