I have two VMs that will not stay saved. After every reboot they revert back to an older setting. I’ve tried everything I could find with Google with no solution. Does anyone know why Virsh refuses to save new settings? I am using this command to save the settings,
sudo virsh define Win10.xml
I have also tried undefining the VM and then defining with the above command. Also tried a
The config isn’t saved in the xml it is saved in a virsh file. The question did make me wonder if virsh was actually saving the changes in virsh so I checked and it is. I still don’t understand why it keeps getting reset. Maybe it has something to do with the service that monitors the system for unauthorized changes? I am not sure how to check that.
Perhaps I’m speaking out of ignorance, however any changes made on my pc with virsh or virt-manager are reflected in the xml files in the folder /etc/libvirt/qemu/
As far as I understand it, virsh grabs the configuration currently stored in memory, wich has been loaded from disk during libvirtd startup.
If it is the case that you are not authorized to make changes, I doubt you could have made those changes in the first place.
If the changes are stored on disk, than I can think of a (unlikely) scenario:
Any changes made with virsh are not persistent due to some configuration (A quick search doesn’t reveal such an option)
Yes, my virsh changes are reflected into the same folder. Authorization is not the problem. Maybe it has something to do with the type of changes I am making? I am assigning which CPUs the Guest OS can use. And I have the host constrained to only two CPUs.
I haven’t found anyway to make the changes stick. Other than this problem this system rocks. I run one gaming OS (Win 10) with 8 CPUs and one general purpose OS (Linux) with 4 CPUs, with the option to start a third OS for secure banking.
What distro are you running and what version of libvirtd is installed?
Just curious, after modifying the VM to your liking use sudo virsh dumpxml Win10 >> win10_up.xml to dump it out, then delete it and restart libvirtd, it should still be gone, then define it with the new XML and restart libvirtd again, does it stick or revert to some old config still?
I used undefine to remove all of the VMs but one. The Win10 VM is using nvram and doesn’t like being undefine without the --nvram flag. I didn’t do that since I am unsure what that flag may do to defining it again. However when I ran
virsh list -all
the only VM showing was Win10 as expected. After the libvirtd restart the two VMs I undefined where back.
Checking the Safe VM config showed it was restored to the old settings.
I had to do ‘sudo su’ to run dumpxml so that got me thinking that perhaps I didn’t have enough authority. So I repeated everything in the the root terminal and still the same results.
Just a random question, but you don’t have them on a RAM disk, or a temporary file system?
I ask because the settings reverting like that make it sound almost like it’s not saving out the changes, just reloading the store from an image each boot
I did some searching around and didn’t really find any similar topics about this, the only thing I came across that may be relevant is what editor you are using by default, I use vi. I made a change to my VM from virt-manager and the change was reflected on disk right away.
-rw------- 1 root root 9456 Jun 15 12:06 Windows10.xml
-rw------- 1 root root 9248 Jun 20 21:23 Windows10.xml
Maybe check with journalctl -f for any errors when you make a change, I’m not running an ubuntu based distro so could be something with AppArmor or something like that. Otherwise sorry I’m at a bit of a loss.
If it is stored on an SD, perhaps you have delayed write turned on. after making the change. run the sync command in a terminal. See if that makes a difference.