virt-login-shell command not found

In this troubleshooting guide we learn how to fix virt-login-shell command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

virt-login-shell: command not found

or when using sudo you get the following error message

sudo: virt-login-shell: command not found

Solutions to virt-login-shell: command not found

How To Fix virt-login-shell: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu virt-login-shell is provided by libvirt-login-shell package.

libvirt-login-shell is:

Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). The library aims at providing a long term stable C API for different virtualization mechanisms. It currently supports QEMU, KVM, XEN, OpenVZ, LXC, and VirtualBox.

This package contains the virt-login-shell tool, which can be set as a user’s login shell to isolate their sessions using LXC containers.

To fix this problem, we can install more using the command below.

sudo apt-get -y install libvirt-login-shell

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install libvirt-login-shell.

sudo apt -y install libvirt-login-shell

Or if you have aptitude installed you can use the following command.

sudo aptitude install libvirt-login-shell

Summary

In this tutorial we learn how to fix virt-login-shell command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.