Wednesday, May 11, 2016

Spinning up a Virtual Machine for Learning New Technologies

As a new developer, I try my best to learn as much as I can in the shortest time period.  One of the best advice I've gotten was from a couple of co-workers when I was asking for help on a problem.  I was enamored with the complexities of git and couldn't learn how to use it effectively fast enough.  So after a bit of reading on my own, I'd come to these developers and ask semi-specific questions about what I was trying to accomplish.  After about a week these 2 individuals said "When we try to learn something new, we just start playing around with the technology.  When you want to know if git rebase will delete your history, create a repo with some folders and files in it, and perform a rebase after a couple of commits."

This advice sparked a flame in the way looked at learning.  With this new advice, I started to create sandboxes everywhere, and for everything.  Anything from git, mongoDB, mysql, c#, python, powershell, and everything in between, I started just doing it and seeing what happened.  That way, when I was working on something at work, I already knew the consequences of the not so familiar method/command.  

What is a great place to play around and not have to worry about destroying your computer?  A Virtual Machine.  There are a number of Hypervisors out there that can be used to create one.  From Hyper-V, VirtualBox, and my favorite VMWare.  This post will focus on creating a VM on VMWare. There are some pre-requisites that you need is to download the following:
  1. VMWare Workstation download.
  2. Ubuntu 16.04 LTS download.
There are many Operating Systems available, over 100 linux distributions that I can think of, but you could always use Windows if you have a license and a current installation ISO or disks.  One of the benefits of the 2 listed downloads is that they're free.  So now that those are downloaded, we can get started.  

The first thing you'll want to do is double click the file downloaded from the VMWare link and follow the on screen instructions.  Once that is done you should open up VMWare and you'll see the Home screen of the program.  From there you'll follow the following steps:
  • Click on "Create a New Virtual Machine"
  • Select the "Installer disc image file (iso)" radio button.
  • Click Browse, and find the downloaded ISO of Ubuntu that was downloaded earlier.  Then Select Next.  This is most likely in your downloads folder.
  • On the next screen fill in the fields to Personalize Linux and Select Next.  Remember this information, as it will be used to login to the Operating System once installed.
  • Now give the VM an allotted amount of space to take up on your hard drive and click Next.  I recommend 20gb, but you could go greater or less based on your use case.
  • On the next screen you can customize some more of the features such as memory.  I usually set my Memory to 2gb's but you can get away with as little as 512mb's.  Keep in mind that the VM is borrowing resources from your host machine, so you don't want to just crank everything up to the max.  Once everything is to your liking click Finish.
  • Now after about 10 minutes and a few questions, you should see the Ubuntu Log In screen.  Use the password created earlier to login and you are done.
Congratulations!  You've just created a Linux based playground to perform all of your coding experiments without having to worry about destroying your host machine.  And one of the best things is that if you really hose up the VM then you can just delete it and start over again with a clean slate by just following these steps again.  Note that you can have multiple VM's created at a time pending that you have enough hard drive space.  

If you are having problems with the Internet inside the VM, you may have to play around with the Network settings of the virtual machine by changing them in the VMWare application.  I hope this helps someone learn new technology as that is what I love to do in my spare time.

-Kwiknick

No comments:

Post a Comment