Unable to discard snapshot to remove VM

This is for discussing general topics about how to use VirtualBox.
Post Reply
Kouki Hashimoto
Posts: 3
Joined: 3. Oct 2009, 16:09
Primary OS: OpenSolaris 10
VBox Version: OSE other
Guest OSses: FreeBSD

Unable to discard snapshot to remove VM

Post by Kouki Hashimoto »

Hello.

I want to remove guest OS on VirtualBox, but I can't remove it.
The error message says that I can't remove it because it has a snapshot.

So, I try to discard the snapshot, but it failed.
In this time, the error message says that the disk has more than one child harddisk.
(What does "child harddisk" mean?
The VM has only one snapshot which I tried to discard.)


How can I remove the snapshot & remove the VM?
I no longer need the VM, the disk which it used and the snapshot.
Regards.

--- Information ---

Host: Open Solaris
Software: VirtualBox 3.0.6 r52128

$ uname -a
SunOS ex5800 5.11 snv_111b i86pc i386 i86pc Solaris


$ VBoxManage unregistervm dev_ubuntu --delete
VirtualBox Command Line Management Interface Version 3.0.6
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Cannot unregister the machine 'dev_ubuntu' because it has 1 snapshots
Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
Context: "UnregisterMachine(uuid, machine.asOutParam())" at line 294 of file VBoxManage.cpp

Code: Select all

$ VBoxManage showvminfo dev_ubuntu
VirtualBox Command Line Management Interface Version 3.0.6
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Name:            dev_ubuntu
Guest OS:        Ubuntu
UUID:            39cbc183-05e7-4254-9b42-f7fe09d12c68
Config file:     /export/home/admin/.VirtualBox/Machines/dev_ubuntu/dev_ubuntu.xml
Memory size:     128MB
VRAM size:       12MB
Number of CPUs:  1
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          off
PAE:             off
Time offset:     0 ms
Hardw. virt.ext: on
Nested Paging:   off
VT-x VPID:       off
State:           powered off (since 2009-10-03T13:53:43.740000000)
Monitor count:   1
3D Acceleration: off
Floppy:          empty
SATA:            enabled
IDE Controller:  PIIX4
DVD:             empty
NIC 1:           MAC: 0800273DD5D7, Attachment: Internal Network 'intnet', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
UART 1:          disabled
UART 2:          disabled
Audio:           disabled
Clipboard Mode:  Bidirectional
VRDP:            disabled
USB:             enabled

USB Device Filters:

<none>

Shared folders:  <none>

Guest:

Statistics update:                   disabled

Snapshots:

   Name: snap_20091003 (UUID: 0f151052-5b2f-4157-beee-a109452bf3d9)
$ VBoxManage snapshot dev_ubuntu discard snap_20091003
VirtualBox Command Line Management Interface Version 3.0.6
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to discard snapshot. Error message: Hard disk '/export/home/admin/.VirtualBox/HardDisks/dev_ubuntu.vdi' has more than one child hard disk (7)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Unable to discard snapshot to remove VM

Post by Perryg »

Strange.

Try to edit the virtualbox.xlm and remover the line that has the snapshot.
nardrish
Posts: 7
Joined: 16. Sep 2009, 10:54
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP Pro

Re: Unable to discard snapshot to remove VM

Post by nardrish »

Hashimoto-san,

If you are not comfortable with editing XML files, you may wish to consider trying this and see if it works for you.

Close and relaunch VirtualBox.
Click on File, Virtual Media Manager
Expand the machine with snapshots
Starting with the lowest snapshot, click it and click on Remove (Click YES if it prompts with a warning)
Move on to the next lowest snapshot until you reach the actual VDI file
Now you should be able to remove the virtual machine

Let us know how it goes :D
Kouki Hashimoto
Posts: 3
Joined: 3. Oct 2009, 16:09
Primary OS: OpenSolaris 10
VBox Version: OSE other
Guest OSses: FreeBSD

Re: Unable to discard snapshot to remove VM

Post by Kouki Hashimoto »

Thanks for your reply, Perryg.
Perryg wrote: Try to edit the virtualbox.xlm and remover the line that has the snapshot.
I can't find the line which includes the snapshot.

Code: Select all

