Skip to main content

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