CentOS 7で.VDIファイルをマウントする

CentOS 7で.VDIファイルをマウントする

CentOS 7で.VDIファイルをマウントする方法は?

別のVirtualBoxインスタンスの.vdiハードドライブを別のVirtualBoxインスタンスにマウントしようとしています。 .vdiファイルのファイルを見つけてコピーしたいです。

最初の試みで.vdiを元の形式に変換しました。

VBoxManage clonehd --format RAW centoOS7Python3p9_tmp-disk1.vdi centoOS7Python3p9_tmp-disk1.img

それから画像をマウントしてみてください。

mount -t xfs -o loop,rw ./centoOS7Python3p9_tmp-disk1.img /mnt

エラーが発生します。

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

いろいろなインストール方法を試しましたが、進展はありませんでした。ある記事ではオフセットが必要だと言っていましたが、それも機能しませんでした。

2回目の試みでqemu-nbdを試しました。

touch /dev/nbd1
qemu-nbd -c /dev/nbd1 ./centoOS7Python3p9_tmp-disk1.vdi 

エラーが発生します。

nbd.c:nbd_init():L611: Failed to set NBD socket

私が試した場合:

modprobe nbd max_part=8

エラーが発生します。

modprobe: FATAL: Module nbd not found.

私はCentOSがnbdサポートを無効にしたという内容を読んだが、nbdを有効にする方法がわかりません。

3回目の試みではguestmountを使用します。

guestmount -a ./centoOS7Python3p9_tmp-disk1.vdi -i --ro /dev/oldHd

エラーが発生します。

libguestfs: error: could not create appliance through libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: Cannot access backing file '/home/brian/centoOS7Python3p9_tmp-disk1.vdi' of storage file '/tmp/libguestfs9LUDJB/overlay1.qcow2' (as uid:107, gid:107): Permission denied [code=38 int1=13]

""を試みるとexport LIBGUESTFS_BACKEND=directエラーが発生します。

guestmount -a ./centoOS7Python3p9_tmp-disk1.vdi -i --ro /dev/oldHd
libguestfs: error: appliance closed the connection unexpectedly.
This usually means the libguestfs appliance crashed.
Do:
  export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
and run the command again.  For further information, read:
  http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
You can also run 'libguestfs-test-tool' and post the *complete* output
into a bug report or message to the libguestfs mailing list.
libguestfs: error: guestfs_launch failed.
This usually means the libguestfs appliance failed to start or crashed.
Do:
  export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
and run the command again.  For further information, read:
  http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
You can also run 'libguestfs-test-tool' and post the *complete* output
into a bug report or message to the libguestfs mailing list.

ベストアンサー1

おすすめ記事