Virtual Box is a flexible, currently free, Virtualization environment not unlike VMWare or Hyper-V . If you’re a user of Windows 2007 Ultimate, you may have used a virtual copy of Windows XP, hosted locally before, VirtualBox is a similar solution and a similar tool to work through and try out.
Many others can give you a short tutorial on how to install VirtualBox and then install linux on that small server, but my short blog is about the tools you can then install on your VirtualBox in order to make it into an effective developer helper environment.
To that end, the above link will get Ubuntu up and running, and Ubuntu has an excellent repo install utility in apt-get, but I prefer the simplicity of the Yellow Dog Updater Modified, or YUM present on Red Hat Enterprise Linux, CentOS, and my favorite, Fedora.
Installing Fedora on VirtualBox is as easy as using the above tutorial and replacing the install medium with the most recent version of Fedora. I typically give my resident operating systems a limited amount of resources to work with, not because I’m stingy, but because I like to run multiple Helpers at a time, so I can use some for Developer Testing and others for actual development and deployment. You can change the RAM settings later, and if you’re sharp with Linux, you don’t need the GUI interfaces of Gnome to be able to use it, instead you use command line.
We live in a Windowsy world; in plain speak, Windows operating systems tend to be where we find our major IDE’s, our more widely popular Office suite and more software than you can typically shake a stick at. I like to get as much RAM as I can on my Windows machine and then see what I can get away with in 1/2 a GB of RAM on my small Linux slice. To that end, once I’ve got a terminal up for my small Linux host, I add in everything I’d need for normal web developer work.
yum install tomcat5 httpd mysql-server php java
Say yes to the installs, and you’ll get default locations and setup for Tomcat, Apache Web server, MySQL, php and Open Java.
I’m an old perl, awk and SED guy though too, and I want to get the best text parsing I can get. I add in a compiler here as well.
yum install awk perl sed gcc
Now, I want to mount shared folders for doing my work. I typically make three folders in my Documents directory on my windows machine, and then mount them as specific directories on my Linux guest.
- Work – The Work folder is for text files I need to parse, including csv’s and other work that would be best handled by the superior command line tools of Linux. I can’t tell you how many different times I’ve needed to edit up several lists of thousands of lines of text that I then wanted to break up into pieces, turn into excel spread sheets, and load into a database. I mount a Work drive and make a soft link to it in my home directory for safe keeping.
- Deploy- My deploy directory has an apache and a tomcat or jetty folder within it, so I can not only drop deploy my work for quick test on my webserver, when I use the faster Java build times on my linux system, I can simply pull the wars, jars, ears, etc out of that folder for use in windows development, sending along through our Windowsy mail system or dropping onto Windows secured file shares that require a bit more than Samba can pull off to connect.
- Longterm- Is my last shared folder, mounted drive. It’s a location where I put and file away my daily work that should be able to migrate between the two instances. When work is finished it goes into a Longterm sub-folder that is named for the day I finished the work. Folders are often named with Two letters for the name of the company I’m doing the work for (AC for ACME) followed by the full date format as YYYYMMDD (ex. AC20100807). This gives me a simple sorting system in both Linux and Windows that lets me rapidly find my files.
An example work flow might be, I’m working on Flex in IdeaJ, my current working directory is called Project1 under the work folder. Inside is my Subversion handled repo of code. When I execute a build command from within IDeaJ, I have it use my build server on the small linux shell I’ve set up as my remote server. The final process of my maven build script, dumps the war file in the deploy directory, and Tomcat or Jetty’s hot deploy solution is serving up my webapp to my local webserver.
Another work flow might be an excel spread sheet comes in with 10 tabs worth of massive data for me to crunch up and get to the DB ASAP. Only problem is the file needs some massaging. I save the file as pipe delimited from Excel, and massage the file with AWK and SED until I have a series of load files split into 10,000 line inserts into the DB. I load them into my MySQL database from command line, then use the MySQL connector I downloaded from the website, to link the data elements of my excel spread sheet to my locally hosted MySQL database.
These are all specifics, but the key to this whole system is using the VirtualBox appliance and the installed Linux guest, as a way to get every advantage from working with linux and Windows simultaneously.