<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edward Stafford&#187; Virtualization</title>
	<atom:link href="http://www.edwardstafford.com/category/technology/virtualization-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edwardstafford.com</link>
	<description>Technologist, Artist, and Geek</description>
	<lastBuildDate>Thu, 12 Aug 2010 17:59:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How-To: Using VBoxManage to Delete a Virtual Machine from VirtualBox</title>
		<link>http://www.edwardstafford.com/2009/11/08/how-to-using-vboxmanage-to-delete-a-virtual-machine-from-virtualbox/</link>
		<comments>http://www.edwardstafford.com/2009/11/08/how-to-using-vboxmanage-to-delete-a-virtual-machine-from-virtualbox/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:48:43 +0000</pubDate>
		<dc:creator>Ed Stafford</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[VBoxManage]]></category>
		<category><![CDATA[Virtual Machine]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.edwardstafford.com/?p=206</guid>
		<description><![CDATA[One common problem I see from people learning to manage Virtual Machines within VirtualBox using the VBoxManager command line is the error: Cannot unregister the machine &#60;Virtual-Machine-Name&#62;  because it has 1 hard disks attached Before a VM can be unregistered or deleted, all disks that have been &#8220;attached&#8221; need to first be disassociated from the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-224" title="delete" src="http://www.edwardstafford.com/wp-content/uploads/delete-150x150.jpg" alt="delete" width="150" height="150" />One common problem I see from people learning to manage Virtual Machines within VirtualBox using the VBoxManager command line is the error:</p>
<blockquote style="margin-left:160px"><p>Cannot unregister the machine &lt;Virtual-Machine-Name&gt;  because it has 1 hard disks attached</p></blockquote>
<p>Before a VM can be unregistered or deleted, all disks that have been &#8220;attached&#8221; need to first be disassociated from the VM. For this example, I&#8217;m using a virtual machine that I have set up and named &#8220;<strong>VNAS</strong>&#8221; that was used to test an OpenFiler NAS installation (which, by the way, worked great). Now that testing is complete, I am ready to remove it.</p>
<p>The removal for a standard VM install can be completed in a short list of steps.</p>
<p><strong>Step one</strong>: Get the name or UUID and details of your VM</p>
<blockquote><p><strong>VBoxManage list vms</strong></p>
<p>VirtualBox Command Line Management Interface Version 3.0.8<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>&#8220;VNAS&#8221; {8a48759d-4e6d-473f-ab0f-8ff59aa727eb}</p></blockquote>
<p>That command will return the names of all registered VMs and their UUID. Make sure you get the correct name or UUID for the VM you will be modifying.</p>
<p><strong>Step two</strong>: Get the disc information for your VM</p>
<p>There are two methods you can use to the get the information for each virtual disk registered to a virtual machine. The first is to list the VM info for a specified VM which includes the Virtual Disks that are in use by it.</p>
<p>VBoxManage showvminfo &lt;Virtual Machine Name or UUID&gt;</p>
<blockquote><p><strong>VBoxManage showvminfo VNAS</strong><br />
VirtualBox Command Line Management Interface Version 3.0.8<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>Name:            VNAS<br />
Guest OS:        Other/Unknown<br />
UUID:            8a48759d-4e6d-473f-ab0f-8ff59aa727eb<br />
Config file:     /secondary/.Virtual/machines/VNAS/VNAS.xml<br />
Memory size:     512MB<br />
VRAM size:       8MB<br />
Number of CPUs:  1<br />
Boot menu mode:  message and menu<br />
Boot Device (1): Floppy<br />
Boot Device (2): DVD<br />
Boot Device (3): HardDisk<br />
Boot Device (4): Not Assigned<br />
ACPI:            on<br />
IOAPIC:          off<br />
PAE:             on<br />
&#8230;<br />
<strong> Primary master:  /secondary/.Virtual/vdisks/OFInstallDisk (UUID: xxxxxxx)<br />
Primary slave:   /secondary/.Virtual/vdisks/VNASStore1 (UUID: xxxxxxx)<br />
Secondary slave: /secondary/.Virtual/vdisks/VNASStore2 (UUID: xxxxxxx)</strong><br />
&#8230;</p></blockquote>
<p>In this example you can see I have 3 disks registered with the vm.</p>
<ul>
<li>Primary Master (<strong>hda</strong>)</li>
<li>Primary Slave (<strong>hdb</strong>)</li>
<li>Secondary Slave (<strong>hdd</strong>)</li>
</ul>
<blockquote><p>NOTE: You might be asking, Why does the sequence jump from hdb to hdd? What happened to hdc? The answer is, hdc is reserved for CD/DVD mounting, so you can&#8217;t add a virtual disk there.</p></blockquote>
<p>The second, alternative method is to use the the VBoxManage command &#8220;list&#8221; with the &#8220;hdds&#8221; option to list all the Virtual Disks in the system. This will display a list of All the disks you have created and registered for ALL VMs. Information for each Virtual Disk and the VM it is registered to is displayed. Here you can see the three disks registered with my VNAS VM indicated by the &#8220;Usage&#8221; lines.</p>
<blockquote><p><strong>VBoxManage list hdds</strong></p>
<p>UUID:         eebbb4c7-c539-4da4-b8ab-e5777b32520b<br />
Format:       VDI<br />
Location:     /secondary/.Virtual/vdisks/VNASStore1<br />
Accessible:   yes<br />
Usage:        <strong>VNAS </strong>(UUID: 8a48759d-4e6d-473f-ab0f-8ff59aa727eb)</p>
<p>UUID:         9f238d31-f794-420f-83a7-ccf811d52244<br />
Format:       VDI<br />
Location:     /secondary/.Virtual/vdisks/VNASStore2<br />
Accessible:   yes<br />
Usage:        <strong>VNAS </strong>(UUID: 8a48759d-4e6d-473f-ab0f-8ff59aa727eb)</p>
<p>UUID:         2ce976c9-0a37-49c1-8d34-3962c563a256<br />
Format:       VDI<br />
Location:     /secondary/.Virtual/vdisks/OFInstallDisk<br />
Accessible:   yes<br />
Usage:        <strong>VNAS </strong>(UUID: 8a48759d-4e6d-473f-ab0f-8ff59aa727eb)</p></blockquote>
<p>In my opinion, method one the easiest quickest way to see what Virtual disks are assigned to a specific VM.</p>
<p><strong>Step Three</strong>: Disassociate the Virtual Disk[s]</p>
<p>VBoxManage modifyvm &lt;Virtual Machine Name or UUID&gt; &#8211;<strong>hda</strong> none</p>
<blockquote><p><strong>VBoxManage modifyvm VNAS &#8211;hda none </strong></p></blockquote>
<p>If you have more than one disk registered with a vm as I do here, you&#8217;ll also need to disassociate those as well.</p>
<blockquote><p>VBoxManage modifyvm VNAS &#8211;<strong>hdb </strong>none</p>
<p>VBoxManage modifyvm VNAS &#8211;<strong>hdd </strong>none</p></blockquote>
<p><strong>Step Four</strong>: Unregister and delete the VM</p>
<p>VBoxManage unregistervm &lt;Virtual Machine Name or UUID&gt; &#8211;delete</p>
<blockquote><p><strong>VBoxManage unregistervm VNAS &#8211;delete</strong></p></blockquote>
<p><strong>Step Five</strong>: Confirm</p>
<blockquote><p><strong>VBoxManage list vms</strong></p>
<p>VirtualBox Command Line Management Interface Version 3.0.8<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>[NOTE: there are no VMs listed]</p></blockquote>
<p>This is the same command that was executed in step one. After running this command again you should no longer see your Virtual Machine listed.</p>
<p>Note: This process will only remove your VM from VirtualBox. It will not remove/delete the actual virtual disk file (.vdi). You can delete that manually, or save it to use with another virtual machine instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edwardstafford.com/2009/11/08/how-to-using-vboxmanage-to-delete-a-virtual-machine-from-virtualbox/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
