Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/guides/virtualization/cockpit-machines.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,50 @@ tags:
- virtualization
---

# Cockpit KVM Dashboard
# Cockpit KVM dashboard

## Introduction

Cockpit is a server administration tool which provides an easy-to-use dashboard to manage your server. One feature of Cockpit is that with a package, it can manage KVM virtual machines from a web interface similar to VMware ESXi or Proxmox.

## Prerequisites

* A Rocky Linux server with hardware virtualization enabled.
* Access to the Rocky Linux `dnf` repositories.
* A Rocky Linux server with hardware virtualization enabled
* Access to the Rocky Linux `dnf` repositories

## Installing Cockpit

Cockpit comes by default in Rocky Linux, however, KVM support doesn't come installed out-of-the-box. We'll install it via `dnf`:

```
```bash
dnf install -y cockpit-machine
```

We'll also install `libvirtd`:
Also install `libvirtd`:

```
```bash
dnf install -y libvirtd
```

## Enabling Cockpit
## Enabling `cockpit`

To actually enable both KVM virtualization and Cockpit, enable the systemd services:

```
```bash
systemctl enable --now libvirtd cockpit
```

After you enabled Cockpit, open a browser to http://X.X.X.X:9090 (note: replace X.X.X.X with the IP address of your server):
After you enabled `cockpit`, open a browser to http://ip_address:9090 (note: replace "ip_address" with the IP address of your server):

![Cockpit login screen](../images/cockpit_login.png)

Login as a non-root user and you should see a dashboard similar to the one below author's home server:
Login as a non-root user and you should see a dashboard similar to the one shown here:

![Cockpit dashboard](../images/cockpit_dashboard.png)

## Creating a virtual machine

In this guide, we'll create a Rocky Linux 9 virtual machine on our host system where we use automation to add a username and root password.
In this guide, you will create a Rocky Linux 9 virtual machine on your host system where you use automation to add a username and root password.

To create a virtual machine in Cockpit, first click on the blue **Turn on administrative access** button, and enter your password if needed:

Expand All @@ -74,11 +74,11 @@ Next, click on **Automation**, and fill in the login details you want on your ne

Finally, select **Create and run**.

In a few minutes, select your newly-created VM, we'll have its IP address:
In a few minutes, select your newly-created VM, you will have its IP address:

![Our VM's IP address](../images/cockpit_vm_ip.png)

SSH into your hypervisor, and subsequently SSH into the IP address from Cockpit. In our example, it's **172.20.0.103**. You'll be logged into your new server:
SSH into your hypervisor, and subsequently SSH into the IP address from Cockpit. In this example, it is **172.20.0.103**. You will be logged into your new server:

![Our VM's terminal](../images/cockpit_vm_terminal.png)

Expand All @@ -89,8 +89,8 @@ While Cockpit is great for creating and managing virtual machines, there are a f
* You cannot create a bridge interface.
* You cannot create a new image in any storage pool, only the `default` one.

Fortunately, these can be created using the command line, and subsequently be used via Cockpit.
Fortunately, these can be created using the command line, and subsequently used by way of Cockpit.

## Conclusion

Cockpit is an invaluable tool for managing a Rocky Linux server via a web interface. It is personally the author's go-to tool for creating virtual machines in their homelab. While `cockpit-machines` may not be as full-featured as ESXi or Proxmox, for 90% of hypervisor use cases, it gets the job done.
Cockpit is an invaluable tool for managing a Rocky Linux server via a web interface. It is personally the author's go-to tool for creating virtual machines in their home lab. While `cockpit-machines` may not be as full-featured as ESXi or Proxmox, for 90% of hypervisor use cases, it gets the job done.