-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Works for me, but I'm not able to make a file-based pool #1
Comments
Thanks for letting me know, @rnickle! I'm glad someone actually found this and was able to get some use out of it. I have been having a similar issue myself actually when trying to test pool configurations using sparse files. I need to rework my Win 10 development environment to really give this a proper test. Got a bit stuck as they've removed all the Insider Preview builds of Win 10 to get ready for the Win 11 release, but my dev box is too old to upgrade to 11. So for now I'm stuck unable to get the latest WSL2 with the nice drive mapping features. It shouldn't really be needed for testing pools with sparse files, but I wanted to make sure I could get it reliably working with passed-through disks before I started to debug the sparse file issue too hard - in case both showed the same behaviour. I'll rework my dev env and see if I can work out what we might be missing here. |
Thanks for looking into it, so your suggestion about the drive mapping is what I was planning to try next: try to mount a VHD, I can try that later today. I tried strace and gdb but wasn't able to get any clues that way, perhaps I'm not trying hard enough yet. I pored over the source but no ideas. For my development environment I'm working in a vanilla but up-to-date corporate Win 10 Pro environment, I could use my personal Win 10 environment for testing too, but neither of these machines are on insider builds (that's a good idea!) For a point of reference I have a very clean Ubuntu 20.04 VM which is successfully running ZFS. I wonder if it is because it is a kernel built-in, but that doesn't make sense. It is almost as if there is some service element missing, and yet, the services in the systemd directory seem mostly related to mounting services, not pool services. One thing I noticed with sysctl is that the kernel.spl.hostid was set to '0', which didn't seem right since that was set to the host ID on my Ubuntu reference. Running 'zgenhostid' was sufficient to get the WSL session to generate an /etc/hostid file and set the kernel variable: But that didn't change the behavior of creating a zpool. Still wondering if there's some other metadata or prerequisite that needs to be set to enable the zfs commands to access those features in the kernel. Thanks! |
I posed a Q&A on the OpenZFS project: Statically linked module for WSL2, does not seem to initialize properly. #12503 |
Great idea! I haven't had the time to do much debugging here directly myself, but I've upvoted your discussion thread and I subscribed to it so I can see how things progress over there. |
I thought I might have some great insight by refactoring the flow to build a kernel with loadable modules instead of static linking, but I have exactly the same results: # lsmod
Module Size Used by
# modprobe zfs
# lsmod
Module Size Used by
zfs 4300800 0
zunicode 335872 1 zfs
zzstd 569344 1 zfs
zlua 172032 1 zfs
zavl 16384 1 zfs
icp 311296 1 zfs
zcommon 86016 2 zfs,icp
znvpair 69632 2 zfs,zcommon
spl 90112 6 zfs,icp,zzstd,znvpair,zcommon,zavl
# zpool create testpool /root/vdev1.img
cannot create 'testpool': no such pool or dataset |
Thanks, this works great. I did the same flow based on https://wsl.dev/wsl2-kernel-zfs/ and wrote a script somewhat like yours. I was trying to use this to create a unit testing environment for ZFS scripts, so my goal is to create a pool using temp files, run the tests and then discard the pool. I'm applying it to Ubuntu 20.04 (from the Microsoft Store.)
I used Linux 5.10.60 for my build, but as you did, ZFS 2.10, but zpool doesn't work:
Here's the same file-based temp file pool on a non-WSL VM with Ubuntu 20.04 built with the Ubuntu installer:
So I tried your excellent implementation, and it worked flawlessly, but I still end up in the same state.
Thanks for considering, I'm still digging, I will add more data if I find anything interesting.
The text was updated successfully, but these errors were encountered: