Accidentally Deleted VM conf file

dullpointer

New Member
Nov 2, 2023
3
0
1
I'm having trouble locating exactly how to go about resolving this. I accidentally ran rm instead of cp on the .conf file for a VM, and promptly lost any ability to access it. Of course, I don't have any snapshots of the VM, but I would like to get it set back up with the same data. I assume rebuilding the VM per se is overly complicated with unknown unique ID's and so forth, but I was thinking that I could spin up a new VM with the same OS, and attach the old VM disk to it without much trouble. Is this the best way to go about this, or is there a better one? Assuming this is relatively straightforward, could someone let me know what steps I need to take? I tried to find a resource on it going through the documentation and forums, but I'm having a hard time locating the file on directory, and making sure I'm renaming it, and reconfiguring the new vm .conf file correctly from the CLI. Thanks!
 
Recreate the .conf file from memory or a backup. Maybe create a new similar VM to look for an example file or look at another VM's conf file for inspiration. The exact unique IDs (for as far as they exist in the .conf file) usually don't matter much.
 
I accidentally ran rm
Only if the "source"-VM is still running (and it does until you stop it): you can see the parameters and options used via ps auxwww.

It still is difficult to rebuild a <vmid>.conf manually, but you could see and verify several elements this way...

Good luck
 
  • Like
Reactions: leesteken