DEV Community

sdcaulley
sdcaulley

Posted on

I Develop in Virtual Machines

I am a JavaScript developer, and I use Virtual Machines for all of my development.

My set up:

  • Hardware:
    • Lenovo ThinkPad T460s with:
    • 20 GB of RAM
    • 500 GB SSD hard disk
  • OS:
    • Debian 10
  • Virtualization Software:
    • native kvm/qeum

I set up a base VM and a separate VM for each of my projects.

The base VM has:

I will then clone the Base VM, rename it, and set it up for the desired project. I also take periodic snapshots for easy recovery.

My reasons:

  • Less risk to my laptop.

I have been known to do bad (unintentional) things with my code. Like that day that I somehow set up a Node.js server that spawned itself and used up all my ports in about 10 minutes. Having my dev environment separate from my actual laptop meant that I still had a working laptop, and I could restore the VM from its snapshot.

  • Less bloat on my laptop.

Let's face it, I really don't want node, npm, mysql, mongodb, git, ...ect on my day to day laptop. They take up space and processing power (even when idling in the background). Having them on separate VM means they are running only when I need them. And when I no longer need them, I can delete the VM.

  • Specific configurations for specific projects

Each project in its own VM means I can fine tune the environment without disrupting any other project. This makes it easier to track down bugs, and prepare the work for deployment.

  • Easy transfer.

If and when I need to move to new hardware, I can easily take my dev environment with me, instead of spending hours setting it back up again. I know for some that is part of the excitement of new hardware, but not for me.

There you have it - a brief stroll through my development set up.

Top comments (8)

Collapse
 
narasimha1997 profile image
Narasimha Prasanna HN

Hey, you can use Docker for this purpose. Containers are lightweight and are easier to set-up/destroy. Even docker is not required, you can simply use npm init command to setup a local node project which by default will not interfere with other projects.

Collapse
 
sdcaulley profile image
sdcaulley

I have thought about using Docker, but I am not at a point to go that route yet.

Collapse
 
narasimha1997 profile image
Narasimha Prasanna HN

Cool. Since you've played with VMs, docker would be like a cake for you !

Collapse
 
djnitehawk profile image
Dĵ ΝιΓΞΗΛψΚ

docker is the way to go if your main OS is Linux based. windows docker performance isn't there yet even with WSL2 imho. unless you're willing to move all your source code into the WSL2 virtual machine. which is not a path many are willing to take.

Collapse
 
sdcaulley profile image
sdcaulley

So, I have heard about Docker. However, I am not at a point where I want to learn how to use it this way.

Collapse
 
luscala profile image
Luca Scala

Most of us used that approach, until Docker joined our lives. Take a look at that, it can improve your dev experience!

Collapse
 
nikaizuddin profile image
Nik Mohamad Aizuddin

If you like using VMs, you probably want to try Vagrant & SaltStack.

Collapse
 
wannabehexagon profile image
ItsThatHexagonGuy

Have you by any chance heard about Docker?