Walkthrough On How To Use GNOME Boxes

Boxes or GNOME Boxes is virtualization software for GNOME Desktop Environment. It is similar to Oracle VirtualBox but features a simple user interface. Boxes also pose some challenges for newbies and VirtualBox users, for instance, on VirtualBox, it is easy to install guest addition images through menu bar but the same is not true for Boxes. Rather, users are encouraged to install additional guest tools from the terminal program within the guest session.

This article will provide a walkthrough on how to use GNOME Boxes by installing the software and actually setting a guest session on the machine. It will also take you through the steps for installing the guest tools and provide some additional tips for Boxes configuration.  

Purpose of virtualization

If you are wondering what is the purpose of virtualization and why most computer experts and developers use them a lot. There is usually a common reason for this: TESTING.

Developers who use Linux and writes software for Windows has to test their program on an actual Windows environment before deploying it to the end-users. Virtualization makes it possible for him to install and set up a Windows guest session on his Linux computer.

Virtualization is also used by ordinary users who wish to get hands-on with their favorite Linux distro that is still in beta release, without installing it on their physical computer. So in the event the virtual machine crashes, the host is not affected and the important files & documents stored on the physical disk remain intact.

​Virtualization allows you to test software built for another platform/architecture which may include ARM, MIPS, SPARC, etc on your computer equipped with another architecture such as Intel or AMD.

Installing GNOME Boxes

Launch Ubuntu Software and key in “gnome boxes”. Click the application name to load its installer page and then select the Install button.

install gnome boxes

Extra setup for Ubuntu 18.04

There’s a bug in GNOME Boxes on Ubuntu 18.04; it fails to start the Virtual Machine (VM). To remedy that, perform the below two steps on a terminal program:

  1. Add the line “group=kvm” to the qemu config file
    sudo gedit /etc/modprobe.d/qemu-system-x86.conf
  2. Add your user account to kvm group
    sudo usermod -a -G kvm <your account name>
gnome boxes extras for ubuntu 18.04

 After that, logout and re-login again for the changes to take effect.  

Downloading an image file

You can download an image file/Operating System (OS) from the Internet or within the GNOME Boxes setup itself. However, for this article we’ll proceed with the realistic method ie., downloading an image file from the Internet. We’ll be configuring Lubuntu on Boxes so head over to this website to download the Linux distro.

To burn or not to burn

If you have no intention to distribute Lubuntu to your friends or install it on a physical machine then it’s best not to burn the image file to a blank disc or portable USB drive. Instead, just leave it as it is, we’ll use it for creating a VM afterward.  

Starting GNOME Boxes

Below is the interface of GNOME Boxes on Ubuntu –

create gnome boxes

The interface is simple and intuitive for newbies to get familiar right away without much effort. Boxes don’t feature a menu bar or toolbar, unlike Oracle VirtualBox. On the top left is the New button to create a VM and on the right houses buttons for VM options; delete a list or grid view, and configuration (they’ll become available when a VM is created).  

Installing an Operating System

Click the New button and choose “Select a file”. Select the downloaded Lubuntu image file on the Downloads library and then click the Create button.

install os on ubuntu guest box

In case this is your first time installing an OS on a VM, do not panic when the installer pops up a window asking you to erase the disk partition. It’s safe, your physical computer hard drive won’t be erased, only that the storage space would be allocated for your VM. So on a 1TB hard drive, if you allocate 30 GB for your VM, performing erase partition operation on Boxes would only erase that virtual 30 GB storage drive and not the physical storage.

Usually, computer students find virtualization a useful tool for practicing advanced partitioning using UNIX based OS. You can too since there is no risk that would tamper the main OS files.

After installing Lubuntu, you’ll be prompted to reboot the computer (VM) to finish the installation process and actually boot from the hard drive. Confirm the operation.

Sometimes, certain Linux distros hang in the reboot process after installation. The trick is to force shut down the VM from the options button found on the top right side of the title bar and then power it on again.  

Set up Guest tools

By now you might have noticed Lubuntu’s screen resolution is small with extra black spaces on the left and right side, and folder sharing is not enabled too. This brings up the need to install guest tools on Lubuntu.