$ grep snap_20091003 ~/.VirtualBox/VirtualBox.xml
$ (no output)
This is my VirtualBox.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!-- Sun VirtualBox Global Configuration -->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.7-solaris">
  <Global>
    <ExtraData>
      <ExtraDataItem name="GUI/LicenseAgreed" value="7"/>
      <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2009-10-04"/>
      <ExtraDataItem name="GUI/SUNOnlineData" value="triesLeft=0"/>
      <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,confirmGoingFullscreen,confirmInputCapture,confirmVMReset,remindAboutWrongColorDepth,confirmRemoveMedium"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="127,109,770,550"/>
      <ExtraDataItem name="GUI/LastVMSelected" value="39cbc183-05e7-4254-9b42-f7fe09d12c68"/>
      <ExtraDataItem name="GUI/UpdateCheckCount" value="50"/>
      <ExtraDataItem name="GUI/Input/HostKey" value="65513"/>
      <ExtraDataItem name="GUI/Input/AutoCapture" value="true"/>
      <ExtraDataItem name="GUI/MaxGuestResolution" value="auto"/>
      <ExtraDataItem name="GUI/TrayIcon/Enabled" value="false"/>
    </ExtraData>
    <MachineRegistry>
      <MachineEntry uuid="{6b337c05-65fb-471f-be37-bd85328ac60b}" src="Machines/srv_router/srv_router.xml"/>
      <MachineEntry uuid="{fae74714-890b-42ff-9791-ff99822fdb98}" src="Machines/srv_fbrepo/srv_fbrepo.xml"/>
      <MachineEntry uuid="{c4100a9d-07d0-4809-b4e1-6330306184a6}" src="Machines/srv_syslog/srv_syslog.xml"/>
      <MachineEntry uuid="{12776114-c726-40ad-8cd6-fa76abed7163}" src="Machines/dev_router/dev_router.xml"/>
      <MachineEntry uuid="{599026e2-3e8c-475d-be0d-2014e156ae0e}" src="Machines/dev_netbsd/dev_netbsd.xml"/>
      <MachineEntry uuid="{ef81be8c-3d32-44b4-9c60-c2cb883a61fd}" src="Machines/dev_openbsd/dev_openbsd.xml"/>
      <MachineEntry uuid="{76f136f7-6040-4887-aef2-9613fe4e0c46}" src="Machines/dev_gentoo/dev_gentoo.xml"/>
      <MachineEntry uuid="{9f0d7395-1d88-4a4e-bd5b-59cdfd44292d}" src="Machines/srv_mail/srv_mail.xml"/>
      <MachineEntry uuid="{e407b61c-1900-4047-8fe5-f5b70888a15d}" src="Machines/dev_minix/dev_minix.xml"/>
      <MachineEntry uuid="{95dab35f-cbc4-432c-a3d7-84386a60e504}" src="Machines/dev_fbport/dev_fbport.xml"/>
      <MachineEntry uuid="{39cbc183-05e7-4254-9b42-f7fe09d12c68}" src="Machines/dev_ubuntu/dev_ubuntu.xml"/>
      <MachineEntry uuid="{df0fabbe-42c0-4b09-9b76-9804aa8f96ec}" src="Machines/srv_monitor/srv_monitor.xml"/>
      <MachineEntry uuid="{88b5c754-34d3-4a9e-aa14-9dcb631603f8}" src="Machines/dev_dfly/dev_dfly.xml"/>
      <MachineEntry uuid="{dc07349e-c728-4efc-a4dc-5244af8cf577}" src="Machines/dev_lfs/dev_lfs.xml"/>
      <MachineEntry uuid="{ec64f4ea-75a4-409f-886d-b0415c314f3d}" src="Machines/dev_slack/dev_slack.xml"/>
      <MachineEntry uuid="{f314eb3c-1c6c-41ca-8790-ee4301d65aeb}" src="Machines/dev_fbclang/dev_fbclang.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{ceb27b37-85d5-49ce-b417-fad4a1106f8a}" location="HardDisks/srv_router.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{a93ea862-0056-4489-95a4-01c21aa8d671}" location="HardDisks/srv_fbrepo.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{17370924-6c31-4fc7-abe9-5de42cbba3e5}" location="HardDisks/srv_fbrepo_usr_ports.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{3770b56c-003b-46c6-a2f6-5e566c84863a}" location="HardDisks/srv_syslog.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{7439533d-db25-413d-a731-6cb460c8a7be}" location="/export/home/admin/.VirtualBox/HardDisks/srv_fbrepo_usr_src.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{18dc2887-5dcc-4d64-9ba8-1c0913be86d1}" location="HardDisks/srv_dns.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{d63d06d2-5ad3-49d2-b8b0-6802832e2a71}" location="/export/home/admin/.VirtualBox/HardDisks/dev_router.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{8139285f-07d8-425f-b940-06bd7f6b39de}" location="HardDisks/dev_netbsd.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{5aa78ab9-7ea3-4da9-8e05-910d7c7ec535}" location="HardDisks/dev_openbsd.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{3e31b388-329b-4c4a-9e1f-57bced89abb8}" location="HardDisks/dev_gentoo.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{700ef073-5c2e-4054-a8e4-7d50fea9795a}" location="HardDisks/srv_mail.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{ca1efd42-cf29-426b-beaf-81ab92e2743a}" location="HardDisks/dev_minix.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{21e2bffb-4f6a-45fc-a0d3-c06b95227829}" location="HardDisks/dev_gentoo_swap.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{787fcb7e-0bd3-4131-b27d-670b06532d94}" location="/export/home/admin/.VirtualBox/HardDisks/dev_fbport.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{da81bd3d-7143-4c3f-9eac-e58a3831f408}" location="HardDisks/dev_fbport_usr_ports.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{5a905b5c-5597-4a2f-a396-1b2330986129}" location="/export/home/admin/.VirtualBox/HardDisks/srv_monitor.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{164487ec-158f-4ec0-b736-8d6ceebfc8c2}" location="HardDisks/srv_fbrepo_usr_obj.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{c5c0d90f-3f9a-4acc-ac2a-c2405f2a07a8}" location="HardDisks/dev_dfly.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{c0f8be02-4ae1-4c07-9aae-cfda9823e19b}" location="HardDisks/dev_lfs.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{78d41e22-7e7d-48c4-9abc-132ba23b1059}" location="HardDisks/dev_slack.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{cf6cfb7e-b68f-4008-b68a-c898c6099247}" location="HardDisks/dev_clang_usr_src.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{ffc20b40-9e4a-4186-be55-9eae55ff44ea}" location="HardDisks/dev_fbclang.vdi" format="VDI" type="Normal"/>
      </HardDisks>
      <DVDImages>
        <Image uuid="{d6b890f8-e6ed-4b02-98b5-dd396111459d}" location="/export/home/admin/Downloads/install45.iso"/>
        <Image uuid="{4764ae7b-8152-41bf-9482-e605a6bffd9b}" location="/export/home/admin/Downloads/i386cd-5.0.1.iso"/>
        <Image uuid="{b56e635c-3e66-457c-ba1b-28d9965b8f2f}" location="/export/home/admin/Downloads/i386cd-4.0.1.iso"/>
        <Image uuid="{03bf9169-e7de-4df3-a56f-b688691fac29}" location="/export/home/admin/Downloads/install-x86-minimal-2008.0.iso"/>
        <Image uuid="{645e4916-09ed-4705-a56c-1d9e200b9a7c}" location="/export/home/admin/Downloads/minix3_1_3a_ide_r2964.iso"/>
        <Image uuid="{f9f60bf9-9f97-4c41-981e-144574e6a19f}" location="/export/home/admin/Downloads/CentOS-5.3-i386-bin-DVD/CentOS-5.3-i386-bin-DVD.iso"/>
        <Image uuid="{7a7cbc44-eeac-4fc7-b054-588fb8a78f34}" location="/export/home/admin/Downloads/ubuntu-9.04-server-i386.iso"/>
        <Image uuid="{5f95d04b-1fba-4507-a7e7-74719bd30221}" location="/export/home/admin/Downloads/systemrescuecd-x86-1.2.3.iso"/>
        <Image uuid="{cb5b6670-2ee3-41cf-ba5a-497a6ae294d2}" location="/export/home/admin/Downloads/lfslivecd-x86-6.3-r2160.iso"/>
        <Image uuid="{692c0cd1-ca10-40ac-848b-20b56d232ed9}" location="/export/home/admin/Downloads/8.0-BETA2-i386-disc1.iso"/>
        <Image uuid="{b9225f3f-d20c-49f6-ba62-c40fd00bc243}" location="/export/home/admin/Downloads/slackware/slackware-13.0-install-d2.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <NetserviceRegistry>
      <DHCPServers>
        <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.56.100" networkMask="255.255.255.0" lowerIP="192.168.56.101" upperIP="192.168.56.254" enabled="1"/>
      </DHCPServers>
    </NetserviceRegistry>
    <USBDeviceFilters/>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" LogHistoryCount="3"/>
  </Global>
</VirtualBox>
Kouki Hashimoto
Posts: 3
Joined: 3. Oct 2009, 16:09
Primary OS: OpenSolaris 10
VBox Version: OSE other
Guest OSses: FreeBSD

[Solved?] Re: Unable to discard snapshot to remove VM

Post by Kouki Hashimoto »

Thanks for your reply, nardrish.
nardrish wrote:Hashimoto-san,

If you are not comfortable with editing XML files, you may wish to consider trying this and see if it works for you.

Close and relaunch VirtualBox.
Click on File, Virtual Media Manager
Expand the machine with snapshots
Starting with the lowest snapshot, click it and click on Remove (Click YES if it prompts with a warning)
Move on to the next lowest snapshot until you reach the actual VDI file
Now you should be able to remove the virtual machine

Let us know how it goes :D
I tried as following.
  • Stop all VMs.
  • Close VirtualBox.
  • Reboot the host machine.
  • Launch VirtualBox.
  • The VM get "Inaccessible" state, and I could remove it.
So, now the problem has disappeared, everything works well.
Unfortunately, I couldn't find the cause.
Thanks for your help.
Post Reply