How to remove all network namespaces at once on Linux

Question: I have created a number of network namespaces, and now I want to remove them all. Is there a way to delete all existing network namespaces at once from the command line on Linux? In Linux, the concept of “namespaces” was introduced as a way to isolate system resources among different groups of processes. […]
Continue reading…

 

How to detect the type of virtualization from the command line

Question: I am trying to write a shell script in which I need to detect whether the Linux server on which the script is running is a virtual machine, a container or actual bare-metal hardware. This is because the script should perform different tasks depending on whether the underlying server is virtual or physical. Is […]
Continue reading…

 

How to compile virt-manager on CentOS, Fedora or RHEL

Question: I would like to install the latest virt-manager which is available from its official website. How can I compile and install virt-manager from the source on [CentOS, Fedora or RHEL]? virt-manager is a popular GUI-frontend for libvirt, allowing users to create and manage guest virtual machines on libvirt-supported hypervisors such as QEMU/KVM or Xen. […]
Continue reading…

 

How to compile virt-manager on Debian or Ubuntu

Question: I want to build and install the latest virt-manager from its source on my Linux desktop. What is the procedure for compiling virt-manager on [Debian, Ubuntu]? virt-manager is a GUI-based virtual machine manager which allows you to create and manage (local or remote) virtual machines and containers via libvirt APIs. It supports multiple hypervisors […]
Continue reading…

 

How to mount qcow2 disk image on Linux

Question: I have a qcow2-type disk image which is used by one my guest VMs on QEMU/KVM. I want to modify the content of the disk image without powering on the VM, and for this I need to mount the disk image somewhere. Is there a way to mount a qcow2 disk image on Linux? […]
Continue reading…

 

How to upgrade Docker on Debian or Ubuntu using the official source

Question: I installed Docker from the base repository of my distro, which seems to be out-of-date. How can I upgrade Docker on [Ubuntu or Debian], preferably using the official source? While Debian, Ubuntu or their derivatives offer Docker in their base repositories, the version of their Docker tends to be quickly outdated as Docker has […]
Continue reading…

 

How to reset the password in an LXC container

Question: I created an LXC container, but I cannot log in to the container as I forgot the default user’s password and the root password. How can I reset the password on an LXC container? When you create an LXC container, it will have the default username/password set up. The default username/password will vary depending […]
Continue reading…

 

How to convert OVA image to QCOW2 format on Linux

Question: I have downloaded a virtual appliance packaged in OVA format. I want to convert the OVA image to QCOW2 format, so that I can run the virtual appliance on KVM hypervisor. How can I convert OVA image to QCOW2 format on Linux? When virtual appliances are created and distributed, they are packaged in a […]
Continue reading…

 

How to configure PCI-passthrough on virt-manager

Question: I would like to dedicate a physical network interface card to one of my guest VMs created by KVM. For that, I am trying to enable PCI passthrough of the NIC for the VM. How can I add a PCI device to a guest VM with PCI passthrough on virt-manager? Modern hypervisors enable efficient […]
Continue reading…

 

How to upgrade Docker on Ubuntu from Canonical’s PPA repository

Question: I installed Docker on Ubuntu using its standard repositories. However, the default Docker installation does not meet the version requirement for my another application that relies on Docker. How can I upgrade Docker to the latest version on Ubuntu? Since Docker was first released in 2013, it has been fast evolving into a full-blown […]
Continue reading…

 

How to access a NAT guest from host with VirtualBox

Question: I have a guest VM running on VirtualBox, which uses NAT networking. So the guest VM is getting a private IP address (10.x.x.x) assigned by VirtualBox. If I want to SSH to the guest VM from the host machine, how can I do that? VirtualBox supports several networking options for guest VMs, one of […]
Continue reading…

 

How to fix “hda-duplex not supported in this QEMU binary”

Question: When I try to install Linux on a new VM in virt-manager, the VM fails to boot with the following error: “unsupported configuration: hda-duplex not supported in this QEMU binary.” How can I fix this error? The cause for this VM error may originate from a qemu bug where a configured default sound card […]
Continue reading…

 

How to change default location of libvirt VM images

Question: I am using libvirt and virt-manager to create VMs on my Linux system. I noticed that the VM images are stored in /var/lib/libvirt/images directory. Is there a way to change the default location of VM image directory to something else? libvirt and its GUI front-end virt-manager can create and manage VMs using different hypervisors […]
Continue reading…

 

How to enable SR-IOV virtual function on Intel ixgbe NIC

Question: I want to create virtual functions on an Intel ixgbe NIC port. How can I enable SR-IOV virtual function on an ixgbe NIC interface? SR-IOV is a technology which allows a single PCIe (PCI Express) device to emulate multiple separate PCIe devices. The emulated PCIe functions are called “virtual functions” (VFs), while the original […]
Continue reading…