Как восстановить виртуальную машину virtualbox
Перейти к содержимому

Как восстановить виртуальную машину virtualbox

  • автор:

Как восстановить виртуалку VirtualBox, если файл конфига побился?

Хостовая система Ubuntu 12.04. Закончилось место на диске, в итоге файл конфига побился (не смог весь сохраниться).

В итоге: файлы снапшотов и диск виртуальной машины целые. Но из-за битого конфига не получается её загрузить. Как восстановить виртуалку?

По этой теме нагуглил кое-чего (1, 2)

Скрипт из 2-й статьи ещё не пробовал. Есть ли другие пути, которые сведут шаманства к минимуму? Без необходимости вникать в файл конфига и что-то править самому (конфиг-файл сохранился наполовину)?

VirtualBox v 4.1.20

  • Вопрос задан более трёх лет назад
  • 14564 просмотра

Restoring a VirtualBox VM to a clean/default state?

I am playing around with Virtual Box and installed an Ubuntu 12.04 ISO on a my first VM. Now I want to «wipe» that VM clean and undo all the software I had installed on it. My co-worker said the easiest thing to do is to just re-install Ubuntu and overwrite everything. What’s the easiest way to do this with VBox? Should I just delete the whole VM and recreate it from scratch? It would be nice if I can just tell VBox «hey, take this VM, erase everything on it, and then replace it with this ISO» instead of having to delete the entire VM and create a new one. Is this possible? If so, how? If not, what’s my best remedy here? Thanks in advance!

23.5k 13 13 gold badges 86 86 silver badges 122 122 bronze badges
asked Jul 29, 2012 at 20:34
2,822 17 17 gold badges 53 53 silver badges 83 83 bronze badges

2 Answers 2

You seem to want to preserve the configurations for the virtual machine.

The easy way to accomplish this is obvious: detach the virtual disk image and replace it with a new one.

The configurations for the virtual machine remain in tact, but the stored data is gone.

How to recover Virtual Machines in Virtualbox?

For some reason, all of a sudden, all virtual machines are gone from the User Interface in virtual box. I suspect CCleaner has something to do with it, but that’s not the point. Both the virtual hardisks and the .xml files for the machines are still in their respective folders. How can I use them to get my virtual machines back into virtualbox? I tried simply creating a new machine from the old virtual hardisks, and it worked with the ubuntu guest, but not with the windows one. Plus, it’d be nice to get my old machines back instead of having to create new ones, that would keep me from having to fix some shortcuts as well as reconfigure shared folders and other stuff.

113k 19 19 gold badges 202 202 silver badges 268 268 bronze badges
asked Dec 8, 2009 at 3:42
8,648 21 21 gold badges 71 71 silver badges 105 105 bronze badges

8 Answers 8

Under File -> Preferences in VirtualBox, set your Default Machine & Hard Disk folder. VirtualBox should scan these folders on startup and add any machines found to the pane.

alt text

18.7k 15 15 gold badges 57 57 silver badges 69 69 bronze badges
answered Dec 8, 2009 at 4:16
164k 27 27 gold badges 344 344 silver badges 349 349 bronze badges

I’m sorry, that simply didn’t work. If I create a new machine, it will go to the folder I specified, right next to the old machines. But virtualbox still doesn’t look for the old ones. Even after a system reboot.

Dec 8, 2009 at 17:43

Might not be for everyone, but instantly solved my problem. OS: Ubuntu14.04, machine folder was mounted to /disk1

Mar 8, 2017 at 17:19

Solved it by manually editing virtualbox.xml file to include the old machine files, then added the hard drives through the User Interface, then modified the machine .xml files to point to the hardrive’s uuid.

In fact, the reason the machines were gone in the first place is that I accidentally deleted the virtualbox.xml file.

54.1k 20 20 gold badges 165 165 silver badges 213 213 bronze badges
answered Dec 9, 2009 at 5:32
8,648 21 21 gold badges 71 71 silver badges 105 105 bronze badges

I did not delete mine but they are now missing. Looks like I will have to rebuild manually. Why does VB not have a data recovery tool for this?

Aug 2, 2011 at 20:21

Open Oracle VM VirtualBox Manager and under Machine -> Add, point to each virtual machine file (.xml or .vbox) open and it will restore the machine back to the Manager dropdown list.

answered Dec 27, 2015 at 12:05
Fábio Antunes Fábio Antunes
171 1 1 silver badge 4 4 bronze badges

