How to install a virtual machine [A step-by-step guide]

WHAT ARE VIRTUAL MACHINES(VM)?

A virtual machine is a type of software that acts like a computer inside of a computer. It allows one machine to run multiple different operating systems (OS).

HOW DOES IT WORK?

Just like any other regular computer, the simulated computer will need its hardware and its OS to be able to work.

Now, you do not have to buy extra hardware for the simulated computer. We will simply "borrow" from the device you have.

Next, the OS. The one you are currently running right now can be called the host OS, as it will be the one hosting the virtual machine. As you might have guessed, the OS that will be running on the VM will be called the guest OS, and this can be anything. Should you need to run OS X(used in Mac devices) while your host OS is Windows, you can, using a VM

Finally, for all of this to be possible, you will need a hypervisor. A hypervisor is like any application software you may have already installed on your device, but in this instance, it will allow use to run VMs.


WHY SHOULD I USE VMs?

VMs can help circumvent many of the issues and limitations of using 1 singular device.

1. It saves money

Should you need to run programs that may not be compatible with your host OS, you do not have to go out and purchase another device just for that one task. Again with the videogame example, your laptop cannot run games designed for the PSP, but instead of buying the physical device, you may run a PSP emulator instead.

2.It has no impact on your actual device.

Everything that happens in a VM, stays in the VM. This can be very useful should you want experiment with hacking or maybe to test the efficacity of a certain malware remover without running the risk of putting your actual device at risk. An infected VM will not affect your actual device whatsoever. You can simply delete it and move on.

3.You are interested in Cybersecurity

Very popular nowadays. A VM can allow you to access OS that are designed for ethical hacking much easier than, again, purchasing a device with the software installed. OS like Kali Linux are very popular among the white hat hacking community and even sites like tryhackme.com recommend using such software for their reliability and security.

HOW DO I SET ONE UP?

There are tons of ways and tons of OS to choose from, but for now, we will simply use VirtualBox as our hypervisor and run Kali Linux as our guest OS.


[OPTIONAL] ENABLE VIRTUALIZATION

Before all of that, you may need to set the Enable Virtualization setting on your BIOS if you want to use a 64-bit OS as your guest OS.

To do this, restart your device and press the appropriate key on startup to access BIOS. This key may differ based on the manufacturer of your device. For an ASUS laptop for instance, you have to hold the F2 Key.

Here is what my BIOS screen looks like;


I clicked on Advance Mode(pointed in red) and was given this screen.


Here I simply enabled Intel Virtualization Technology, shown in red. Then I saved and exited and we're ready to start.

GETTING THE HYPERVISOR

Here we will be using Oracle VM VirtualBox < https://www.virtualbox.org/ > 

Click on the Downloads section and the appropriate host OS you have. In my case, it is Windows.


The installer should be downloading.

[Optional]You may also want to install the extension pack as well, to gain access to a myriad of features that we will cover in a future blogpost.




Once that is done, run the Virtual Box Installer. Accept any agreements and simply click on 'Next' until you see the 'Install' prompt.

Once installed, Virtual Box should be launched and you will find a screen like so.



[Optional] Then, you can run the extensions installer. You will be prompted with this screen, click 'Install'.



The hypervisor should be ready to go, but now we will need the guest OS to run the VM.

GETTING THE GUEST OS

Here, we will be using Kali Linux as our guest OS < https://www.kali.org/ >.


From here, click on Download and you will find this webpage.


The website offers VMs will pre-built images but for the sake of this explanation, we will be doin the full setup ourselves, so click on Installer Images to be redirected to the webpage containing the ISO files.


Choose the appropriate bit for your OS, in this case 64-bit, and download the installer. You may have noticed the file to be quite hefty at 4GB but that is because it also includes every tool required to get your ethical hacking and penetration testing started.

STARTING THE VIRTUAL MACHINE
Once the ISO file has been installed, open Virtual Box once more.

Click on New. You should be given this screen to fill out


Give the Virtual Machine a name, for the sake of simplicity I chose 'Test1'.
Next find the Kali Linux ISO image we have just downloaded, it should be in your Downloads folder.
When all set, click 'Next'.

Next will be the part where we will "borrow" the hardware from our device.


Assigning the hardware will fully depend on how well you want the VM to perform. The more resources you assign, the more powerful the VM. However, remember that this will take away from your device and may cause some issues, so do not go overboard.

An easy way to estimate how much you should assign to your VM is by running your Task Manager alongside all the usual applications you would have open, then checking under Performance.



This is my task manager. Under normal conditions, my device uses around 5GBs of RAM to operate the apps I usually run. That leaves me with around 11GBs to assign to the VM. I assign around 5GB, which is plenty.

As for the CPU cores, about 3 should be enough for most OS, but I decided to assign 4 just to be sure. It is imperative that you do not assign more than half of the cores you have on your device as it may lead to issues.

Next, assigning the hard disk space


Keep the default setting for now and assign the amount of space to allocate to the VM. We will keep it at around 30GB for now.

Next, you'll be met with a confirmation screen and if everything is in order, confirm and it will return you to the VirtualBox main menu.


You will find your VM, in my case named 'Test1', on the left of the screen, simply select it and hit start to enter the Virtual Machine.

SETTING UP THE GUEST OS
Now that the hardware part is done, the machine will prompt you with the installation of the OS.

This should be your screen, select 'Graphical Install'.

[NOTE: Interacting with the VM will capture your cursor and keyboard input into the VM. To regain access to your host device, simply press the button denoted at the bottom right of the VM screen, in this case Right Ctrl]

Next, you will be prompted will all of your typical installer settings, like language and such


Choose whichever you prefer, the device will then run some configurations automatically. Next, set up the hostname, we will skip the following page involving domain names for now.


Next set up and account the device clock as you would on a regular device







Then comes the part where you partition the hard disk of the VM. Note that this will not affect your entire hard disk but only the part you have allocated for the VM.
Choose Guided-Entire Disk



Select 'Yes' on both of these screens



Here, select the allocated GRUB bootloader and hit 'Continue'.



The installation is now complete.

You will be prompted to run the VM with Kali Linux installed. Choose Kali Linux and hit Enter.

Log in to the account you have created, in my case the username is 'user1'


Et voilĂ ! you should be on the desktop of a VM using Kali Linux.


CLOSING WORDS
Thank you for reading my blog! I hope you've found this guide helpful, I am new to Virtual Machines myself and owe a lot of this knowledge from <https://www.youtube.com/watch?v=wX75Z-4MEoM>

I hope to cover the other useful features that are found in VirtualBox in a future blog. Stay tuned!

























Comments

Popular posts from this blog

NetBSD

Simple Git tools using a Command Line Interface