{"id":8206,"date":"2016-11-02T07:13:35","date_gmt":"2016-11-02T07:13:35","guid":{"rendered":"http:\/\/www.top-password.com\/blog\/?p=8206"},"modified":"2016-11-02T07:13:35","modified_gmt":"2016-11-02T07:13:35","slug":"mount-and-unmount-vhd-vhdx-from-command-line","status":"publish","type":"post","link":"https:\/\/www.top-password.com\/blog\/mount-and-unmount-vhd-vhdx-from-command-line\/","title":{"rendered":"2 Ways to Mount and Unmount VHD \/ VHDX from Command Line"},"content":{"rendered":"<p>Virtual hard disk (VHD \/ VHDX) is a disk image file format for storing the complete contents of a hard drive. In this tutorial we&#8217;ll show you how to mount and unmount VHD \/ VHDX file from Command Prompt and PowerShell.<\/p>\n<p><strong>Method 1: Mount and Unmount VHD\/VHDX from Command Prompt<\/strong><\/p>\n<p>This method allows you to mount and unmount VHD\/VHDX file in all versions of Windows, including Windows 10 \/ 8 \/ 7 and Windows Server.<\/p>\n<ol>\n<li><a href=\"http:\/\/www.top-password.com\/blog\/open-command-prompt-in-windows-10\/\" target=\"_blank\">Open the Command Prompt<\/a> in Administrator mode.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2016\/07\/winx.png\" alt=\"winx\" width=\"238\" height=\"389\" class=\"alignnone size-full wp-image-7308\" \/><\/p>\n<\/li>\n<li>At the Command Prompt, type <strong>diskpart<\/strong> and press Enter to access the command-line disk partitioning utility.<\/li>\n<li>Before mounting or unmounting virtual disk, you need to specify the location of your vhd\/vhdx file. Type the following command and hit Enter.<br \/>\n<code>select vdisk file=\"[location of vhd]\"<\/code><\/li>\n<li>\n<p>You can now mount or mount your VHD\/VHDX file using the below commands:<\/p>\n<ul>\n<li>To mount VHD\/VHDX file, type <strong>attach vdisk<\/strong> and press Enter. You can see a new virtual hard drive in your Disk Management and Windows Explorer.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2016\/11\/mount-vhd-from-command-line.png\" alt=\"mount-vhd-from-command-line\" width=\"493\" height=\"376\" class=\"alignnone size-full wp-image-8207\" \/><\/p>\n<\/li>\n<li>To unmount a virtual hard disk, type <strong>detach vdisk<\/strong> and press Enter.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>Method 2: Mount and Unmount VHD\/VHDX from PowerShell<\/strong><\/p>\n<p>In Windows Server 2016 \/ 2012 \/ 2008, you can also mount and unmount VHD\/VHDX file using the PowerShell cmdlet. Here&#8217;s how:<\/p>\n<ol>\n<li><a href=\"http:\/\/www.top-password.com\/blog\/5-ways-to-run-powershell-as-administrator-in-windows-10\/\" target=\"_blank\">Open the PowerShell as Administrator<\/a>.<\/li>\n<li>When the command-line window opens, you can run the Mount-VHD cmdlet to mount your vhd\/vhdx file.<br \/>\n<code>Mount-VHD \u2013Path \"[location of vhd]\"<\/code><\/li>\n<li>To unmount your virtual hard disk, just run the Dismount-VHD cmdlet instead.<br \/>\n<code>Dismount-VHD \u2013Path \"[location of vhd]\"<\/code><\/li>\n<\/ol>\n<p>If you get the error message like &#8220;<em>Mount-VHD is not recognized as the name of a cmdlet<\/em>&#8220;, you need to add a feature named &#8220;<strong>Hyper-V Module for Windows PowerShell<\/strong>&#8221; to your server.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Virtual hard disk (VHD \/ VHDX) is a disk image file format for storing the complete contents of a hard drive. In this tutorial we&#8217;ll show you how to mount and unmount VHD \/ VHDX file from Command Prompt and PowerShell. Method 1: Mount and Unmount VHD\/VHDX from Command Prompt This method allows you to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1894,3,39],"tags":[3091,3089,3090,3088],"class_list":["post-8206","post","type-post","status-publish","format-standard","hentry","category-tips-tricks","category-windows-10","category-windows-7","category-windows-8","tag-mount-vhd-powershell","tag-mount-vhd-windows-10","tag-mount-vhd-windows-7","tag-mount-vhdx-command-line"],"_links":{"self":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/8206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/comments?post=8206"}],"version-history":[{"count":7,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/8206\/revisions"}],"predecessor-version":[{"id":8214,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/8206\/revisions\/8214"}],"wp:attachment":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/media?parent=8206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/categories?post=8206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/tags?post=8206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}