I woke up this morning to find the VirtualBox .vbox file of a guest that was running last night completely missing and VirtualBox telling me it was corrupted. Windows Update ran throughout the night and automatically rebooted my host.

Turns out I had a .vbox-temp version of the file still in the folder. I renamed it to .vbox and now my guest is back. Just FYI.

answered Mar 10, 2011 at 15:10
user23388 user23388

I solved it (windows host) by double-clicking on the .vbox file of my old guest machine. Simple as that.

answered Mar 6, 2015 at 12:21
141 3 3 bronze badges

This solves my issue. All my VMs and virtualbox.xml were still there, but for some reason VBoxManager was showing empty list. Thanks for this simple trick!

Apr 14, 2015 at 13:25

try this: create a new machine(s), then just overwrite the new .xml file(s) with the old one(s), which you still have.

edit: if you check the ‘machine folder date’, it may give you a hint when the machines were created and you may trace the version from the changelog at virtualbox.org (it shows the release date of the various versions).

the machine data files are usually stored in subfolders with the machine name in %user folder%\application data\.virtualbox\machines

answered Dec 8, 2009 at 4:09
Molly7244 Molly7244

As I said in the question, creating new machines with the old drives didn’t work for the windows client (the machine simply doesn’t boot). Plus it will force me to fix a bunch of shortcuts and reset the configuration for shared folders and other stuff.

Dec 8, 2009 at 17:47

is this still the same version of VBox that you have been using to create the virtual machines or did you receive an update recently? uninstall VirtualBox (backup your XML and VDI files) and install VirtualBox again, preferably the original version (you find older versions at Filehippo if you need the installer).

Dec 8, 2009 at 18:43

Hm. Indeed, it’s not the original version, maybe that’s it. Unfortunately I also have no idea what the original version was.

Dec 9, 2009 at 3:49

I want to describe another scenario that I just discovered.

I just upgraded VirtualBox for my Windows 7 host (to version 4.3.12r93733 ), running the installer program from another directory (using cygwin terminal) and let the installer start VirtualBox for me. I got worried as I saw my VirtualBox virtual machines having disappeared. When choosing «machine | Add» from the menu, I saw that the directory was not my $HOME directory but the directory where I run the installer (cygwin home directory). VirtualBox also had created .VirtualBox directory there.

When I quit VirtualBox and run it from the start menu I saw all my virtual machine definitions appear like expected, just like described in $/.VirtualBox/VirtualBox.xml .

It seems like VirtualBox expected current directory to be $ when it was started. (Or perhaps it is a feature to allow run independent set of VirtualBox instances.)

Справочная информация

При переустановке системы, сопровождаемой форматированием раздела жёсткого диска, содержащего системное и прикладное программное обеспечение, возникает вопрос о восстановлении ранее созданных в VitrualBox виртуальных машин. Для тех, кто активно использует это ПО вопрос не вызывает сложностей, но, как показал опыт, имеются и те, кто не имеет представления о том как это сделать буквально в несколько кликов мыши.

Описываемый ниже порядок применим лишь тогда, когда все файлы виртуальных машин были предварительно сохранены на другой раздел жёсткого диска или другой носитель информации.

Свежая установка ПО VirtuakBox не имеет в своём составе предустановленных виртуальных машин.

Перейдите в меню «Файл – Настройки» и посмотрите место хранения данных виртуальных машин в установленной VirtualBox. Как правило, эти данные располагаются в папке VirtualBox VMs (на рисунке ниже – Папка для машин по умолчанию), которая при свежей установке ПО VirtualBox отсутствует.

Если вами ранее была сохранена вся папка VirtualBox VMs, то перенесите её в место, определяемое настройками установленного VirtualBox. Если Ваши виртуальные машины были сохранены в другой папке, то сначала создайте папку VirtualBox, а затем перенесите в неё папки Ваших виртуальных машин, например:

Запустите Ваш VirtualBox VMs, в верхнем горизонтальном меню вызовите пункт «Машина» и в выпадающем списке выберите «Добавить». Убедитесь, что в в нижней правой части окна у Вас отображено «Файлы виртуальных машин»:

Перейдите в папку восстанавливаемой виртуальной машины и укажите файл с расширением vbox:

После этих действий Ваши виртуальные машины будут отображены в списке и готовы к запуску:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *