0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[VirtualBox] Cannot register the hard disk because a hard disk already exists

Last updated at Posted at 2022-04-22

仮想HDDの場所を移したときエラーになったので対処法の備忘録

環境

ホストOS: Windows10
VirtualBox: 6.1

エラーメッセージ例

Cannot register the hard disk 'folder1\folder2\diskimage.vmdk' {c9050cf2-e1f1-41cd-9f0c-a60ab6e325e8} because a hard disk 'folder1\diskimage.vmdk' with UUID {c9050cf2-e1f1-41cd-9f0c-a60ab6e325e8} already exists.

終了コード : E_INVALIDARG (0x80070057)
コンポーネント: VirtualBoxWrap
インターフェース: IVirtualBox {d0a0163f-e254-4e5b-a1f2-011cf991c38d}
呼び出し先 RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

VBoxManage

  • まずコマンドプロンプトでVBoxManageコマンドが使えるようにPathを通す
    システムのプロパティ > 詳細設定タブ > 環境変数
    変数Pathに C:\Program Files\Oracle\VirtualBox を追加

  • 移動先の仮想HDDに以下のコマンドを実行すると、UUIDが再設定され利用可能になる

    vboxmanage internalcommands sethduuid <path>
    
  • 古い仮想HDDの残骸が以下のような状態でリストに存在する場合、

    vboxmanage list hdds あるいは vboxmanage showmediuminfo <uuid>
    
    UUID:           c9050cf2-e1f1-41cd-9f0c-a60ab6e325e8
    State:          inaccessible
    

    以下のコマンドで消去する

    vboxmanage closemedium disk <uuid> --delete
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?