Problems building in WSL

Hi,

I wsl ubuntu on windows to make build and everytimes I have windows firewall which opens to block one file, dont know why, here the file;

\UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\ann\openwrt_7800\openwrt\staging_dir\host\bin\Faked

?

thanks

I would simply guess “same same but different” on this one. No matter what you still run Windows.

To make this work you need to run Linux for real on a virtual machine.

i would advise to use wsl2 for openwrt compilation (or for big buildroot in general as the io perf is bad on plain wsl)
that would also fix any sort of problem....

another idea would be to just add to the whitelist the entire openwrt dir... (no way you can get a virus from that)

No you most definitely do not.

I build in a WSL2 instance on a routine basis. (OP wasn't exactly clear as to whether he's using WSL1 - lots of people just say WSL when they are running WSL2...)

The only issue is that you need to remove some stuff from PATH that "make package/install" considers "dangerous"

#!/bin/sh
PATH=$(/usr/bin/printenv PATH | /usr/bin/perl -ne 'print join(":", grep { !/\/mnt\/[a-z]/ } split(/:/));')

If I don't do "source ~/.local/bin/removepath.sh" (which is where I put the script above) before building, package/install always fails

3 Likes

if defender is scanning wsl compilation process then it's definitely wsl1
about path there is a config in windows to disable the appending of windows PATH to wsl PATH still i don't have that problem

1 Like

I use wsl2, sorry.

The compilation is working but I wondered why Windows gives me this alert.

faked file is always in open wrt folder?

but it can't be.... defender doesn't scan wsl2 shared directory as it's all virtualized and on a virtual hard disk...

That doesn't seem to be the case, given the folder you included in your first post. That's a WSL1 file system.

what is the folder for the wsl2?

There isn't an equivalent folder. WSL2 uses a virtual harddisk.

Run WSL -l -v in powershell or a command prompt and it will tell you what version WSL you're using.

I made the update, now on wsl2, but not sure where is the folder if I use wsl2 to see my openwrt bin folder with my images?

You should end up with a 'Linux' icon in Explorer that you can use to access any WSL2 drives. Alternatively typing \\wsl.localhost into that path/address bar should get you to the same place.

ok so now I found it but I can't open it...

I got : cannot mount file it is in use

It's already mounted. You access it like a network drive, as I explained in my previous post...

Open \\wsl$\Ubuntu\home for example.

this one give me the wsl1 folder,
Ive installed the wsl2 and this one gives me problem.

I moved the ext4 folder to D:wsl-ubuntu folder, I see ext4 but I cant open it.

Stop trying to open the ext4 file. You can't. It's a mounted virtual drive.

If you want to access the linux file system you need to access it as if it were a network drive, so typing \\wsl$ in the path bar in explorer.

1 Like

Note that sometimes if you started with WSL1 and upgraded to WSL2, there's a registry key needed related to plan9fs or something like that for \\wsl$ to work

You know, we have a whole Wiki entry on this.

As for moving, you need to use wsl --export to crate the tar.gz, then wsl --terminate to remove it, then you can move it wherever you want via wsl --import. This is helpful for those (like me) who want to build on something other than the boot drive. Be sure to designate WHICH distro you are doing this to via wsl -d <distro> if you have more than 1 WSL distro setup.

EDIT: Because no one (including me) actually addressed part of the OP. Faked is used by fakeroot, which the build environment uses when it does it's thing. Your error is saying it can't find it, it just happens to have an unfortunate name. Follow the Wiki instructions to ensure that you have properly setup the build environment, and see if that doesn't fix the issue

3 Likes