Score:0

How to make KVM guest configs persistent across reboots/shutdown

hu flag

I create a KVM Guest VM (virsh define a.xml, virsh start a.xml). Guest uses pre-configured/pre-made QCOW2 disk image, which represents a virtual router (Arista vEOS). Host is Redhat 9.1. Guest is based on Centos 7.9. The VM uses a boot loader (Aboot) in a cdrom. The guest has two environments where one can configure it: Bash Shell as well as "Arista CLI".

I use bash to make changes to the system: adduser; add,partition,format,mount disk; install libraries (gcc, glibc ...etc) .... Problem is, I lose all of these config changes when I do "shutdown" via bash from within the guest or when I do "virsh shutdown guest" from the kvm host.

How do I make these extra configurations persistent even after shutting down the guest?

I wonder if these configs have something to do with it: <on_poweroff>destroy</on_poweroff> ,,, <on_reboot>restart</on_reboot> ,,, <on_crash>restart</on_crash>

Spooler avatar
us flag
This problem is not related to virtualization, and is a side-effect of how the operating system is handling initialization (it's likely using a read-only image for root and persisting changes in memory only). You should ask this question in the specific context of vEOS. In general, you'll have to attach a second disk and mount it during or after boot. I don't know the specifics of vEOS.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.