Score:0

Mount docker VM file

cn flag

On my mac laptop running mac os Ventura, Docker VM data is in the Docker.raw file:

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

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

Can I mount the Docker.raw file so that I can inspect its contents?

$ 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

Here are the contents of the partition table:

$ 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

Thanks.

alexus avatar
sa flag
I believe that's some proprietary VM image, which includes MBR, etc..
Nikita Kipriyanov avatar
za flag
What does `file Docker.raw` say, also `fdisk -l Docker.raw`? (As a reminder, you have to put the requested information [into the question](https://serverfault.com/posts/1142078/edit).)
cn flag
@NikitaKipriyanov, I updated my question with the requested info.
Nikita Kipriyanov avatar
za flag
Well, it does contain MBR from which we see it's a hard disk image with a single partition of type 0x83 = Linux filesystem. I don't know how to mount in in macOS, sorry, I overlooked that part. In Linux I'd use a loop device with offset=1048576 sizelimit=127998623744 (those numbers are 2048 * 512 and 249997312 * 512, respectively) for that.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.