Friday, December 27, 2024
Google search engine
HomeGuest BlogsRun Debian 11 (Bullseye) on OpenStack / KVM

Run Debian 11 (Bullseye) on OpenStack / KVM

Debian 11 (Bullseye) was officially released for general use on 14 Aug 2021, after 2 years of hard work and commitment to its development. The Debian 11 stable release has code name bullseye. This release will be supported for the next 5 years by the Debian Security team and the Debian Long Term Support team. It ships with many new and improved features that provides better stability and security of the operating system. As a Debian user you’ll enjoy numerous updated software packages (over 72% of all packages in the previous release).

Debian 11 (Bullseye) ships with a Linux kernel that has support for the exFAT filesystem and defaults to using it for mount exFAT filesystems. It also contains over 11,294 new packages and several desktop applications and environments, namely:

  • KDE Plasma 5.20
  • Xfce 4.16
  • LXQt 0.16
  • Gnome 3.38
  • LXDE 11
  • MATE 1.24

You can get more information about Debian 11 (Bullseye) release on the official Debian website. In this article, we will be focused on how a user can create Debian 11 Virtual Machine on both KVM and OpenStack Virtualization environments. The easiest and quickest of the two is OpenStack, as you use readily available Cloud images to create a running instance.

For KVM Hypervisor installation, we will create a Debian 11(Bullseye) Virtual Machine through installation from DVD or CD image file.

How To Run Debian 11 (Bullseye) on OpenStack

OpenStack is an free to use and open source cloud computing infrastructure platform that unifies the administration of Compute, Network and Storage resources to build and manage private and public clouds. The OpenStack project has support through contributions and finances from large companies such as AT&T, Huawei, Red Hat, Microsoft, Cisco, Intel, VMware, Dell, among many other companies.

For you to run Debian 11 (Bullseye) onOpenStack, you must meet the following requirements:

  • Have a working OpenStack Cloud Platform
  • Access to OpenStack Platform from Horizon Web UI Dashboard or openstack command line tool
  • Configured Compute Node, Network and Storage backend(Cinder or Ephemeral storage)
  • Configured Glance service where we will store Debian 11 cloud template
  • Uploaded SSH Key pair
  • Security group has to be created before instance
  • Created Compute flavors

Step 1 – Download Debian 11 Cloud image

The simplest way to get a virtual machine image for OpenStack Platform is to download pre-created ones. The default Debian Cloud image contain the cloud-init package that enables SSH key pair and user data injection.

Let’s download the latest Debian 11(Bullseye) Cloud image from the URL manually, or with wget/curl tools:

wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2

You can as well use Debian 11 Genericcloud image:

wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2

Step 2: Upload OS image to Glance

Next we upload downloaded Debian 11 Cloud image to Glance. This is the command I’ll run to push the image to Glance storage backend

openstack image create \
    --container-format bare \
    --disk-format qcow2 \
    --property hw_disk_bus=scsi \
    --property hw_scsi_model=virtio-scsi \
    --property os_type=linux \
    --property os_distro=debian \
    --property os_admin_user=debian \
    --public \
    --file debian-11-generic-amd64.qcow2 \
    debian-11

Give it a few seconds for the image to be active and available on Glance service.

$ openstack image list
+--------------------------------------+-----------------+--------+
| ID                                   | Name            | Status |
+--------------------------------------+-----------------+--------+
| 3193094d-3e5b-4abe-a2fa-875c5ef615f7 | Arch-Linux      | active |
| c7e795e9-c002-400c-90a1-bfcdc82d0bfc | Ubuntu-20.04    | active |
| 448ff933-c695-4eea-b312-c4aee1bb569f | debian-11       | active |
+--------------------------------------+-----------------+--------+

Step 3: Get Network, Flavor, Security group, andkeypair

We should have the following details before creation of a Debian 11 VM instance on OpenStack

  • Glance Image ID / name
  • Neutron network ID / name
  • Compute flavor ID / Name
  • Security group ID / Name
  • Keypair name

Use the commands provided in this section to get the required information from your OpenStack Cloud Platform. For any, not configured you’ll have to fix it before you can proceed with the guide.

List networks:

$ openstack network list
+--------------------------------------+---------+--------------------------------------+
| ID                                   | Name    | Subnets                              |
+--------------------------------------+---------+--------------------------------------+
| 34baac2e-2393-4607-b1c9-2d7044d40978 | private | 48789ed8-d7b7-4606-8ed8-0f1036312463 |
| 8fb37281-9c89-4110-ac84-44179011767d | public  | 23357ddf-d536-49d4-81e6-f80f6c4d2434 |
+--------------------------------------+---------+--------------------------------------+

List compute flavors:

$ openstack flavor list
+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name      |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| 0  | m1.tiny   |   512 |    5 |         0 |     1 | True      |
| 1  | m1.small  |  1024 |   10 |         0 |     1 | True      |
| 2  | m1.medium |  2048 |   20 |         0 |     2 | True      |
| 3  | m1.large  |  4096 |   30 |         0 |     2 | True      |
| 4  | m1.xlarge |  8192 |   40 |         0 |     4 | True      |
| 5  | m1.jumbo  | 16384 |   50 |         0 |     6 | True      |
| 7  | m1.16     | 16384 |   40 |         0 |     4 | True      |
+----+-----------+-------+------+-----------+-------+-----------+

