Introduction: Computer and Network Virtualization With VirtualBox

Virtualization is a powerful solution for creating and managing networks or individual computers. Hypervisors (virtual machine controllers) can create, manage, network with and share resources with virtual computers, all within Windows, Mac, and Linux, or even without having a host operating system installed. Here, I'll be teaching you some ways to increase your productivity with one common tool for virtualization: VirtualBox.

Step 1: Creating a Virtual Machine

To create a virtual machine, you'll want to click "New" in the upper left corner of the VirtualBox window. This will bring you to a step-by-step walkthrough to create a virtual machine. Give it a name and select the type of operating system it will be running, or select "Other" if it doesn't fall into any of the given categories.

Next, you'll be prompted to allocate memory for your virtual machine. It will recommend a small amount of memory, but for better performance, you'll want to select more than it recommends. Make sure not to drag it into the red area, since that can slow down your host machine and run you out of memory.

Finally, you'll be asked to create a virtual hard disk. You should create one immediately, unless you have special requirements and have enough experience to attach another virtual disk. The default type (usually VDI) is fine, but you should decide how large it should be. The default size it usually good enough, but if you need more later you won't be able to change it.

Step 2: Loading an ISO File Into Your Virtual Machine

To load an ISO (disk image) into your virtual machine, right click on the virtual machine and click "Settings". Go to "Storage" and find the CD icon. After you click it, locate the drop down menu "Optical drive." Click the CD icon next to that drop down menu and select "Choose virtual optical disk file." Locate the ISO file you downloaded and open it.

After you have loaded the disk image into your virtual machine, you can start the virtual machine and it will recognize that the virtual disk has been put in.

Step 3: Sharing Folders With Your Virtual Machine

You can share folders with your virtual machines so that both your host and your VM can access the same files. To do this, go to the virtual machine settings and click "Shared Folders" on the left. Click the folder icon with a "+" over it. This will open a dialog with some options. Click the down arrow on the right and select "Other" or select a recently used folder. If you click "Other," locate the folder to share and open it. Then, decide whether you want it read-only for the VM or not, and whether you want the virtual machine to automatically mount the shared folder. Click "OK" and start your VM. The virtual machine will now be able to access the files in the shared folder. You can add another, too, or remove it by going into the settings and clicking the folder with a "-" over it.

Note: Shared folders require installing the guest additions for your virtual machine.

Step 4: Networking Your Virtual Machine

Virtual machines can be set up with various network configurations, used as servers, and even be used to communicate with other virtual machines. Virtual machines can have up to 4 virtual network adapters, each being individually configured. To modify these, go to the virtual machine settings and go to "Network" in the left.

The possible network adapters are:

  • NAT - Creates a connection to the outside world where the virtual machine can initiate connections, but outside computers cannot connect to the VM without the VM initiating the connection.
  • Bridged adapter - The virtual machine can connect to the outside world and gets its own IP address, but your host cannot connect to it directly.
  • Host-only adapter - The virtual machine can only communicate with your host machine. It cannot connect to the outside world.

Select the option you want for each virtual network adapter, then save the settings and start your virtual machine. The machine will now connect to the network the way you specified.

Step 5: Learning More on Your Own

It's difficult to cover every possible feature of VirtualBox, so you should create a virtual machine (on a non-production machine) and mess with its settings. This way, you'll learn what everything does. Try to discover how to encrypt your VM, access it remotely, and more.

Comments

author
ajkomar (author)2017-05-03

Very helpful. Looks great.

author
Swansong (author)2017-05-02

Thanks for sharing :)