How to build a high-class developer environment for a non-Unix-based system.

How to build a high-class developer environment for a non-Unix-based system.

Why do you need a virtual development environment or virtual lab?

I have been using Windows for years. Based on my regular workflows and daily tasks, I never feel the need to switch to a different operating system. Since I can get everything done right in the GUI very easily and quickly. But when I made the decision to switch careers and be serious about going into IT. I ended up going to a Bootcamp for cybersecurity. Where I started learning about all the awesome stuff about infosec such as application and network security, event management, threat hunting, and more. Most of the time I needed to install one or more pieces of software in order to complete a project. In the same way, when I started my software development journey, even though there are a lot of great web-based text editors where you can run your code directly, their capabilities are restricted or limited. You need to have your own local development environment where you can write, run and test your codes easily. Having a local development environment is crucial for your personal growth. You need a safe place to learn new skills and try new software, and solutions and most importantly you can configure and customize based on your needs.

As a windows user, sometime when you are trying to set up a local development environment. You will quickly run into installation conflicts with very intimidating errors where you have no idea what to do as a newbie. Maybe they require additional configurations to make them work or they create configuration conflicts with windows based software already installed in the computer. Or maybe the software you want to use just does not run on windows. Don't get me wrong Windows is great but when you start being on the development side, you want to write, and test code and you want to be a little bit more in the command line. You will feel the need to switch to a UNIX-based operating system.

Well, how to solve this problem?

Luckily most of the tools you will need as a software developer are built to work well with Unix-based operating systems such as macOS or Linux. Well, you can go and purchase a new Mac or a new computer and install Linux natively. Honestly, it is not a bad investment because you will have to go this way at some point in your career. But I think the easiest way to go about that is to leverage the power of virtualization.

What is virtualization?

Virtualization is one of the core technologies behind cloud computing. Basically, virtualization is the use of computer software to create a layer of abstraction over computer hardware. It allows the use of physical computer hardware components such as processors, memory, storage, and more to create one or multiple virtual machines (VMs). Each virtual machine runs its own operating system and acts as if it was an independent computer even though they all share the same underlying computer hardware. Here is a good video to learn more about virtualization. You can create one or multiple virtual machines right inside your laptop and each one of them can run a different operating system. In order to create a virtual machine, you need a hypervisor.

What is a hypervisor?

A hypervisor is a computer software emulator that lets you create and run virtual machines. It provides partitioning, isolation, and abstraction to run virtual machines. You can learn more about hypervisor here. For our purpose, we are going to use VirtualBox which is a type - 2 hypervisor.

What is VirtualBox?

VirtualBox is a type-2 hypervisor, acquired by Oracle Corporation in 2010. It is cross-platform, free, and open-source. VirtualBox is easy to set up and use which makes it a good candidate for our case. You can download it here and install it. The installation process is very simple and straightforward.

Create your first virtual in VirtualBox

At this point, I am assuming that you have installed VirtualBox and it is up and running. Creating a virtual machine in VirtualBox is very simple. Just click on the machine tab and click new on the top left of the screen.

start.png

Fill in the information to create your VM and click Next. Pick a name for the VM and keep the default folder Type: Linux Version Unbuntu 64-bits

2.png

Depending on your machine you can allocate more memory if you want to.

3.png

For storage, you can keep the recommended or you can allocate more if you can. -Create a virtual hard disk

4.png

Keep the default and click next

5.png

Pick dynamically allocated

7.png

Keep the default for file location and size and click create to continue.

8.png

Now the VM is created but you are not done yet. There are a few more settings to do. Select the VM and go to settings to continue. In your case, you only have one VM

9.png

Go to System and uncheck all the other disks and only keep the hard disk selected and move it to the top.

10.png

Next, go to the Network tab and select the first adapter set it to the bridge adapter

11.png

Finally, the VM is ready. Now, it is time to download the ISO image (operating system) to install on the VM. Linux is a free and open-source operating system. Meaning people can download the source code and modify it to suit their needs. As a result, we end up having a lot of different Linux flavors or distributions. You can learn more about Linux flavor here. For our purpose, we are going to install Ubuntu Desktop. It is probably the most-known Linux distribution. It is based on Debian but it has its own software repository. Ubuntu is beginner-friendly and it also has a graphical user interface. You can download a copy of Ubuntu Desktop here and save it on your machine. You should download the latest LTS version.

After the download is done. Go back to VirtualBox in Settings, click on the Storage tab, navigate to where you stored the Ubuntu ISO image, and click ok to continue. 12.png

Now you are ready to boot your VM and install Ubuntu. The installation is simple and straightforward. Just follow the instructions on the screen. Don’t forget to set your username and password. You will need them to log in.

13.png

After the installation is completed, eject the disk and reboot the VM. Here you go. You have a fully working VM ready to set up your developer environment. Here is a video about how to install ubuntu

15.png

The first thing to do after the VM is up and running is to make sure it is updated and upgraded. Open a terminal and run these commands. Don’t forget to enter your password.

Sudo apt update

Sudo apt upgrade -y

Navigate your VM

Now your VM is running and ready to use. Even though the VM has a graphical user interface, the true power of Linux is in the command line. Yeah, I know! It may appear intimidating at first but believe me when you start using it. You will love it and it is not difficult to get started. Here is a list of the most used Linux command line commands you need to get started.

  1. pwd to print your current working directory
  2. cd to change working directory
  3. ls to list files and directories in your current working directory
  4. cat used to print the content of a file
  5. cp to copy file
  6. mv to move files from one location to another
  7. mkdir to create a new working directory or folder
  8. rmdir to delete the working directory of the folder
  9. touch to create a blank new file
  10. locate to search files in your machine
  11. find can also use to search for files
  12. grep to search for a specific pattern in a file or directory
  13. sudo to run tasks with admin power
  14. head to print the first lines of a file
  15. tail to print the last line in a file
  16. chmod to change file permission
  17. man to read the manual of Linux commands
  18. echo to print text on the console
  19. useradd to add new users

You can learn more about Linux and command-line commands here

Summary

Now you have a brand new Linux VM up and running to start building your development environment. This is a very important step in your developer journey. Your local development environment is your safe place to write, and test code without worrying about breaking anything. One of the good practices in dealing with VMs is to keep taking regular snapshots of your VMs just in case you break something so you can always revert back to a previous snapshot. If you would like to receive it right in your inbox every time I publish a new article, consider Joining my newsletter. I share about my journey, exciting tech news, tips, and tools. Let's learn and grow together.