加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

如何在Linux中附加VHDx或VHD文件?

发布时间:2020-12-13 18:49:18 所属栏目:Linux 来源:网络整理
导读:如何在 Linux中附加VHDX或VHD文件? 我的意思是将虚拟硬盘作为块设备附加,并使用外部工具来读取这些设备. 里面的文件系统不可安装.我不需要挂载文件系统,但处理它就像在真正的硬盘上一样. 我阅读了guestfish的手册页,但找不到怎么做. 解决方法 您可以使用 li
如何在 Linux中附加VHDX或VHD文件?

我的意思是将虚拟硬盘作为块设备附加,并使用外部工具来读取这些设备.

里面的文件系统不可安装.我不需要挂载文件系统,但处理它就像在真正的硬盘上一样.

我阅读了guestfish的手册页,但找不到怎么做.

解决方法

您可以使用 libguestfs-tools来实现此目的.

>首先,您需要在类似Ubuntu / Debian的Linux上安装它:

sudo apt-get install libguestfs-tools

>然后,您几乎可以随意安装:

guestmount --add yourVirtualDisk.vhdx --inspector --ro /mnt/anydirectory

这只是只读提取点的一个示例.

提示:

>以普通用户身份运行,即:

guestmount ...

代替:

sudo guestmount ...

>开关; man page的引文:

--add

Add a block device or virtual machine image.

--inspector

Using 07002 code,inspect the disks looking for an operating system and mount filesystems as they would be mounted on the real virtual machine.

--ro

Add devices and mount everything read-only. Also disallow writes and make the disk appear read-only to FUSE.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读