Linux: How to quickly create a virtual machine with Boxes?


Imagine: you are using a Linux distribution and you want to quickly deploy a virtual machine of another Linux distribution for testing purposes, or to have a secondary operating system to use for development, training or simply for have fun trying out different distros.

One of the easiest ways to do this is through Boxes, which is part of the GNOME desktop ecosystem and can be used to spin up virtual machines. You can create as many virtual machines as you want (provided you have enough local storage space).

These virtual machines behave like guest operating systems on your host, so you can use them to log in, install applications, and do just about anything you do with your host operating system. The advantage of these virtual machines is that they can be created and destroyed easily.

Do you know how to virtualize?

If something goes wrong, you can delete the virtual machine you are working on and start another one. Say, for example, you want to install an application but you’re not 100% sure how it will interact with your host operating system (or if it’s safe enough to install on the host, where your personal data resides); create a virtual machine, test the application and destroy the virtual machine without damaging your default operating system.

Let us show you how. We will create an instance of Endless OS as guest on Pop!_OS running as host. Before you begin, you must first ensure that your hardware is capable of virtualizing. To do this, log into your Linux desktop, open a terminal window, and run the “lscpu” command.

In the output of this command, you should see something like this: Virtualization: VT-x. If this line appears, you are ready.

Installation of Boxes

Boxes is not installed by default, so you may need to install it first. You can do this in two ways. The easiest way to install Boxes is to open the software center (such as GNOME Software on GNOME or Discover on KDE) and search for Boxes. Once you locate the entry, click it, then click Install. If you prefer the command line approach, open a terminal window and run one of the following commands.

  • For Ubuntu-based distributions: sudo apt-get install gnome-boxes -y
  • For Red Hat-based distributions: sudo dnf install gnome-boxes -y

Once the software is installed, you are ready to launch your first virtual machine.

Creating a virtual machine with Boxes

Open Boxes from your desktop menu. In the resulting window, click “+” in the upper left corner. In the resulting pop-up window, scroll down and locate the Linux operating system you want to use for the virtual machine.

In our case, we are going to use Endless OS Basic x86_64. Make your choice and Boxes will automatically create the virtual machine (this may take some time, depending on your internet connection speed). When the download of the necessary ISO is complete (which Boxes does automatically), configure the memory and storage limit options according to your needs and click Create to complete.

Boxes will automatically start the new guest operating system, where you can then follow the installation process. The flow of the installation process depends on the Linux operating system you have chosen for the guest. Once the installation is complete, you will need to reboot and you will be able to log in to your guest.

When you are done using the virtual machine, you can click the left-pointing arrow to pause the guest and then close the boxes. You can then click on your virtual machine’s launcher to start it at any time. That’s how easy it is to spin up a Linux virtual machine with Boxes. If you ever need it and your host OS is Linux, Boxes is a great option that requires a lot less setup and management than some of its competitors (like VirtualBox).

Source: ZDNet.com





Source link -97