List configured Security groups:

$ openstack security group list
+--------------------------------------+------------+------------------------+----------------------------------+------+
| ID                                   | Name       | Description            | Project                          | Tags |
+--------------------------------------+------------+------------------------+----------------------------------+------+
| 2cc466c8-56a9-4540-bacb-9fcba39f6079 | default    | Default security group | d87ec405cf8d409cb351e8a5a966aa3d | []   |
| b9348b10-e183-41ad-b1a6-ab15c4a3cf99 | permit_all | Allow all ports        | d87ec405cf8d409cb351e8a5a966aa3d | []   |
| ca6aee3a-53c6-4ce0-a2c4-d2d39532556a | default    | Default security group | 3109267d83094ae1a9f2bf165b48bed0 | []   |
+--------------------------------------+------------+------------------------+----------------------------------+------+

List keypairs on OpenStack:

$ openstack keypair list
+---------+-------------------------------------------------+------+
| Name    | Fingerprint                                     | Type |
+---------+-------------------------------------------------+------+
| admin   | 19:7b:5c:14:a2:21:7a:a3:dd:56:c6:e4:3a:22:e8:3f | ssh  |
| jmutai  | 19:7b:5c:14:a2:21:7a:a3:dd:56:c6:e4:3a:22:e8:3f | ssh  |
+---------+-------------------------------------------------+------+

Step 4: Create Debian 11 (Bullseye) VM instance on OpenStack

I’ve gathered below facts that will be used to create an instance off Debian 11 cloud image:

  • Compute flavor – m1.medium
  • Glance Image name – debian-11
  • Network name – private
  • Keypair name – admin
  • Security group name – permit_all
  • VM to be created name – debian-bullseye-01

The command to create the Virtual Machine with above variables will be:

openstack server create \
  	--flavor m1.medium \
 	--image "debian-11" \
  	--network private \
  	--key-name admin \
  	--security-group permit_all \
  	debian-bullseye-01

The scheduling and build process starts immediately and you should get an output similar to one shared below.

+-------------------------------------+--------------------------------------------------+
| Field                               | Value                                            |
+-------------------------------------+--------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                           |
| OS-EXT-AZ:availability_zone         |                                                  |
| OS-EXT-SRV-ATTR:host                | None                                             |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                             |
| OS-EXT-SRV-ATTR:instance_name       |                                                  |
| OS-EXT-STS:power_state              | NOSTATE                                          |
| OS-EXT-STS:task_state               | scheduling                                       |
| OS-EXT-STS:vm_state                 | building                                         |
| OS-SRV-USG:launched_at              | None                                             |
| OS-SRV-USG:terminated_at            | None                                             |
| accessIPv4                          |                                                  |
| accessIPv6                          |                                                  |
| addresses                           |                                                  |
| adminPass                           | 3K2g2mSbRN3U                                     |
| config_drive                        |                                                  |
| created                             | 2021-08-15T21:14:36Z                             |
| flavor                              | m1.medium (2)                                    |
| hostId                              |                                                  |
| id                                  | 50a6d57f-c8ad-4299-b9dc-2bb697c03bdd             |
| image                               | debian-11 (448ff933-c695-4eea-b312-c4aee1bb569f) |
| key_name                            | admin                                            |
| name                                | debian-bullseye-01                               |
| progress                            | 0                                                |
| project_id                          | d87ec405cf8d409cb351e8a5a966aa3d                 |
| properties                          |                                                  |
| security_groups                     | name='b9348b10-e183-41ad-b1a6-ab15c4a3cf99'      |
| status                              | BUILD                                            |
| updated                             | 2021-08-15T21:14:36Z                             |
| user_id                             | a4cf64e81be5456b81af0f05b33707eb                 |
| volumes_attached                    |                                                  |
+-------------------------------------+--------------------------------------------------+

After the VM is in Active state confirm with below commands:

$ openstack server list --column Name --column Status --column Networks
+--------------------+--------+--------------------------------------+
| Name               | Status | Networks                             |
+--------------------+--------+--------------------------------------+
| debian-bullseye-01 | ACTIVE | private=172.10.10.149                |
+--------------------+--------+--------------------------------------+

Step 5: Connect to VM instance created

The default login username for OpenStack Debian cloud image is debian

Test ssh connection to the virtual machine:

$ ssh debian@172.10.10.149 
Warning: Permanently added '172.10.10.149 ' (ED25519) to the list of known hosts.
Enter passphrase for key '/Users/kmutai/.ssh/id_rsa':
Linux debian-bullseye-01 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian@debian-bullseye-01:~$

Check OS release release details from /etc/os-release file.

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Update and Upgrade your Debian instance by running the commands:

sudo apt update
sudo apt upgrade -y

To this far you should have a running Instance of Debian 11 (Bullseye) on OpenStack. In case of technical issues/errors, feel free to contact us through the comments sections.

How To Run Debian 11 (Bullseye) on KVM

