d2vm: MacOS: The file /dev/loop0p1 does not exist and no size was specified.

Running this command: % sudo ~/go/bin/d2vm build -p 0 -f Dockerfile -o nutek-linux.vdi .

Leads to this error:

Building docker image from /in/Dockerfile
Inspecting image d2vm-cdc6670a-be2d-4db5-9d50-7d1414cad66b
No network manager specified, using distribution defaults: ifupdown
Docker image based on Kali GNU/Linux 2022.3
Building kernel enabled image
Creating vm image
Creating raw image
Mounting raw image
Creating raw image file system
Build failed
Unmounting raw image
Failed to unmount
Error: mkfs.ext4 /dev/loop0p1: stdout:  stderr: mke2fs 1.45.5 (07-Jan-2020)
The file /dev/loop0p1 does not exist and no size was specified.
 error: exit status 1

There is no mkfs.ext4 on MacOS

% which mkfs.ext4
mkfs.ext4 not found

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

Thank you, great app 😃

This command worked for me ~/go/bin/d2vm build -p 0 -o nutek-linux.vdi . without sudo and without -f Dockerfile

I can build raw image

Output of your commands:

 % docker run --rm -i -t --privileged --entrypoint bash linkacloud/d2vm:v0.1.0-rc3
Unable to find image 'linkacloud/d2vm:v0.1.0-rc3' locally
v0.1.0-rc3: Pulling from linkacloud/d2vm
d7bfe07ed847: Already exists 
804fa0f1c513: Pull complete 
e2e1e4f27485: Pull complete 
40bf76dcf7cb: Pull complete 
Digest: sha256:a8717df5df4ece57d9cc90efdc716868e833272fdd2b64cf43e6e63bdf4d9619
Status: Downloaded newer image for linkacloud/d2vm:v0.1.0-rc3
root@6652692f2548:/# fallocate -l 5G /tmp/disk
root@6652692f2548:/# parted -s /tmp/disk mklabel msdos mkpart primary 1Mib 100% set 1 boot on
root@6652692f2548:/# fdisk -l /tmp/disk
Disk /tmp/disk: 5 GiB, 5368709120 bytes, 10485760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd4be6929

Device     Boot Start      End  Sectors Size Id Type
/tmp/disk1 *     2048 10485759 10483712   5G 83 Linux
root@6652692f2548:/# losetup
root@6652692f2548:/# LOOPDEV=$(losetup --show -f /tmp/disk)
root@6652692f2548:/# echo $LOOPDEV
/dev/loop0
root@6652692f2548:/# partprobe $LOOPDEV
root@6652692f2548:/# ls /dev/loop*
/dev/loop-control  /dev/loop0p1  /dev/loop2  /dev/loop4  /dev/loop6
/dev/loop0         /dev/loop1    /dev/loop3  /dev/loop5  /dev/loop7
root@6652692f2548:/# mkfs.ext4 ${LOOPDEV}p1
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 1310464 4k blocks and 327680 inodes
Filesystem UUID: e97d5d6e-c01f-4ecc-8a44-af6740eed07d
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

root@6652692f2548:/# losetup -d $LOOPDEV
root@6652692f2548:/#