erictheavg
erictheavg

Reputation: 350

Cygwin vs Linux Virtual Machine for Development?

< skippable part >

I work in IT (mostly desktop support and network administration) in a Windows environment, and I occasionally program.

A couple weeks ago, I decided I couldn't be as effective as I want to be without a Bash environment for my command prompt needs. This is especially true when I am using Ruby and git. I used Msysgit for a while, but I just didn't like how it wasn't extensible like Linux. So, I installed Cygwin and played around with that for a couple weeks.

As great as Cygwin is, it seems like it is meant to be a suped up command prompt, and its compatibility with Linux is just a pleasant side effect. This especially became evident when I tried to upgrade Ruby to 1.9.3 (it worked, but it wasn't straightforward), install rvm (never worked), and install RMagick (may or may not work, but looks like a headache).

So, now I'm considering running Linux in a virtual machine. But I'm worried that might be another can of worms and I'll have wasted hours before I find that out. I like that Cygwin runs in Windows and I get to use my IDE, user folder, and more with it. But I don't like that support for it is not as thorough as for a major distro.

< /skippable part >

  1. Does anyone here have insight on using Cygwin vs running a Linux virtual machine?
  2. Any advice on setting up a Linux development environment in a virtual machine within Windows?

Upvotes: 18

Views: 30545

Answers (8)

hornetbzz
hornetbzz

Reputation: 9357

I'm using a Linux VM within a Windows seven environment as this VM is as representative as possible of the final production environment. The whole setup is binded to the Eclipse IDE under ms-Windows seven. So this is really great for local full testing, before committing or tagging the tested version to the production servers.

As you mentioned as well, this takes some time to get properly setup and fully configured. So if your need is only for little tricks or tasks, you may keep using cygwin. For example, I faced significant issues to configure perl and compile mysql within cygwin. So it's ok for basic usages, but not to fully take advantage of a full linux environment.

Your choice strongly depends on the final server setup purpose. A VM will do it whatever your need is. The setup cost for it is higher, so this time investment must be used often to get returned.

Upvotes: 0

SwimBikeRun
SwimBikeRun

Reputation: 4460

SSH into a linux box. This is what everyone does. Why isn't this the answer?

Upvotes: 4

Bassem Reda Zohdy
Bassem Reda Zohdy

Reputation: 12942

What I think now is getting the pros of 2 options is using Docker , it is giving you cygwin simplicity and VM functionality with better performance.

Upvotes: 2

Linuxios
Linuxios

Reputation: 35803

There is something I have heard of called Cooperative Linux. It runs Linux alongside with Windows kernel so you can use them at the same time. I've never used it, but here: http://www.colinux.org/

Upvotes: 2

Quamis
Quamis

Reputation: 11087

1: cygwin is good for quick hacks, and for being able to acces host-os resources(you can run IE for example in a bash script). For something tightly integrated and some "real" word, go to a vm. It will emulate everything and separate development from the real machine, and this may be a good thing in some cases... as a plus it simulates a real server:)

2: in virtualbox at least, you have shared folders, and you can share a local folder, and see it in the vm as a local folder(local or as a windows share..it actually depends). Then you can use that "entry point" to symlink stuff into the vm, and do the things you need with the real files being located in the real(host) machine

Upvotes: 8

hovanessyan
hovanessyan

Reputation: 31463

I have faced common issues before, and the best solution according to my experience is just 2 workstations :).

Apart from that having Linux running in a virtual environment is way better. First of all, you will have full Linux capabilities (except 3d acceleration, but you probably don't need that). You will have the capability of creating snapshots and revert back to them when things go wrong! You can start multiple environment using templates, which is very convenient.

The only downfall I can think of is performance issues of the host machine. If it's a normal workstation/PC, an IDE + one virtual machine + a 100+tabs browser just makes it slow.

Upvotes: 15

ncremins
ncremins

Reputation: 9200

Linux in a virtual machine will give you the experience you want more than cygwin or any mock shell as I like to call them.

Running VM's though require a lot of ram depending on whether you want a desktop version of linux or just a command line version.

Myself in work I have a pc with 8gb of ram and I run ubuntu 64bit as main OS, two ubuntu servers (these are for dev environments two different projects) and a windows 7 VM and a win XP VM.

I can run the two ubuntu servers and one other VM at the same time, key here is more ram if you want to be able to do VM's.

Upvotes: 1

user358380
user358380

Reputation:

If you're going to be working with Ruby then get an Ubuntu virtual machine up and running :) I've not tried Ruby, etc on Windows but I have heard that it is a pain to setup and configure. I use a Mac for all my Rails development so I cannot comment on the Windows side for that.

As for virtual machine creation, I prefer VMware Workstation, however there are free alternatives such as Virtualbox and VMware Server.

Upvotes: 0

Related Questions