For KVM you should have below pre-reqs met:

  • KVM hypervisor installed and configured
  • Configured Linux / OVS Bridge
  • Configured Libivirt Storage pool
  • Virsh command line tool

Step 1: Confirm all pre-reqs are okay

Check libivrtd service status:

$ systemctl status libvirtd
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-09-27 00:41:00 EAT; 1 months 13 days ago
     Docs: man:libvirtd(8)
           https://libvirt.org
 Main PID: 521154 (libvirtd)
    Tasks: 26 (limit: 32768)
   Memory: 138.2M
   CGroup: /system.slice/libvirtd.service
....

List Linux / OVS bridges configured on the system if any:

$ brctl show
bridge name	bridge id		STP enabled	interfaces
private01		8000.5254000b0e1d	yes		private01-nic
							vnet0
							vnet25
							vnet32
							vnet33
							vnet35
							vnet36
							vnet37
							vnet38
							vnet39
							vnet54
							vnet57
							vnet58
storage		8000.52540058dd87	yes		storage-nic
							vnet26
virbr0		8000.525400021ab5	yes		virbr0-nic
virbr1		8000.525400c6803a	yes		virbr1-nic

List KVM Storage pools

$ sudo virsh pool-list
 Name     State    Autostart
------------------------------
 images   active   yes

Step 2: Download Debian 11 DVD / CD ISO image

Visit Debian DVD and CD Downloads image URL.

wget https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-11.1.0-amd64-DVD-1.iso
sudo mv debian-11.1.0-amd64-DVD-1.iso /var/lib/libvirt/images

Create Debian 11(Bullseye) Virtual Machine on KVM

For Linux Bridge Networking:

sudo virt-install \
--name debian-bullseye \
--ram 2096 \
--disk path=/var/lib/libvirt/images/debian-bullseye.qcow2,size=40 \
--vcpus 2 \
--os-variant debian10 \
--network bridge=virbr0 \
--graphics none \
--console pty,target_type=serial \
--location /var/lib/libvirt/images/debian-11.1.0-amd64-DVD-1.iso \
--extra-args 'console=ttyS0,115200n8 serial' 

For Open vSwitch Bridge Networking:

sudo virt-install \
--name debian-bullseye \
--ram 2096 \
--disk path=/var/lib/libvirt/images/debian-bullseye.qcow2,size=40 \
--vcpus 2 \
--os-variant debian10 \
--network=bridge:private01,model=virtio,virtualport_type=openvswitch \
--graphics none \
--console pty,target_type=serial \
--location /var/lib/libvirt/images/debian-11.1.0-amd64-DVD-1.iso \
--extra-args 'console=ttyS0,115200n8 serial' 

A VM will be created with:

  • Name – debian-bullseye
  • Memory – 2GB
  • VCPUs – 2
  • Hard disk – 40GB
  • Bridge name – virtbr0 for Linux bridge and private01 for OVS bridge
  • DVD ISO file Path – /var/lib/libvirt/images/debian-11.1.0-amd64-DVD-1.iso

The installation process of Debian 11 on KVM should now begin.

Starting install...
Retrieving file vmlinuz...                                                                                                                                                     | 6.5 MB  00:00:00
Retrieving file initrd.gz...                                                                                                                                                   |  17 MB  00:00:00
Allocating 'debian-bullseye.qcow2'                                                                                                                                             |  40 GB  00:00:00
Connected to domain debian-bullseye
Escape character is ^]
[    0.000000] Linux version 5.10.0-9-amd64 ([email protected]) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.70-1 (2021-09-30)
[    0.000000] Command line: console=ttyS0,115200n8 serial
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[    0.000000] BIOS-provided physical RAM map:
....

Follow installation process to completion to have a running instance of Debian 11 on KVM.

Set Language to be used during installation process.

install debian kvm 01

Set Continent and Country

install debian kvm 02 01
install debian kvm 02 02

Set Keymap to use

install debian kvm 03

Provide this system hostname. This can be changed later after the installation

install debian kvm 04

In the next installation step you’re required to set root password

install debian kvm 05

Create first non-root user account that can be used for administration

install debian kvm 07

Continue to set user’s password and choose partitioning scheme when at the disk partitioning step.

install debian kvm 11

Optionally choose to install desktop environment. For server installations you can skip this step by deselecting.

install debian kvm 19

Install bootloader to boot disk when asked to install Grub boot loader.

install debian kvm 21
install debian kvm 22

Once the installation of Debian 11(Bullseye) is completed you’re requested to reboot the system.

install debian kvm 24

After the reboot login with root or standard user account.

install debian kvm 25

Check OS version in /etc/os-release file to confirm it is Debian 11.

install debian kvm 26

If you’ve managed to come this far, congratulations!. I hope the guide helped you with the installation of Debian 11(Bullseye) on KVM and OpenStack Cloud Platforms. Also note it is possible to use created KVM OS Qcow2 disk image as template in OpenStack. But installation of cloud-init and other customizations to the OS are important before it can be used on OpenStack environment.

More guides on OpenStack / KVM:

RELATED ARTICLES

Most Popular

Recent Comments