My desktop background is so festive!
Continuing on with my learning about virtual machines and containers, I picked up a book on Vagrant and am learning more about how to easily spin up a virtual machine on my laptop.
Previously, I had set up a virtual machine on my work laptop using VMware but as a beginner, it was a lot of pulling teeth. Also it is currently not working and I have absolutely no idea why. Vagrant is supposed to be easy to set up, but as a non-dev I tend to take the word “easy” with a grain of salt and a great big eye-roll (I also do the same with “simple”, “quick” and “beginner-friendly”).
PSA: Everything is quick and easy when you have 10+ years experience.
Vagrant is an open-source tool for building development environments in a virtual machine. It lets you choose an operating system (as opposed to containers which use the same kernel as the host system, so you can’t run a Windows container on a Linux machine), lets you modify the RAM and CPU and lets you share folders across machines.
Vagrant use to be distributed as a Ruby gem, but is now an installation package that you can download. You’ll also need to download a provider, such as VirtualBox, VMware or use Amazon’s EC2. I’m going to use VirtualBox because it’s free and most of the examples I’ve found either online or in the book I bought assume that I’m using VB.
Tip: When in doubt, always use the software/tool with the best documentation and most examples/tutorials available. You can always deviate from the norm and customize your tools later once you fully understand them. Don’t listen to anyone who tells you to use something new and shiny if it has zero documentation and the only online help you can find is a half a dozen questions on Stack Overflow.
I followed the instructions, downloaded VirtualBox and Vagrant, initialized a 32-bit Ubuntu VM using my Terminal and the documentation, and used “vagrant ssh“ to drop into the SSH console in my newly created VM.
I played around in that sandbox for a bit, grabbed the sample VM for Go.cd (the continuous delivery software that I support), created a new directory on my host machine, and did another “vagrant up“. After it finished downloading the box, I went to http://localhost:8153/go/pipelines and played around with Go.cd without worrying or caring about breaking stuff.
So even though I’m still a beginner, I found this tool to be surprisingly easy to use. I like that I can spin up a new machine whenever I need one, halt it or tear it down as I please, and I like that any folders that I create on my VM will be created on my host machine too so that I can keep track of them.
And because every time I scratch the surface of one thing, I discover 10 more things that I don’t know, here are some additional things to learn.
More things that I need to study:
- get more familiar with shell scripts
Thanks for reading, except for Vanessa because I know she always skips over my technical blog posts. Don’t worry girl, I’ve got a good one scheduled for Saturday that isn’t techy at all! :)