Page 1 of 1
Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 01:49
by aydun
I have a VirtualBox VM running on Ubuntu 16.04. It has been running a long time and has been through multiple version upgrades. I found that there was a large snapshot so I attempted to delete it via the GUI, but the delete/merge failed and the VM aborted. It now does not boot since it can't find its disks.
The delete process seems to have corrupted the .vbox file which now does not have any reference to the vdi's. However, the media manager shows the vdi's as still attached to the VM.
How can I put things back together?
Attached are the log files and the box file.
Code: Select all
$ ls -lR .
.:
total 91861396
-rw------- 1 vbox vbox 85899677696 Jul 14 2014 DataStorage1.vdi
-rw------- 1 vbox vbox 8675 Mar 17 17:16 fileserver.vbox
-rw------- 1 vbox vbox 8674 Mar 17 17:16 fileserver.vbox-prev
-rw------- 1 vbox vbox 8166346752 Mar 17 16:38 fileserver.vdi
drwxr-xr-x 2 vbox vbox 4096 Mar 17 17:19 Logs
drwxr-xr-x 2 vbox vbox 4096 Mar 17 16:38 Snapshots
./Logs:
total 368
-rw------- 1 vbox vbox 103652 Mar 17 17:16 VBox.log
-rw------- 1 vbox vbox 83833 Mar 17 16:38 VBox.log.1
-rw------- 1 vbox vbox 109615 Mar 17 15:06 VBox.log.2
-rw------- 1 vbox vbox 71620 Feb 9 15:31 VBox.log.3
./Snapshots:
total 47990092
-rw------- 1 vbox vbox 49141846016 Mar 17 16:38 {b7002ea2-044a-424f-b019-def9e870c3c1}.vdi
Re: Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 10:57
by socratis
aydun wrote:It now does not boot since it can't find its disks.
To be accurate about it, it doesn't have
any hard disks attached, only the GAs CD (which it shouldn't).
aydun wrote:However, the media manager shows the vdi's as still attached to the VM.
Could you also attach the "
$HOME/.config/VirtualBox/VirtualBox.xml" file?
Re: Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 11:15
by aydun
As requested, VirtualBox.xml is attached. May not be relevant, but on my system that file is "$HOME/.VirtualBox/VirtualBox.xml" There is no "$HOME/.config/VirtualBox/"
Re: Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 11:22
by mpack
It's relevant in as much as it indicates a very obsolete (v3) folder structure. It seems that in the 6.3 years since v4.0.0 came out, you've never gotten around to properly updating the VirtualBox folder structure. Problems are bound to increase. I see remnants of a global media register in VirtualBox.xml - that must be an old VM. I assume the other VMs are younger.
Re: Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 12:20
by aydun
Yes, it's old but has had updates applied fairly regularly. I don't think we have ignored a "Now do XXX to your folder structure" type of message, but it's possible. What should we do to resolve that?
Various VM's have been created and destroyed - the 5 that currently exist are the ones in the MachineRegistry section of the xml, although 3 of them could probably be removed.
Any suggestions for how we fix the original problem?
Re: Deleting snapshot failed, not booting
Posted: 21. Mar 2017, 13:18
by mpack
VirtualBox tries to be backwards compatible: updating the software does not "update" your pre-existing data. It should all just work, but as time passes (e.g. 6.3 years) then the odds are that eventually your increasingly unexpected folder structure will cause a problem.
The only sure way to fix corrupted VMs is from a backup. Unfortunately that's easier said than done with a v3 folder structure which uses snapshots: that's precisely why the old folder structure was abandoned.
The surest way to recover a working VM is to put all the VDIs belong to the VM into one folder, identify the newest VDI, clone it using
CloneVDI, build a new VM around the clone, and never use snapshots again. If the links between snapshot elements has been corrupted then CloneVDI may reject it - you may have to experiment to find out what it will accept.
Also, asap, find out why any VM still needs a hdd to be registered in the global registry. Correct that VM, then delete the VirtualBox.xml file and let VirtualBox recreate it in the new format. Then
Machine|Add your VMs back.
Re: Deleting snapshot failed, not booting
Posted: 22. Mar 2017, 09:20
by socratis
All the points that mpack made are valid and you should attend to those old version files and structures.
In the meantime, and since the "fileserver.vbox" is using the >v4.0 style, quit all VBox* processes, rename/copy/move the "
/home/vbox/VirtualBox/Machines/fileserver/fileserver.vbox" file and create a new text file with that name in that location. Copy/paste the text below to that file:
Code: Select all
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.virtualbox.org/" version="1.11-linux">
<Machine uuid="{3221129e-d744-4ecc-99dd-57a0781265d6}" name="fileserver" OSType="Ubuntu" currentSnapshot="{e97671aa-c47f-48b9-8f9c-b8821f9f00e3}" snapshotFolder="Snapshots" lastStateChange="2017-03-17T17:16:20Z">
<MediaRegistry>
<HardDisks>
<HardDisk uuid="{7413a655-6aad-4f69-bb98-a4c6d7917647}" location="DataStorage1.vdi" format="VDI" type="Normal">
<HardDisk uuid="{b7002ea2-044a-424f-b019-def9e870c3c1}" location="Snapshots/{b7002ea2-044a-424f-b019-def9e870c3c1}.vdi" format="VDI"/>
</HardDisk>
</HardDisks>
</MediaRegistry>
<ExtraData>
<ExtraDataItem name="GUI/LastCloseAction" value="PowerOff"/>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="640,480"/>
<ExtraDataItem name="GUI/LastNormalWindowPosition" value="500,116,720,441"/>
<ExtraDataItem name="GUI/MiniToolBarAlignment" value="bottom"/>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
</ExtraData>
<Snapshot uuid="{e97671aa-c47f-48b9-8f9c-b8821f9f00e3}" name="2014/07/14" timeStamp="2014-07-14T10:09:44Z">
<Description>Pre host upgrade to 14.04</Description>
<Hardware>
<CPU>
<PAE enabled="false"/>
<HardwareVirtExLargePages enabled="false"/>
</CPU>
<Memory RAMSize="1024"/>
<HID Pointing="USBTablet"/>
<Display VRAMSize="12"/>
<RemoteDisplay>
<VRDEProperties>
<Property name="TCP/Ports" value="3390"/>
</VRDEProperties>
</RemoteDisplay>
<BIOS>
<IOAPIC enabled="true"/>
</BIOS>
<USBController enabled="true" enabledEhci="true"/>
<Network>
<Adapter slot="0" enabled="true" MACAddress="08002744EA23" cable="true" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<BridgedInterface name="eth0"/>
</Adapter>
<Adapter slot="1" enabled="true" MACAddress="080027F38481" cable="true" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<HostOnlyInterface name="vboxnet0"/>
</Adapter>
<Adapter slot="2" MACAddress="0800271BD00B" cable="true" type="82540EM"/>
<Adapter slot="3" MACAddress="080027CFE975" cable="true" type="82540EM"/>
<Adapter slot="4" MACAddress="080027795D75" cable="true" type="82540EM"/>
<Adapter slot="5" MACAddress="080027ED2560" cable="true" type="82540EM"/>
<Adapter slot="6" MACAddress="080027F1FA2D" cable="true" type="82540EM"/>
<Adapter slot="7" MACAddress="0800274F8695" cable="true" type="82540EM"/>
</Network>
<LPT>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter driver="ALSA" enabled="true"/>
<RTC localOrUTC="UTC"/>
<SharedFolders>
<SharedFolder name="os_data" hostPath="/data" writable="true" autoMount="false"/>
</SharedFolders>
<Clipboard mode="Bidirectional"/>
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestAdd/Revision" value="71778" timestamp="1310719422089962000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Version" value="4.0.8" timestamp="1310719422089054000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/VersionEx" value="4.0.8" timestamp="1310719422089461000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/MAC" value="08002744EA23" timestamp="1310719422093717000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/Status" value="Up" timestamp="1310719422094095000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Broadcast" value="192.168.0.255" timestamp="1310719422092821000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/IP" value="192.168.0.7" timestamp="1310719422092452000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Netmask" value="255.255.255.0" timestamp="1310719422093222000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="1" timestamp="1310737005246083000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Linux" timestamp="1310719422086939000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="2.6.38-8-server" timestamp="1310719422087433000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="" timestamp="1310719422088563000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Version" value="#42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011" timestamp="1310719422088139000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1349450076130749000" flags=""/>
</GuestProperties>
</Hardware>
<StorageControllers>
<StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
<AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
</StorageController>
<StorageController name="SATA Controller" type="AHCI" PortCount="2" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" port="1" device="0">
<Image uuid="{7413a655-6aad-4f69-bb98-a4c6d7917647}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
</Snapshot>
<Hardware>
<CPU>
<PAE enabled="false"/>
<HardwareVirtExLargePages enabled="false"/>
</CPU>
<Memory RAMSize="1024"/>
<HID Pointing="USBTablet"/>
<Display VRAMSize="12"/>
<RemoteDisplay>
<VRDEProperties>
<Property name="TCP/Ports" value="3390"/>
</VRDEProperties>
</RemoteDisplay>
<USBController enabled="true" enabledEhci="true"/>
<Network>
<Adapter slot="0" enabled="true" MACAddress="08002744EA23" cable="true" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<BridgedInterface name="eth0"/>
</Adapter>
<Adapter slot="1" enabled="true" MACAddress="080027F38481" cable="true" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<HostOnlyInterface name="vboxnet0"/>
</Adapter>
<Adapter slot="2" MACAddress="0800271BD00B" cable="true" type="82540EM"/>
<Adapter slot="3" MACAddress="080027CFE975" cable="true" type="82540EM"/>
<Adapter slot="4" MACAddress="080027795D75" cable="true" type="82540EM"/>
<Adapter slot="5" MACAddress="080027ED2560" cable="true" type="82540EM"/>
<Adapter slot="6" MACAddress="080027F1FA2D" cable="true" type="82540EM"/>
<Adapter slot="7" MACAddress="0800274F8695" cable="true" type="82540EM"/>
</Network>
<LPT>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter driver="ALSA" enabled="true"/>
<RTC localOrUTC="UTC"/>
<GuestProperties>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1489770980536358000" flags=""/>
</GuestProperties>
</Hardware>
<StorageControllers>
<StorageController name="IDE Controller" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0"/>
</StorageController>
<StorageController name="SATA" type="AHCI" PortCount="1" useHostIOCache="true" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{b7002ea2-044a-424f-b019-def9e870c3c1}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
</Machine>
</VirtualBox>
I took the liberty of removing the GAs CD from the VM as well. It's not a good idea to keep it mounted.
Re: Deleting snapshot failed, not booting
Posted: 22. Mar 2017, 11:42
by aydun
socratis - thanks so much for providing that file. I needed to add a <HardDisk> and <AttachedDevice> for fileserver.vdi - the boot disk, but it is now running again.
The original problem was caused by attempting to delete/merge the snapshot. It seems CloneVDI is a better way to do that but it is not working well for me over a remote connection so I will try that again when I have direct access.
I'm fairly sure some of the VM's are no longer needed so once I confirm that I'll delete them. That includes the one the hdd in the global registry that mpack pointed out.
What is the right folder structure? Is there some documentation you can point me to to correct the structure?
Re: Deleting snapshot failed, not booting
Posted: 24. Mar 2017, 02:55
by socratis
aydun wrote:What is the right folder structure? Is there some documentation you can point me to to correct the structure?
User manual, Ch.
10.1. Where VirtualBox stores its files.
Re: Deleting snapshot failed, not booting
Posted: 24. Mar 2017, 21:01
by aydun
For anyone else with an old structure who might stumble on this thread, my steps were:
- delete unused VM's
- shutdown VirtualBox
- use wine CloneVDI to create new merged, expanded VDI's
- rename old $HOME/.VirtualBox
- start VirtualBox - creates new blank structure under $HOME/.config/VirtualBox
- create new VM's without disks - read the old xml/vbox file to find the settings - you don't have to understand it all to pick out significant things like amount of RAM, network interface configurations etc
- move the VDI's created by CloneVDI into the freshly created directories
- in Settings > Storage add the VDI's to the right controller (probably SATA) in the right order (check old xml/vbox if in doubt)
- start VM's
- test
- enjoy
My VM's complained about not having a vboxnet0 - used for host-only networking. Go to File > Preferences > Network > Host-only Networks, click Add icon
And the VM's boot and seem healthy!
Many thanks mpack and socratis for your help
Re: Deleting snapshot failed, not booting
Posted: 25. Mar 2017, 12:10
by mpack
That should do it, well done.