挂载docker虚拟机文件

挂载docker虚拟机文件

在运行 mac os Ventura 的 mac 笔记本电脑上,Docker VM 数据位于 Docker.raw 文件中:

$ ls -al ~/Library/Containers/com.docker.docker/Data/vms/0/data/

-rw-r--r--@ 1 user  staff  127999672320 Aug 22 00:02 Docker.raw

我可以挂载 Docker.raw 文件以便检查其内容吗?

$ file ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x1,0,1), end-CHS (0x3ff,63,32), startsector 2048, 249997312 sectors

分区表的内容如下:

$ fdisk -d ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

2048,249997312,0x83,*,1,0,1,1023,63,32
0,0,0x00,-,0,0,0,0,0,0
0,0,0x00,-,0,0,0,0,0,0
0,0,0x00,-,0,0,0,0,0,0

$ fdisk -l ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

fdisk: illegal option -- l
usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk
        -i: initialize disk with new MBR
        -u: update MBR code, preserve partition table
        -e: edit MBRs on disk interactively
        -f: specify non-standard MBR template
        -chs: specify disk geometry
        -S: specify disk size
        -r: read partition specs from stdin (implies -i)
        -a: auto-partition with the given style
        -d: dump partition table
        -y: don't ask any questions
        -t: test if disk is partitioned
`disk' is of the form /dev/rdisk0.
auto-partition styles:
  boothfs     8Mb boot plus HFS+ root partition (default)
  hfs         Entire disk as one HFS+ partition
  dos         Entire disk as one DOS partition
  raid        Entire disk as one 0xAC partition

谢谢。

相关内容