Virtualization

Create Virtual Machines (VMs), clone, run, test, study and use them.

Oracle VirtualBox @Windows10Pro

Oracle VirtualBox @Windows10Pro

Cloning the machines and post-install for Oracle Linux v9

At the moment of writing, on 2025-07-18, my VirtualBox is v7.1.6.

Open VirtualBox, find the source machine, click once to select

It is possible to either use menu: Snapshot> Clone

Or click on [Clone] icon with a sheep:

Or right-click on virtual machine itself:

of press C-S-c (CTRL+SHIFT+c) or, from the list: C-o (CTRL+o)

Give machine a new name, check location and remember to choose "Generate new MAC for adapters". Your network infra will be happy to see healthy traffic and route it properly.

When machne is cloned, let's start it:

Post-cloning precedures

All commands executed in the elevated shell

sudo su

Change hostname

hostnamectl hostname lt58dox1

During cloning the machines, change physical ID and MAC address in the hypervisor (sometimes, it will not do it automatically in VirtualBox, proxmox and others).

When machines are cloned, 'machine ID':

cat /etc/machine-id
rm -f /etc/machine-id
systemd-machine-id-setup
systemd-machine-id-setup --commit --print

SSH server's keys need to be re-generated to be seen as different machines

rm -rf /etc/ssh/ssh_host_*
ssh-keygen -A
ls -la /etc/ssh/ssh_host_*

And finally perform reboot

shutdown -r now

As there will be new MAC assigned, check for new IP addresses:

ip -br a
Oracle VirtualBox @Windows10Pro

Adding more space to virtual machine by adding new disk and expanding using LVM

Daily task, which comes as daily routing, to extend the disk space:

Switch off the machine

Open VM properties in Oracle VirtualBox Manager, Storage,

Click [Create]

Name the disk accordingly to be consistent with other drives. Ensure that disk is saved nearby the VM itself. In my case, I am extending root partition for 50 GB.

After new disk is created, choose it double-clicking it.

Should end by seeing new disk in the virtual machine properties under 'Storage' list, attached to proper controller, 'SATA' - in my case.

Confirm with [OK]

Power on the machine

List disks with. New disk should be visible.

lsblk

Follow LVM Disk Extension guide to finalize extension.

Proxmox Virtual Environment (PVE)

Proxmox Virtual Environment (PVE)

Enabling no-subscription repositories

Preparations:

ping 34.88.77.33

and

curl myip.2dz.fi

On Debian v13 (trixie)

mv /etc/apt/sources.list.d/pve-enterprise.sources  /root

Create new file

nano /etc/apt/sources.list.d/pve-no-subscription.list 

repos

deb http://download.proxmox.com/debian/pve trixie pve-no-subscription

close editor

CTRL+X, y

Adjust Debian repos

nano /etc/apt/sources.list.d/debian.sources 

repos

Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

close editor

CTRL+X, y

Verify repositories declaration

apt policy

another one:

Do APT update

apt update

List packages ready for update, most important that there are new packages from PVE repo.

apt list --upgradable

Perform upgrade (when needed)

apt upgrade

Proxmox Virtual Environment (PVE)

Proxmox VE root pass reset (break the glass)

If you forgot the password, it is possible to change passowrd from the machine's console (physical access required):

Reset root password inside rescue shell:

Boot the server.

In GRUB find Proxmox VE GNU/Linux and press e to edit boot entry.

Config file will open, Find the line starting with linux (to load Linux kernel)

Add at the end of the that same line (not to the end of the file):

init=/bin/bash

Boot with

CTRL+X

Remount filesystem in read-write mode:

mount -o remount,rw /

Check the disk (optionally) to verify the disk is re-mounted:

df -hT

Change root's password:

passwd

Reboot

reboot -f

Login with new pass, usually to port 8006

https://nn.nn.nn.nn:8006/

and press [Login]

Change password (top-right, under username and 'Password')

Create admins user group

Create another admin user, add to admin user group created above

Define user's password

Add group permissions

Define permissions