Home Cockpit Manage KVM Virtual Machines Using Cockpit Web Console

Manage KVM Virtual Machines Using Cockpit Web Console

By sk
Published: Last Updated on 57.3K views

Cockpit doesn't require any introduction. If you are a Linux admin, you should've definitely used it or at least heard about it. Cockpit is a free, open source web-based server administration tool used to monitor and administer Linux servers via a web browser. In this guide, we will see how to manage KVM virtual machines using Cockpit web console interface.


Obviously, you should have installed KVM in your Linux server. The following guides explains how to install and configure KVM in CentOS 8, Ubuntu 20.04 LTS server and openSUSE Tumbleweed editions.

Next, you need to install Cockpit on your KVM host. Refer the following guide to install and configure Cockpit on different Linux distros.

Make sure you have installed cockpit-machines package, which gives the ability to manage VMs via a web browser.

Optionally, you can install Virt-viewer application if you want the ability to open a graphical console in your remote desktop client. Virt-viewer is available for most operating systems.

To install virt-viewer on RHEL, CentOS, run:

$ sudo yum install virt-viewer

On Fedora:

$ sudo dnf install virt-viewer

On Ubuntu, Debian:

$ sudo apt-get install virt-viewer

1. Manage KVM Virtual Machines Using Cockpit Web Console

1. Open your web browser and log in to Cockpit console by navigating to http://IP-address:9090 from the address bar.

Log in to Cockpit web console
Log in to Cockpit web console

In CentOS 8 system, the Cockpit login console should look like below:

Cockpit login console in CentOS 8
Cockpit login screen in CentOS 8

2. You should now see a tab named "Virtual Machines" on the left pane. Click on it to view the list of available Kvm guest systems on the right side.

Manage kvm virtual machines using cockpit web console
Manage kvm virtual machines using cockpit web console

3. From here, we can manage all virtual machine management tasks such as,

  • View the list of available virtual machines,
  • View the details of a virtual machine,
  • Edit the virtual machine parameters such as memory, disk and network interfaces etc.,
  • Create a new VM,
  • Import a VM,
  • Run a VM,
  • Delete a VM,
  • View storage pools,
  • Create a new network pool,
  • Edit storage pools,
  • View KVM default virtual networks,
  • Edit networks,
  • Create a new virtual network etc.

1.1. Create a new KVM virtual machine

1.1.1. To create a kvm guest, click on the "Create VM" button in the Virtual machines section.

Create new kvm virtual machine from cockpit
Create new kvm virtual machine from cockpit

1.1.2. Fill up the the virtual machine details:

Enter virtual machine details
Enter virtual machine details
  • Name - Virtual machine name, for example Archlinux,
  • Installation type - I already have the ISO image of the Arch linux OS, so choose Local Install Media. If you don't have ISO, choose download ISO option. The appropriate ISO will be downloaded.
  • Operating System - The actual operating system type that you want to install on your kvm guest. Pick the OS you want to install from the drop-down list.
  • Storage - Choose the disk storage (hard drive) for your guest. I don't have any existing hdd, so I choose "Create New Volume" option from the drop down list. Enter the size of your hdd or use the slider to select disk volume size.
  • Memory - Choose the RAM size for your guest.

The last two are optional. I am going to uncheck these options, because I don't want to start the guest OS installation immediately. Once you entered all required details, click on "Create VM" at the bottom.

1.1.3 You will now see the overview of your new VM. Make sure all the selected parameters are correct.

Overview of a new kvm virtual machine
Overview of a new kvm virtual machine

1.1.4. Apart from the overview tab, there are a few other tabs exists:

  • Usage - Shows the usage details memory and vCPU of a running VM.
  • Disks - Shows the list of attached disk and cdrom details. In this tab, we can edit the disk, cdrom parameters, add new disk and delete the existing drives.
  • Network Interfaces - Shows the network card interface details. In this tab, we we can create a new network interface, edit the exiting network card and unplug the attached network card etc.
  • Consoles - In this section, we can choose different ways to access a console on the VM such as,
    • using the web-based Graphics Console (VNC),
    • the Graphics Console in Desktop Viewer (which uses virt-viewer),
    • or the Serial Console.

1.1.5. The only setting you might probably want to configure mostly is the network settings. By default, KVM chooses its default network. If you want to access the VM from other remote hosts outside the network, you need to choose the bridged network (br0).

To do so, go to "Network Interfaces" tab and click "Edit" button:

Edit virtual machine network settings in Cockpit console
Edit virtual machine network settings in Cockpit console

1.1.6. Select the Interface Type as "Bridge To LAN" Or "Direct attachment" and choose Source as "br0". You can also choose your KVM host's physical network interface, for example enp0s3. Finally click Save.

Select bridge networking for Kvm virtual machines in Cockpit
Select bridge networking for Kvm virtual machines in Cockpit

1.1.7. Now start the guest OS installation by clicking on the "Install" button.

Start Guest OS installation on Kvm host via Cockpit
Start Guest OS installation on Kvm host via Cockpit

1.1.8. Once you clicked the Install button, you will be taken to the the guess OS installation window shown under the "Consoles" section in the Cockpit interface. Make sure you have chosen "Graphics Console (VNC)" as your Console type.

Installing OS on Kvm guest via Cockpit
Installing OS on Kvm guest via Cockpit

Now continue the guest OS installation as usual.

