Linux Test Bed with VirtualBox
Experimenting with Linux can be brutal at first. I remember having to reinstall it a bunch of times on my physical pc when I was learning back in the day. It was always the video card drivers. This was all before virtual machines were a thing of course. Now a days you can emulate that same physical computer and its all the rage.
This article is here to help you setup a development environment on your residential OS so you don't have to switch back and fourth and deal with accidentally nuking the wrong partition. (ouch)
Depending on your computer you will need to do one or both. Ideally both is better. There is a difference between a docker container and vm that is hard to quantify without you running both.
The constraint is the architecture of your computer if it is one of those new macs good chance its ARM64 and doesn't play well with virtual machines. In this case you're fucked get a desktop or skip to Docker part.
Containers vs Virtual Machines
Dependencies are everywhere
What do I do?
First are you running windows or mac?
- Windows - Read the the vm guide
- Mac - Figure out if you have arm64 or amd64.
AMD or ARM?
To check if you have one or the other run the following command:
uname -a
IF you have ARM, skip this article and jump to Intro to Docker.
VM Guide
Go to oracle and grab a copy of virtual box. Windows
There are links for Linux and Mac. The installation process slightly varies between all three OS's but most of the stuff is the same. The intel virtualization bit is universal so make sure to do that bit.
Install the binary you just downloaded.
If you are prompted with this error message and are running an x64 arch click here to download. main download page
After installing Visual C++ try your Virtual Box install again. Basically click next next next. When you are finished you should be greeted with this.
Once installed you will want to grab yourself a flavor of Linux or two to test on. I recommend grabbing Rocky Linux and Ubuntu for your first tries. There are may versions of Linux. I like mint, fedora, and rocky. It's a lot of opinionated stuff going on in those realms so its all what you need it for. (Kali aka Backtrack) You can find many flavors on the rating board distrowatch.
Download Fedora Workstation and Ubuntu Desktop.
Create a new virtual machine
On the list give it a name and click the drop down for ISO and then navigate to your downloads where you have Fedora waiting. After you finished that click next. When you make it to the resource assignment give yourself 4 GB of ram to be safe.
After you configured your virtual machine you will need to enable Intel Virtualization in your Bios. This varies from computer to computer but typically entails you jabbing f2 like a mad man while the computer is restarting. This will bring you to the bios screen and then you will need to navigate to advanced and find the Intel Virtualization option and enable it. Then save your configure and restart the box.
Configure networking to Bridge so you can share the services you run with your host machine
After you are done with click start on the Virtual Box menu. An instance should spin up and give you will see an installation menu for Fedora. Install the OS onto the virtual drive. Once the installation finishes make you way back to the settings menu and remove the cd from the storage section.
So you have this Linux box. Now what? Check out this other article that expands on this one. It will talk about things you should focus on learning and suggests sites where you can find them.
When you are finished shut down the os like any other and the window running will close automatically. When you are ready for another session click start again.
After you spent some time working you way around the Fedora system try some of the same stuff on Ubuntu.