Saturday, May 15, 2010

Virtual development environment: Part II


  My previous post describes some alternatives of using virtualization. In this post I'll dig deeper into details of using virtual machines.

  Virtualization in software development process
   Windows host runs several virtual guests with Ubuntu. Virtual guests run as services. One of guests , let say Project 1, is configured to start 1-2 minutes later after Window start. So I have it always running and available at any time. Other guest machines which I don't use are turned off to save memory but ready to be started at any time. Guest machines have a static IP address; run SSH server, Samba server, MySQL server and Apache Tomcat with my web application. Have a look at the schema below for more clear picture of my configuration.
Virtual Development Environment
My web application for Project 1 is always available for HTTP access, as well as I can connect to it with remote debugger at any time. All files of the web application are shared to windows host with samba server.

 Virtual Network
  VMWare provides several ways to setup virtual network. I've choose one based on NAT. It hides your virtual machines from outside world behind the virtual NAT. However you can setup port forwarding to open your web application for outer world.
   I won't tell in this article about network setup process and static IP address configuration on the guest machine. There are a lot of resources on these topics. And if you are not familiar with Linux yet it would be cruel from my side to steal a wonderful trip over Linux tutorials, blogs, and first steps in command line by replacing exciting discoveries with a several predefined instructions ;).

  SSH, Putty and Samba
   Setting up an SSH Server on your guest is like opening a door to your development environment and to the Linux world.
   There are two nice tools for Windows OS: Putty and WinSCP, They allow you to connect to the guest by SSH protocol. With Putty you can run any command on guest, and with WinSCP you can navigate guest's machine file system, and transfer files.
  While WinSCP gives you a lot of power working on Linux, it has some issues. One example is that WinSCP always copy remote file to local temp folder before opening it. As a result it's impossible to use TortoiseSVN over WinSCP. If you feel inconveniences using WinSCP then try Samba.
  Samba opens Linux file system for Windows networks. When you'll additionally map this Linux shared folder as network drive you would have a seamless access to you virtual machine and will be able to use your favorite Windows tools for work with Linux files.

   Issues or "A cat in gloves catches no mice"
  One of the most interest issues I had with VMWare was so called "95% issue". A problem starting a virtual machine because it's hangs at 95 %. When I have read all 10 pages of VMware support forum, seeing lots of requests for help with a common answer from VMWare: "Your platform is not supported" My first intention was to stop using VMWare and switch to Sun's VirtualBox. Many people said that the issue was resolved with disk drivers. I was experimenting with them but with no luck. And only when I start recollecting all changes I made to computer recently, I come to solution. It was a WideCap tool conflicting with VMWare Server. After WideCap's uninstallation "95% issue" was resolved.
  Also I had an issue in using TortoiseSVN on drives shared with Samba, however it's resolving by security settings in Samba configuration.

0 comments:

Post a Comment