SOLVED XML Edits Won't Stick

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
SayWhat
Level 2
Level 2
Posts: 89
Joined: Sat Oct 14, 2023 6:27 pm

SOLVED XML Edits Won't Stick

Post by SayWhat »

I'm trying to figure out a problem with one VM (may ask about that later), so was checking that VM's xml file in virt-manager's editor.

Looking at the xml of the troublesome vm, I see some changes I made aren't in there. Simplest example is 1st line starts out with
<domain type="kvm">
Which I've replaced, but has now reverted to the original (the line above being the original).

So I've pasted in the desired line, hit apply, and it immediately reverts to the line above.

Anyone know how that can happen and how to fix it?
Last edited by SayWhat on Tue Jan 16, 2024 9:55 pm, edited 1 time in total.
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: XML Edits Won't Stick

Post by powerhouse »

virt-manager does some checking and it may revert changes that it doesn't see correct (or doesn't support). Also make sure you use the correct syntax for the entry.

You can directly edit the configuration using the following command line:

Code: Select all

sudo virsh edit vm_name
Unfortunately that will open the xml in your system's default text editor, usually vi or vim. Unless you are familiar with them, you better learn the basics before editing the file. It's not too difficult.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
SayWhat
Level 2
Level 2
Posts: 89
Joined: Sat Oct 14, 2023 6:27 pm

Re: XML Edits Won't Stick

Post by SayWhat »

Ah, interesting.

I'm just copy/pasting like all the other passthrough vm's I've done (many, while fumbling through the learning curve), but maybe there's something down further in the xml it doesn't like.

I'll just make another from scratch and see if it recurs. If not, write off the weird one as likely a typo.
powerhouse
Level 6
Level 6
Posts: 1144
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: XML Edits Won't Stick

Post by powerhouse »

virt-manager has a "clone" function. Right-click on an existing VM and select "clone". I haven't used it for a long time, but it was helpful when creating 4 Ubuntu server VMs used as "workers" for some Kubernetes exercises.

You need to have different UUIDs for each VM, too.
If you have a bridged network, make sure to change the network MAC addresses under NIC.
Subjects of interest: Linux, vfio passthrough virtualization, photography
See my blog on virtualization, including tutorials: https://www.heiko-sieger.info/category/ ... alization/
Post Reply

Return to “Virtual Machines”