How To Install virt-viewer on Ubuntu 20.04

In this tutorial we learn how to install virt-viewer on Ubuntu 20.04. virt-viewer is Displaying the graphical console of a virtual machine

Introduction

In this tutorial we learn how to install virt-viewer on Ubuntu 20.04.

What is virt-viewer

virt-viewer is:

The console is accessed using the VNC or SPICE protocol. The guest can be referred to based on its name, ID, or UUID. If the guest is not already running, then the viewer can be told to wait until is starts before attempting to connect to the console The viewer can connect to remote hosts to lookup the console information and then also connect to the remote console using the same network transport.

There are three methods to install virt-viewer on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install virt-viewer Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install virt-viewer using apt-get by running the following command:

sudo apt-get -y install virt-viewer

Install virt-viewer Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install virt-viewer using apt by running the following command:

sudo apt -y install virt-viewer

Install virt-viewer Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install virt-viewer using aptitude by running the following command:

sudo aptitude -y install virt-viewer

How To Uninstall virt-viewer on Ubuntu 20.04

To uninstall only the virt-viewer package we can use the following command:

sudo apt-get remove virt-viewer

Uninstall virt-viewer And Its Dependencies

To uninstall virt-viewer and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove virt-viewer

Remove virt-viewer Configurations and Data

To remove virt-viewer configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge virt-viewer

Remove virt-viewer configuration, data, and all of its dependencies

We can use the following command to remove virt-viewer configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge virt-viewer

References

Summary

In this tutorial we learn how to install virt-viewer package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.