WSL for Windows OS permission error when compiling

I have set up WSL on Windows10. I have no issue compiling initially. Then for whatever reason I get an OS error that prevents compiling. I have cloned the Ardupilot Git repos twice and each time I get the same error after initially successfuly compiling.

File “/home/marcdornan/ardupilot/modules/waf/waflib/Node.py”, line 345, in listdir
lst = Utils.listdir(self.abspath())
OSError: [Errno 13] Permission denied: ‘/home/marcdornan/ardupilot/.settings’

I have have navigated to the WSL ardupilot directory in Win10 and given the WSL user full permissions and cannot seem to get past this. Any suggestions? Never had an issue with Cygwin64 on this machine.

1 Like

@Marc_Dornan good morning! If we use virtual machine, and if the os is up day, it will working fine in Ubuntu in Oracle virtual machine. Once try with this in Windows 10.

Thanks but the wiki says WSL works well so I would like to figure this out if I can.

Error is evident : permission problem. WSL, lol what else … I don’t understand why people like it so much as until you spend a lot of time in configuration, especially moving from wsl to wsl2 to have full virtualisation. We have bad feedback in professional context from our side and others with wsl. Better to install a VM in Virtualbox or Vmware : saving time…

List permissions in your WSL vm with :

ls -lha /home/marcdornan/ardupilot/

Change your permission to your user :

sudo chown $USER -R /home/marcdornan/ardupilot

Check again your permissions

Thanks Sylvain.

Yep, the error was evident alright. I am not very linux proficient.

So I ran this: $ sudo chown marcdornan -R /home/marcdornan/ardupilot
It accepted it and asked for a password. The file permissions do not seem to have changed if I am reading this correctly. The .settings file still seems to be denied to me.

marcdornan@DESKTOP-M2HFP4E:~/ardupilot$ ls -lha /home/marcdornan/ardupilot/
total 208K
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 .
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 17 00:01 …
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 .azure
---------- 1 marcdornan marcdornan 5.3K Oct 17 00:15 .cproject
-rw-r–r-- 1 marcdornan marcdornan 137 Oct 17 00:01 .dir-locals.el
-rw-r–r-- 1 marcdornan marcdornan 349 Oct 20 21:20 .dockerignore
-rw-r–r-- 1 marcdornan marcdornan 681 Oct 17 00:01 .editorconfig
-rw-r–r-- 1 marcdornan marcdornan 280 Oct 17 00:01 .flake8
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 .git
-rw-r–r-- 1 marcdornan marcdornan 117 Oct 17 00:01 .gitattributes
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 .github
-rw-r–r-- 1 marcdornan marcdornan 2.0K Oct 20 21:20 .gitignore
-rw-r–r-- 1 marcdornan marcdornan 679 Oct 17 00:01 .gitmodules
-rw-r–r-- 1 marcdornan marcdornan 12K Oct 20 21:21 .lock-waf_linux2_build
---------- 1 marcdornan marcdornan 837 Oct 17 00:15 .project
-rw-r–r-- 1 marcdornan marcdornan 307 Oct 17 00:01 .pydevproject
d--------- 1 marcdornan marcdornan 4.0K Oct 17 00:15 .settings
-rw-r–r-- 1 marcdornan marcdornan 2.3K Oct 20 21:20 .travis.yml
-rw-r–r-- 1 marcdornan marcdornan 167 Oct 17 00:01 .valgrind-suppressions
-rw-r–r-- 1 marcdornan marcdornan 38 Oct 17 00:01 .valgrindrc
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 AntennaTracker
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 ArduCopter
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 ArduPlane
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 ArduSub
-rw-r–r-- 1 marcdornan marcdornan 11K Oct 20 21:20 BUILD.md
-rw-r–r-- 1 marcdornan marcdornan 35K Oct 17 00:01 COPYING.txt
-rw-r–r-- 1 marcdornan marcdornan 1.3K Oct 20 21:20 Dockerfile
-rw-r–r-- 1 marcdornan marcdornan 63K Oct 17 00:01 Doxyfile.in
-rw-r–r-- 1 marcdornan marcdornan 3.4K Oct 20 21:20 Makefile
-rw-r–r-- 1 marcdornan marcdornan 6.6K Oct 20 21:20 README.md
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 Rover
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 Tools
-rw-r–r-- 1 marcdornan marcdornan 6.5K Oct 20 21:20 Vagrantfile
-rw-r–r-- 1 marcdornan marcdornan 828 Oct 17 00:01 appveyor.yml
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 17 00:01 benchmarks
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:21 build
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 17 00:01 docs
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 libraries
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 mk
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 17 00:01 modules
drwxr-xr-x 1 marcdornan marcdornan 4.0K Oct 20 21:20 tests
-rwxr-xr-x 1 marcdornan marcdornan 757 Oct 17 00:01 waf
-rw-r–r-- 1 marcdornan marcdornan 19K Oct 20 21:20 wscript

I am thinking I should should just go the VM route.

There is a problem yes but it’s just rights management. You could solve it easily now with 2 different command :

chmod +w -R  /home/marcdornan/ardupilot/

Meaning you add writing on files and directory recursively

or directly set rights with

chmod 775 -R  /home/marcdornan/ardupilot/

image

Thank you for the Linux tutorial! Much appreciated.

FYI. The first command did not work (returned the a permission write error) but #2 - explicitly setting the directory permissions did work.

That might be a good addition to the wiki for the WSL Ubuntu section. I had this error with two WSL installs.

But this kind of thing is linux basic rights handling ! You just want to know once of your life by checking with ls, change owner with chown and attribute rights with chmod. May be a simple advise is ok IMO but I will not contribute in any thing related to $dows

Btw is this wsl or wsl2

You are correct. It is basic linux stuff. I do not use linux much but I do use Eclipse and can code a little. Anyhow I am very grateful for your help. I already know more Linux than i did this morning.

1 Like