Hi,
For my os development, I was able to set up dev env. in WSL - i.e. cross compiler, qemu etc. But I then realized that loop devices are not supported on WSL.
[ so far I have been using VM running ubuntu on windows 10 ordirectly boot to ubuntu OS ]
I need loop device to mount disk image files that I create using 'dd' command. I then partition the same using kpartx and also format these partitions in fat32/ext, then copy required os binary files onto mounted disk image and run qemu against these disk image files. In this, the part that is automated in a script is to mount the disk image file, copy os binaries and unmount disk image file
However, loop device isn't supported on WSL nor kpartx/related commands work on WSL
Is there any way to make this work on WSL or any alternatives to above (that can be automated through a script that can be run from within WSL) while I continue to use linux subsystem on windows 10
Thanks
Prajwal
loop device in WSL
loop device in WSL
complexity is the core of simplicity
Re: loop device in WSL
As you are using FAT for your disk image, mount it in Windows and copy the files to it in Windows,
Re: loop device in WSL
Can I do mount + copy files + unmount in a script that’s run from within WSL ?
Also, I need to use ext2fs format as well
Also, I need to use ext2fs format as well
complexity is the core of simplicity
[SOLVED] Re: loop device in WSL
I just updated my windows 10 to use insider preview build and got wsl2 installed and set up. I then noticed that loop device are now supported in wsl2!
I use 'Bash on Ubuntu' that now uses wsl2 and I am able to run my OS build and set up scripts that can mount disk images (created from dd), format and copy files like how I do it on a real linux installation
Thanks
Prajwal
I use 'Bash on Ubuntu' that now uses wsl2 and I am able to run my OS build and set up scripts that can mount disk images (created from dd), format and copy files like how I do it on a real linux installation
Thanks
Prajwal
complexity is the core of simplicity
Re: loop device in WSL
Thanks for the update. That's worth knowing.
Re: loop device in WSL
WSL is a software layer that allows you to run linux elf binaries on top of NT kernel. as NT doesn't support ext4 and loop device you can't use them in WSL. WSL2 actually is a virtual machine that runs a light version of linux kernel so it's possible on it.
i think ext2fs won't work on WSL on disk image as you can only access fixed disks in WSL even you dont have access to fat usb disks.
instead you can create a cpio initrd and boot your kernel with it directly with qemu, as qemu supports booting multiboot kernel directly.
i think ext2fs won't work on WSL on disk image as you can only access fixed disks in WSL even you dont have access to fat usb disks.
instead you can create a cpio initrd and boot your kernel with it directly with qemu, as qemu supports booting multiboot kernel directly.
Code: Select all
qemu -kernel kernel.bin -initrd ramdisk.tar.gz


