Issue with 'dfx start' using windows 11 with WSL

Hi everyone,

I’m encountering an issue when trying to start the replica using dfx start on my Windows 11 machine with WSL. Here are the details:

Environment: Windows 11, WSL (Ubuntu)
DFX Version: 0.9.3
Replica Version: 0.8.0
When I run dfx start, I get the following error:

thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: “Crypto state directory /mnt/c/Users/angus/internet-computer-projects/opend/.dfx/state/replicated_state/node-100/crypto has permissions 0o40777, allowing general access”’, replica/src/setup.rs:324:75

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

It seems that the permissions of the crypto state directory are too permissive. I tried changing the permissions using chmod 700, but it didn’t resolve the issue. I also tried removing the [.dfx](vscode-file://vscode app/c:/Users/angus/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) directory and restarting the replica, but the problem persists.

Has anyone else encountered this issue or have any suggestions on how to fix it?

Thanks in advance for your help!

This is woefully outdated (2+ years) so I suggest you update to a more recent version.

That being said, the replica never reliably ran under windows/WSL. WSL1/2 both don’t fully implement the Linux API and the replica folks gave up on trying to support it since it caused too many complications. So currently there is no way to run the replica under WSL. Occasionally it may happen that it runs, but that would be a lucky coincidence

I suggest you use the dev container for local Windows development

@anguspersonal may I ask where you are coming from or which guide you used to end up with those outdated versions of DFX and replica?

This shows that the project is located within the Windows filesystem, not the WSL filesystem. WSL projects should always be in the WSL filesystem or odd things will happen.

/home/angus/internet-computer-projects would be the equivalent (depending on your WSL username) WSL directory to what you’re using now.

1 Like