simplify the creation of the vhdx image, and remove the need for sudo
@chessturo is already working on this.
Since Nov 4, 2025.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
**Is your feature request related to a problem? Please describe.**
Using the loop device can be tricky or impossible in CI and you can perfectly create an ext4 image without it.
**Describe the solution you'd like**
Use the following code in the `README.me` and in `./Microsoft/scripts/gen_modules_vhdx.sh`
instead of :
```bash
# Create a blank image file of the right size
dd if=/dev/zero of="$tmp_dir/modules.img" bs=1024 count=$((modules_size / 1024))
# Set up fs and mount
lo_dev=$(losetup --find --show "$tmp_dir/modules.img")
mkfs -t ext4 "$lo_dev"
mkdir "$tmp_dir/modules_img"
mount "$lo_dev" "$tmp_dir/modules_img"
chmod a+rw "$tmp_dir/modules_img"
# Copy over the contents of $1
cp -r "$1/lib/modules/$2"/* "$tmp_dir/modules_img"
umount "$tmp_dir/modules_img"
````
just do :
```bash
mke2fs -L '' -d "$1/lib/modules/$2" -b 1024 -t ext4 $tmp_dir/modules.img $modules_size
```
**Describe alternatives you've considered**
**Additional context**
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.