Giter VIP home page Giter VIP logo

Comments (8)

stardust85 avatar stardust85 commented on June 21, 2024 1

Now I made it work. Even under normal user. The ntfs extended attribute dll wasn't allowed to be executed for any user.

How to fix it:

  1. right-click on ntfsea_x64.dll (or x86 if you have 32 bit)
  2. properties
  3. tab Security
  4. Advanced
  5. remove all lines containing type Deny
  6. OK
  7. choose your user
  8. tick read and execute
  9. OK

from wsl-distribution-switcher.

stardust85 avatar stardust85 commented on June 21, 2024

when debugging with pdb:

> /cygdrive/c/Users/msamia/WSL-Distribution-Switcher/ntfsea.py(261)init()
-> ntfsea.lib = loader('ntfsea_%s.dll' % ('x64' if platform.architecture()[0] == '64bit' else 'x86'))
(Pdb)
OSError: Permission denied

from wsl-distribution-switcher.

stardust85 avatar stardust85 commented on June 21, 2024

Updating to Windows 10 Insider Preview 15031

from wsl-distribution-switcher.

stardust85 avatar stardust85 commented on June 21, 2024

Probably caused by cygwin http://stackoverflow.com/questions/3826484/using-python-ctypes-with-cygwin

from wsl-distribution-switcher.

RoliSoft avatar RoliSoft commented on June 21, 2024

The script was originally designed to work with the Windows distribution of Python. After the script was mostly finished, I added support for Cygwin, but it required a lot of hacks, since Cygwin ships the Linux version, so to speak, so a lot of Windows-specific functionalities are missing, lack of ctypes.WinDLL being one of them.

However, it is working on my Cygwin installation as the script is now, so it should work for you as well under normal circumstances.

I'll try recreating the issue so I can see what I can do about it, meanwhile, you can try the compiled version of the script: https://github.com/RoliSoft/WSL-Distribution-Switcher/releases

Currently, the compiled version is the latest version, and does not require separate Python runtime. Just run the exes from command prompt as you would run the scripts.

from wsl-distribution-switcher.

stardust85 avatar stardust85 commented on June 21, 2024

Upgraded to Updating to Windows 10 Insider Preview 15031. Specified explicit path to installed windows version of Python 3.6. Running from powershell.

PS C:\Users\msamia\WSL-Distribution-Switcher> git rev-parse HEAD
1adbfbca21e58c700c105e5bfe9165069d57d0cc
PS C:\Users\msamia\WSL-Distribution-Switcher>

PS C:\Users\msamia\WSL-Distribution-Switcher> C:\Users\msamia\AppData\Local\Programs\Python\Python36\python.exe .\install.py centos:7
[*] Probing the Linux subsystem...
[*] Default user is root at /root.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root...
[*] Beginning extraction...
[!] Failed to extract archive: [WinError 5] Access is denied
PS C:\Users\msamia\WSL-Distribution-Switcher>

The same happens when I run the powershell as administrator.

from wsl-distribution-switcher.

stardust85 avatar stardust85 commented on June 21, 2024

Minimum reproduction scenario on both versions 15031 and 14393.51 in powershell:

PS C:\Users\msamia\WSL-Distribution-Switcher> python -c 'from ntfsea import ntfsea; ntfsea.init()'
python : Traceback (most recent call last):
At line:1 char:1
+ python -c 'from ntfsea import ntfsea; ntfsea.init()' 2>&1|clip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
  File "<string>", line 1, in <module>
  File "C:\Users\msamia\WSL-Distribution-Switcher\ntfsea.py", line 261, in init
    ntfsea.lib = loader('ntfsea_%s.dll' % ('x64' if platform.architecture()[0] == '64bit' else 'x86'))
  File "C:\Users\msamia\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 344, in __init__
    self._handle = _dlopen(self._name, mode)
PermissionError: [WinError 5] Access is denied

from wsl-distribution-switcher.

RoliSoft avatar RoliSoft commented on June 21, 2024

Could you please check if this issue resolves itself if you run the script as administrator?

You don't need admin for the scripts, but for debugging purposes, let's make sure whether this is a genuine permission issue, or something else disguised as "Access is denied".

from wsl-distribution-switcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.