Want to run another operating system on top of your current one? The easiest solution is Oracle’s VirtualBox. This article will walk you through the basics of setting up your first VM (Linux Mint). Let’s begin!
So what is VirtualBox? It’s a type of hypervisor. What’s a hypervisor? It’s software to allow sharing of the physical hardware between running OS’s. For VirtualBox it means it will allow a virtual PC to share hardware with you main OS while it is running. There is another form of hypervisor but that’s more information than you need for now. Just know that this software let’s you run virtual computers inside your main computer. Like running Windows in a Mac or Linux inside Windows.
If at any time you want to learn more, you can consult the online documentation for VirtualBox here: https://www.virtualbox.org/wiki/Documentation
First thing is first. If you haven’t already, go to the VirtualBox website download page and get the version to match your OS(Windows, Mac, Linux[Check your distro’s repos to see if one is already maintained for you]) and then install it. All the default options are fine. This is not like Java and currently does not prompt to install the ask toolbar or other unwanted software/pc changes. Ok, have it installed now? Great! Now let’s walk through creating a new Virtual Machine and configuring it’s settings.
If you prefer video you can check out this one I made below. Otherwise scroll on down and you can get the step by step text guide with photos.
1) Click new from the main start page. This will start the new VM wizard.
2) The first screen will ask for a name which will be used to identify it from other VM’s that you create when they are listed in the main screens sidebar. In addition you will want to pick your OS type and version. As we are using Mint, we select Linux, and Ubuntu as Mint is derived from Ubuntu. If you encounter issues you can change this to generic Linux later under the VM settings.
3) Next it will ask you to pick how much RAM for the VM. RAM will be taken all at once so pick as much as you need, but not all available. This RAM will be used directly from the host OS(your current OS). So I have 7.5GB available on my machine and Windows is using about 2GB, I will allocate another 1GB for this which will make my machines active RAM when using this at least 3GB’s. This RAM will not be accessible to the host while in use.
4) Now you will be prompted to set up the hard disk. As this is a new VM you can leave it to ‘Create a virtual hard disk now’. However if you already have a virtual HDD file you can use an existing one by choosing that option.
5) After selecting to create a new virtual disk file, it will ask you what type. VDI is perfectly fine and can be converted to other types if needed. You can ignore the other options until you start working more with VM’s and find that enterprise and others systems out there in the world use these other formats.
6) The next step will ask you if you wish to make the hard disk file fixed or dynamic. Fixed means that the entire size will be allocated now, so a 20GB virtual drive will take the full 20GB once created. Dynamic means that the file size will only be as big as what your VM uses. So if you install Linux and it takes up 10GB of the 20GB max, the file size on your PC will only be 10GB. This helps preserve free space on your main PC’s HDD if it’s needed. I have never run out of HDD space while saving a VM so I am unsure what kind of error would happen at that point. So plan your virtual disk drives accordingly.
7) Next you will pick the file name/location and maximum virtual HDD size. I would pick 20GB as a starter. Mint requires 9.5GB to install when I checked last. Clicking Create will make your virtual machine and take you back to the main application window.
9) Before starting the VM you will want to attach your boot disk of choice to install your OS. So, click Settings and you will be brought to the screen below (but to the general section). Your first edits will be to the System screen. Here you can change the RAM, and attached virtual optical/hard/floppy disk drives. I uncheck floppy by default as you generally only want to add what you need(this is also the philosophy of setting up a server and should be the philosophy of all OS installs). The other options don’t need to change, and I recommend you read the VirtualBox manual before changing them to be sure you understand their impact.
10) Under the system screen you will also want to modify settings on the Processor tab. Here I like to give at least 2 cores if available as it makes your virtual PC much more responsive. If available check the Enable PAE/NX option to allow the virtual machine to access the expanded address space functions of your CPU. This is will help make your VM more efficient.
11) After these changes, the next ones to be concerned over are under the display section. Here you can set your video memory monitor count and enable 3D acceleration. With any modern system I would suggest bumping up the video memory slightly if you are working in high resolution windows or if the OS complains. It allows your guest OS to have more space to work with graphical tasks, so if your display seems to lag, bump up your VRAM. Also I enable 3D Acceleration as well to help improve performance. You can increase the monitor count if you have more than one display hooked up. 2D video acceleration is a Windows specific setting, so be sure to check that if you are using Windows in VirtualBox.
12) Next, on to the Storage section. Here you want to set the optical drive to load your iso file. Although you may use a live CD/DVD do not check this option if you are booting once to install the OS. By checking this box it will remember your disk after a reboot. Leaving it unchecked will remove the disk after the VM reboots. This means no worry of removing the disk from here later once you install your OS.
13) Network is where you can go next. By default it will pick NAT which will basically put your VM on it’s own private network within your current network(similar to how your home network is a private network connecting out to one your modem joins from your ISP). If you want your VM to show up on your local network, you can use the Bridged Adapter and the guest OS will use your network adapter directly instead of passing data through the host OS to the network.
14) With all these settings adjusted you are now ready to launch your VM. Click ‘OK’ to save your changes and then click ‘Start’ on the main screen to launch your virtual machine!
15) That’s it! Now your machine should be up and running and you can use it just as you would a standard PC. The only real limitation to running an OS in a VM is that it cannot receive most of the GPU’s power. There are extensions that can enable it to an extent but getting 3D graphics working contains much more than any basic tutorial should cover. If you do like running VM’s I am sure you will look up how to actually do this, but I will give you a hint. Search for VGA Passthrough. However, I would highly recommend that you do not try this until you have become very familiar with VM’s and hypervisors.
I hope this tutorial was helpful for those who are new to virtual machines and learning VirtualBox. As I mentioned above, if you want more information about VirtualBox you can check out it’s online documentation here: https://www.virtualbox.org/wiki/Documentation
If you found this helpful please subscribe, share and let me know in the comments. Have a question or found an error in what I wrote? Let me know about it below!