[Solved] linux system reinstallation: Keeping VM's settings

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

[Solved] linux system reinstallation: Keeping VM's settings

Post by Plagrö »

Hello,

I must install root new on linux. But I can keep my home folder on my separate home partition.
As I have already made two VM's my question is:
What can I do to keep this VM's. I mean not the virtual drives. I can keep them anywhere. I meen the two VM's in VirtualBox with all settings.

Is there an easy way to do that?
Maybe save any folder from /etc ?

Thank you.
Last edited by Plagrö on 19. Mar 2020, 18:06, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: linux system reinstallation: Keeping VM's settings

Post by scottgus1 »

If you wish to reinstall the host PC's operating system, you can copy the guest VMs' folders to another drive then copy them back.

See Moving a VM and think of it as "Backing Up a VM".

Usually the guest folder contains a .vbox file, a .vbox-prev file, the guest virtual drive file(s), and Logs and Snapshots subfolders. If your guest's virtual disk file(s) are in the guest folder along with the .vbox file, then copy that whole guest folder to backup media (confirm the copies with an 'FC' to be sure). When you get the new OS installed, copy the guest folder back to the main disk and register the guest's .vbox file with Virutalbox. Your guest should start just fine.

If your guest's virtual disk file(s) are NOT in the guest folder along with the .vbox file, then things are more complicated. Your guest's .vbox file has absolute paths to your guest's disk file(s), and these paths have to be restored exactly when the new host PC OS is installed. Copy the guest folder, and the guest's virtual drive files to backup media. Take note of the path to each virtual drive file. When the host OS is finished, copy the guest folder back. Remake the path to each virtual disk file, then copy the disk files back to their exact paths. Register the guest. Assuming everything is back where it was, the guest should boot.

There is also a global Virtualbox configuration file in your home folder/.config/Virtualbox/Virtualbox.XML This file contains the settings in the File Menu, Preferences settings, as well as NAT Network & Host-Only network configurations. If you have anything you specially set up, copy this file too. When you get Virtualbox installed again, copy this backed up Virtualbox.XML back into /.config/Virtualbox. Be sure no Virtualbox processes, windows, guests, or services are running. A host reboot is often suitable to set up a no-Virtualbox-anything state for this file to be copied back. If you have not registered any guests yet, and all of your restored guests are back where they were before, this file should have everything back to normal without need to re-register any guests. If you do not have any special setups in Virtualbox.XML you can use the new clean copy and just register your guests.
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

Re: linux system reinstallation: Keeping VM's settings

Post by Plagrö »

Thank you for this amazing detailed description. I will try.
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

Re: linux system reinstallation: Keeping VM's settings

Post by Plagrö »

I was successful.
I had nothing to do. Was just there again.
Post Reply