Strange development setup
Friday, 30th January, 2009 // 9:18 a.m.It's a fact that linux rocks at any kind of development. And I firmly believe it.
Well recently I am getting my feet wet with a bit of PHP. Now I am kind of sick to change my development environment to suit PHP. I simply downloaded the MAMP which gives the environment to run PHP. But deep down somewhere I wanted to configure Apache with php and give it a try. I used to have a slice a while back but I just cancelled by slicehost. Paying 20$ for a sandbox is not worth. So I decided to replicate a slice like server in my home.
I have an old desktop which runs XP. I dont want to simply install linux and use it because that system is used by quite a few people at my place. So my main challenge was to run linux on that machine but the user should n't be able to notice the linux at all. Yes! I took it as a challenge.
To accomplish this I first installed VMware server 1.0.8 which runs guest OS in a VM(Virtual Machine). This is the only way we can run two OS simultaneously. After installing the Vmware server console setup a new virtual machine. Give it a name, allot some space (around 10GB) to the VM. After the VM has been created download a copy of linux you would like to run as VM. For me its ubuntu.
I just need a pure minimal linux. So I went with ubuntu JEOS.
I would like to thank Zack Voase for tweeting about ubuntu JEOS, otherwise I would have never knew it. JEOS is Just Enough Operating System. Its almost same as the linux distro which slicehost installs when we create a new slice. We need to install a openssh-server though.
sudo apt-get install openssh-server
Openssh-server sets up a ssh on your windows. But the drawback is that its a windows machine and none of your unix command work there. My recommendation is install install cygwin. Cygwin gives you a unix like environment on a windows box but still kind of crappy to me. So I installed cygwin with openssh-server enabled. Follow this tutorial to setup openssh on cygwin.
Alright now we now have ssh for windows up. On your laptop / other machine go ahead and login via SSH.
ssh username@192.168.XXX.XXX
Alright now back to linux part. I hope you are well aware of installing linux via VMware server. Its just as create a Virtual machine with 10 or more GB and edit the VM's CD/DVD to the .iso file of the linux distro. Then its pretty straight forward as follow the linux instructions.
After the linux is up. just go ahead and install openssh-server if it ubuntu-jeos. Most of the other OS come built in. Now comes the most important part booting linux via windows SSH. Beleive it or not I spent a lot of time experimenting and tried writing a couple of script to invoke linux VM. But finally with the help of #vmware on IRC channel I found the trick.
The whole cygwin SSH setup can invoke applications via perl. It's as simple as invoke the executable file with perl. So to boot my linux VM I login into my windows VM SSH and ...
perl C:/Program\ Files/VMware/Vmware\ Server/vmware-cmd "C:\Virtual Machines\Ubuntu\Ubuntu.vmx" start
vmware-cmd is the command is installed via VMware-server which can handle these start & stop commands. Similarly once you are done with your work on your linux VM you can safely shut it down by replacing the 'start' with 'stop' command. It a good thing to create alias for these commands so that its handy to use them.
alias runubuntu='perl C:/Program\ Files/VMware/Vmware\ Server/vmware-cmd "C:\Virtual Machines\Ubuntu\Ubuntu.vmx" start' alias stopubuntu='perl C:/Program\ Files/VMware/Vmware\ Server/vmware-cmd "C:\Virtual Machines\Ubuntu\Ubuntu.vmx" stop' alias statusubuntu='perl C:/Program\ Files/VMware/Vmware\ Server/vmware-cmd "C:\Virtual Machines\Ubuntu\Ubuntu.vmx" getstate'
So that's it this is my strange development setup I use at my place. Actually you can run the linux VM on system startup and shutdown on system shutdown. Since I have a very slow computer I prefer not to strain the system. Any way just wanted to share my setup.
Comment Form
Looks like there aren't any comments yet..