1.1.9. You can also access the guest machines using any VNC applications as described under "Access Virtual machines from remote systems via VNC client" section in the Kvm installation guide linked above.

1.2. Import VMs

To import VMs via Cockpit, click on the "Import VM" option under the "Virtual Machines" tab. Enter the name to the VM, choose the existing disk image location on the host's file system, select the operating system type and memory size. Finally, click Import button.

Import virtual machines via Cockpit
Import virtual machines via Cockpit

1.3. Restart / Pause/ Shutdown Kvm guests

No need to memorize the virsh commands. We can reboot, suspend and power off KVM virtual machines right from the Cockpit interface.

Restart Kvm guests via Cockpit
Restart Kvm guests via Cockpit

1.4. Configure KVM storage pools

On the top of the Virtual Machines section, you will see the following two sub-sections:

  1. Storage pools
  2. Networks

In the Storage pools section, we configure the storage path of all virtual machines. By default, all the virtual machine's disk files are stored under /var/lib/libvirt/images location.

You can create a new storage pool in anywhere in the file system. A storage pool's type can be a;

  • Filesystem directory,
  • Network file system,
  • iSCSI target / iSCSI directory target,
  • Physical disk device,
  • LVM volume group.
KVM storage pools in Cockpit
KVM storage pools in Cockpit

As you can see, I have created two storage pools. Click on a pool to view its details. If you don't need a storage, either deactivate it temporarily or completely delete it.

1.5. Configure KVM virtual networks

By default KVM creates a private virtual bridge named virbr0 to let all VMs to connect with one another, within the host computer.

The kvm default bridge provides its own subnet and DHCP to configure the guest’s network and uses NAT to access the host network.

You can configure as many virtual networks as you want. I already have configured a bridge network to allow a kvm guests to use same IP range of the host system.

Configure KVM networks in Cockpit
Configure KVM networks in Cockpit

Under Networks section, we can,

  • view the IP address details of a network,
  • create a new virtual network,
  • deactivate a network,
  • and delete a network.


In this guide, we have discussed how to manage KVM virtual machines using Cockpit web console. As you can see, Managing Kvm guests via Cockpit is very easy! No need to memorize the commands.

Cockpit has simple web interface that allows us to do basic KVM management operations from a web browser with a couple mouse clicks.

You May Also Like


Jalal July 7, 2020 - 7:18 pm

Thanks a lot
Good & useful article

Christoph July 11, 2020 - 6:37 pm

Thanks for the detailed explanations! I’m having difficulties with the bidged network mode, though. You state that I should ” “choose Source as ‘br0′”, but I don’t have br0 as an option in the source dropdown menu. I suppose the bridge has to be created first. But how do I create a bridge in Cockpit?

sk July 11, 2020 - 7:08 pm

You don’t have to choose bridge network unless you want to access the VM from remote systems other than the KVM host. Just leave the defaults and create VM as usual. If you still want to create bridge network, I have documented the steps to create bridge networking in the first article of this series here-> https://ostechnix.com/install-and-configure-kvm-in-ubuntu-20-04-headless-server/

kinghat December 15, 2021 - 5:46 am

thanks for the guides! ive been down the ? hole on this stuff for sure. why remove the default network created by libvirt, virbr0? couldnt you keep that and still add br0 and select that for vms you want to expose without conflict with the default interface? you would have both to choose from in case you wanted to keep some vms local.

Christoph July 11, 2020 - 7:19 pm

Thanks for the super fast reply! Okay, so you have to create the bridge outside of cockpit.

My assumption was that cockpit provides a ui that lets you do manage your vms through a gui. I don’t quite understand how they can offer an option “Bridge to LAN” when you can’t use it without creating the bridge outside of Cockpit. Maybe I’m asking too much, but this kind of pitfall should at least be documented in the ui…

Thanks again for your excellent tutorial!

sk July 11, 2020 - 9:22 pm

Yes, you need to configure KVM bridge outside of Cockpit.

JC December 1, 2020 - 1:23 am

Thanks, this was great and easy to follow along to.

vletroye December 13, 2020 - 2:19 pm

Hi… after many researches to find good Tutos about virtualization with Raspberry Pi, I finally found your site. It’s really helpful (straightforward guides).

I did first install 2 Raspberry Pi with KVM on Ubuntu 20.04 LTS aarch64, using your article “install-and-configure-kvm-in-ubuntu-20-04-headless-server”.

Then I did install Cockpit on one RPI. But now, I am wondering how I could manage the VM on my 2 RPI from a central console. Cockpit is indeed apparently only to manage the local KVM.

I read your article to use the Virt Manager (“how-to-manage-kvm-virtual-machines-with-virt-manager”), but it’s a Fat UI. Could you recommend a solution with Web UI which can run on a RPI ?

I see on your site an article about proxmox (“setup-server-virtualization-environment-using-proxmox-ve”), but is seems that it’s not yet available for ARM hardware…

10.000 Thanks !!!

sk December 14, 2020 - 10:58 am

Install Cockpit on 2nd RPi and manage it from anywhere.

vletroye December 21, 2020 - 4:34 am

Thx… Indeed it’s that simple… Now, in the Dashboard I can pick the other RPI.

Marlo July 2, 2021 - 9:39 pm

If someone already has KVM installed and running VMs what happens if I install cockpit afterwards

sk July 2, 2021 - 9:51 pm

Nothing. It will work just fine. Cockpit is just a web-based tool to manage VMs.


Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More