Launch terminal program from the guest session (not your host terminal program) and install the guest tools using the below command:

sudo apt install spice-vdagent spice-webdavd 

After that, reboot Lubuntu and the next boot will set the VM to its appropriate screen resolution; no more extra black spaces on the left and right side. You can resize Boxes window and the guest screen resolution will automatically resize itself.

lubuntu on gnome boxes

To share a folder between the host and guest, open Boxes options while the guest is still running and choose Properties. On the Devices & Shares category, click the + button and set up the name. By default, Public folder from the host will be shared with the guest OS. You can configure the directory of your choice. After that is done, launch Lubuntu’s file manager program (it’s called PCManFM) and click Go menu on the menu bar. Select Network and choose Spice Client Folder. The first time you try to open it a dialog box will pop up asking you which program should handle the network, select PCManFM under Accessories category and the network will be mounted on the desktop. Launch it and there you’ll see your shared folder name.​Now you can share files and folders between host and guest computer. Subsequent launch of the network will directly open the shared folder so you don’t have to open the folder manually the next time.

gnome boxes guest addition

Where’s the OS installed?

Lubuntu is installed as a VM using GNOME Boxes but where does it store the disk image?

This question is of particular interest for those who wish to move the huge image file to another partition where there is sufficient storage. The trick is using symlinks which is efficient as it saves more space for Linux root partition and or home partition, depending on how the user set it up during installation. Boxes stores the disk image files to ~/.local/share/gnome-boxes/images folder  

Conclusion

We’ve successfully set up Lubuntu as a guest OS on our Ubuntu. You can try other variants of Ubuntu such as Kubuntu, Ubuntu MATE, Xubuntu, etc or some random Linux distros which in my opinion would be quite challenging due to varying package management. But there’s no harm in wanting to 🙂 You can also try installing other platforms like Microsoft Windows, OpenBSD, etc on your computer as a VM. And by the way, don’t forget to leave your opinions in the comment section below.

Sohail
Sohail

Mohd Sohail is a web developer and a Linux sysAdmin. He also loves to write how-to articles, applications reviews and loves to use new Linux distributions.

Articles: 859

7 Comments

  1. I finally installed the Gnome Boxes with all dependencies, apter searching on Internet how to do it properly ( at first it wouldn’t obviously work ), and then, when it finally started working, suddenly the pointer started to disappear after initialising the guest system. I give up.
    Is there any VM that, actually, work?

    • Yes the same happened to me. That’s why I prefer virtualbox, you can use virtualbox to get your work done and it also captures/uncaptures mouse at your command.

  2. Thank you! Thank you! Thank you!
    I was trying to get Gnome boxes to work on Pop! OS and you mentioned about that bug in Ubuntu (18.04) and what to do about it and that did the trick!
    I’m marking this article to keep for referencing when I eventually have to reinstall or something.
    I’m surprised I didn’t see anything about this bug come up quicker.

  3. I just discovered boxes from this post. I have been using VMWare and others for quite some time and am always running into issues. Just like Dragonbite, I did have the Ubuntu issue, but your solution also worked for me too!
    Is there a list somewhere of guest OS’s that work well on Ubuntu 18.04 as a host? I would like to setup a separate development nodejs web server.

    • I’ve installed CentOS and Fedora which both run “out-of-the-box” (pun intended 😉 ) without any of these work-arounds.

  4. An issue I’ve come up with and am wrestling with is Networking.
    I want to set up a web server VM but I cannot navigate or even ping the IP address of the server.
    I’ve read that it needs a network bridge? Unfortunately Networking can be my Kryptonite and just something in my brain cannot process it.
    Is there any easy to use documentation, specifically for making the network work for Gnome Boxes (even if it requires something else installed)?
    I had this problem with Virtual Box years ago too and don’t remember how I solved it.

    • The network wrestle is also my issue. I have a local server and do not see any indication in the Gnome-Boxes App on how a Gnome-box can talk with the server and access shares.

Leave a Reply

Your email address will not be published. Required fields are marked *