I’m am following the steps found here for installing Rocky 9 in WSL 2:
and it isn’t working. Everything seems to go okay, but when I do ‘wsl -d rocky9’ I get into a Linux (rocky?) but I immediately get this error:
Processing fstab with mount -a failed.
And yeah, there is no /etc/fstab, so I guess I’m not surprised. And it is a weird installation, with lots of missing commands, like fdisk and even mount. I did the “Download the image” and tried both Base x86_64 and Minimal x86_64. The import step worked without complaints.
Any ideas on what to try next?
The “mount” command is unavailable in the image. It lives in the util-linux-core package.
dnf install util-linux-core solved the case for me.
Hmnm, that sounds like a good idea except I do not have dnf installed. Nor yum. Nor even rpm installed.
I fixed the fstab complaint by creating a fstab file. But it is still a weirdly incomplete install. Maybe the next step is to get dnf or yum or maybe rpm installed so I can move forward?
So, in the immortal words of Emily Litella … nevermind. If I just import the Base file, things are working fine and, like mrgleba says, if I install the util-linux-core, I even get mount back. I do get the error about fstab, but that’s only because fstab doesn’t exist and something is trying to use it. Maybe WSL2 automatically calls it? If I just create one like this:
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
/dev/usbdisk /media/usb vfat noauto,ro 0 0
even that error goes away. I just don’t think the Minimal install works very well for WSL2 import.
The error message is caused by the WSL automout. To prevent it you could disable automount in
reference: Advanced settings configuration in WSL | Microsoft Learn
Oh, that is good to know!