This quick tutorial explains the steps to install and use GNOME Boxes and create virtual machines, and with some tips and troubleshooting as well.
Virtualization is a process of running a virtual instance (rather than actual) with an abstracted layer of hardware. In popular terms, it allows you to install and run multiple operating systems (Linux, Windows) simultaneously.
A Virtual machine is a simulated operating system that runs on top of another operating system and uses the same hardware, storage space with the host machine. Although, you can control how much shared memory or space can be allocated to virtual machines.
There is multiple software available to create virtual machines, e.g. Virtual Box, KVM, Hyper-V, VM Ware player, and GNOME Boxes.
But honestly, most of them are complex to use and sometimes not stable enough. GNOME Boxes is another free and open-source software that is very easy to use and makes it simple for you to create, manage virtual machines by abstracting lots of options.
Install GNOME Boxes
If you are running Fedora with GNOME Spin, you should already have it installed. However, for Ubuntu, Linux Mint, Kubuntu, and other distributions you can simply run below to install it in your system.
sudo apt install gnome-boxes
Create Virtual Machine using GNOME Boxes
Launch GNOME Boxes from the application menu. To create a virtual machine you need an image (*.ISO) of the operating system which you want to virtualize. You can download any operating system iso images from the official download page of the distributions. For this guide, I am using Pop! OS which is a great Linux distribution.
After you launch, click on the “+” icon at the top to start.
In the next window, you can choose already available downloads or you can select your iso file as OS source. Click on the “Operating system image file” and choose your iso file.
Assign the memory and storage space of your virtual machine. Remember, your virtual machine would take the memory and storage from your host system. So try not to assign as max. For example, in the below image – I have assigned 2GB memory for the virtual machine (guest) from the total 8GB memory of the host system. Similarly, choose minimum storage space as well if you want to just test any OS. But if you are creating a virtual machine for servers or serious work, be logical how much space or memory you want to assign. Another important thing to remember that the storage disk space which you allow will be blocked permanently unless you delete the virtual machine. So, you won’t get that much of disk space as free even if your virtual machine doesn’t use the entire allocated space.
Continue with the installation. In the partition window, you should be seeing one harddisk and partition which is the virtual machine disk space. Don’t worry, you can play around with this partition and it will not impact your physical disk partitions or any data on your actual host system. Follow the same /root partition while installing Linux, and continue.
After you complete the installation, you should be seeing your new operating system in the virtual machine. In the GNOME Boxes, you should see an entry to the system. You can click once to boot your virtual machine.
You can power off the virtual machine by using your virtual machine operating system’s internal shutdown option.
If you want you can delete the virtual machine by choosing the context menu option.
You can also check how much memory, CPU your virtual machine is using from the properties window. Note that you can adjust the memory as well of your existing virtual machines using properties.
Resolution problem in virtual machines
If your virtual machine is having low resolution which is incompatible with your host system, then you have to install the below items. Open up terminal in the guest system (not in the host system) and run below commands.
For Ubuntu-based distributions
sudo apt install spice-vdagent spice-webdavd
sudo dnf install spice-vdagent spice-webdavd
These two packages help to determine proper resolutions, copy/paste between host and guest, sharing files via public folders, etc.
Once installed, reboot the guest system; Or you can log off and re-login once after reboot, you should be seeing the proper resolution.
Boxes don’t start a virtual machine in Ubuntu 18.04 based distributions
If you are creating a virtual machine in Boxes 3.34 then you should know that there was a bug that caused your virtual machine to fail to start. To fix that you have to follow some additional steps. Remember these are not required for the latest Boxes 3.36.
Open a terminal window and run below command to change the qemu config file
sudo gedit /etc/modprobe.d/qemu-system-x86.conf
Add the below line in the above file and save.
Now, run below command to add your username to the KVM group.
sudo usermod -a -G kvm <your account name>
If you still facing issues with virtual machines with GNOME Boxes, let me know using the comment box below.