6

I want to activate the developer mode (to use the ubuntu subsystem), but I don't have admin account credentials. However, I have access to a cmd.exe with admin rights. So I can open regedit and use the powershell without restrictions. Some tutorials (this one for example) state that the dev mode can be easily activated by creating or setting special keys in the registry:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense

In my case these keys did not exist in the registry before, so I added them manually. Sadly, it does not work and dev mode is still inactive. I also tried to open the Settings App using the terminal (start ms-settings:) and enable dev mode using the GUI, but it seems like the start command ignores/flushes the admin previleges and the app asks for credentials.

OS: Win10
Build Version: 14393.1198

EDIT

Because of @magicandre1981 answer, I tried to run the following command

DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0

But I got this error:

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Error: 11

You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log

With the help of google, I found out that I have to use a different cmd.exe version located in C:\\Windows\native. So I navigated there and called cmd.exe. After that I got another error, that the current directory is invalid, but after navigating back to C:\\Windows\System32 the command finished without an error. However, it still does not work. I restarted the system and the dev mode is still not activated.

NaN
  • 3,501
  • 8
  • 44
  • 77

3 Answers3

8

In the cmd.exe that is running as admin, run the following 2 commands:

REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

and

DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0

Depending on Which Windows 10 Build you run, you may need to reboot the system to finish setup.

To enable the Linux Subsystem, open a cmd.exe as admin and run

DISM /Online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux
magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • I tried to run both commands and with minor changes (take a look at my revised answer) they successfully finished. It seems like the system downloaded all files and the reboot took a bit longer, because windows had to activate some features (I already thought it is working). Sadly, dev mode is still not enabled (could it be the case that I just enabled it for the admin user and not for my normal account?). However, cmd finds a command called bash, but when I call it it states that I have to activate dev mode first. – NaN May 24 '17 at 21:59
  • do you get any errors during reboot? when you run **DISM /Online /Get-Capabilities** is development mode/tools installed? – magicandre1981 May 25 '17 at 05:41
  • Dev mode is installed, but I have to run `C:\\Windows\sysnative\cmd.exe` and navigate to `C:\\Windows\System32` again to get this output`. When I try to run bash in the same console, I get "Error: 0x80070005". I googled this error and it seems like I don't have the right permissions, which is strage, because I am using the admin console. – NaN May 25 '17 at 11:39
  • run processmonitor and look which operation fails with "Error: 0x80070005" while running bash – magicandre1981 May 25 '17 at 17:58
  • There are some errors, but a BufferOverflow in MsMpEng.exe seems to be a big problem. There are also some entries for bash.sh (FILE LOCKED WITH ONLY READERS & NAME NOT FOUND for some RegOpenKey Operations) – NaN May 25 '17 at 21:12
  • no, bufferflow is expected, tools query data from reg with too small buffer and increase it later. this is noise and can be excluded. select Count Occurrences and double click here on the ACCESS DENIED entry to filter for ACCESS DENIED messages. now look which operation fails for bash – magicandre1981 May 26 '17 at 14:50
  • any progress about your issue? – magicandre1981 Jun 03 '17 at 06:52
  • Hi, not really... sry for the stupid question, but how can I find out which operation fails for bash? – NaN Jun 03 '17 at 12:38
  • in ProcessMonitor, [select Count Occurrences](https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/47/48/6811.183.PNG), double click on access denied to filter for this event. double click on the entry and here you can see what fails – magicandre1981 Jun 03 '17 at 15:44
  • There is no "Access Denied" event anymore. You can find a filtered process-log right here: https://www.dropbox.com/s/031wzf4e7rfcn3p/Logfile.PML?dl=0 – NaN Jun 08 '17 at 21:04
  • share unfiltered one – magicandre1981 Jun 09 '17 at 15:23
  • would it be ok for u if I send it to u per PM? – NaN Jun 28 '17 at 04:32
  • create a zip of the PML, add a password t it and share the zip via Dropbox. Now create a textfile with the password and upload this [txt file to my Dropbox](https://www.dropbox.com/request/3JWl1p7PwoIXcuwWJCNl) (only the Txt, not the zip, because my dropbox is full) – magicandre1981 Jun 28 '17 at 13:30
  • btw, in [latest RS3 (Fall Creators Update) Builds](https://blogs.msdn.microsoft.com/commandline/2017/06/08/developer-mode-no-longer-required-for-windows-subsystem-for-linux/) you no longer need to enable dev mode to install Linux subsystem. So if you can wait till September/October you can simply try to use the DISM command – magicandre1981 Jun 28 '17 at 13:34
  • I don't know if you got notified, but I uploaded the file in the morning. – NaN Jul 06 '17 at 10:42
  • yes, I got the file. But I have no idea why bash closes. Wait for Fall Creators Update v1709, here dev mode is no longer required. – magicandre1981 Jul 06 '17 at 15:13
0

Once in cmd/admin, run mmc compmgmt.msc and create yourself a user with administrator rights. Log in as that user, pwn.

Vesper
  • 18,599
  • 6
  • 39
  • 61
  • The IT-Support told me that it is not possible to add local administrator accounts (Or at least it would not make much sense) in this setting and that's why they gave me access to this admin-cmd.exe – NaN May 24 '17 at 22:10
0

There are official instructions:

https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging

To enable sideloading:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"

To enable developer mode:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

Bonus: to enable (outdated) SSH for UWP remote deployment & Windows Device Portal:

dism /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0

dism /Online /Get-CapabilityInfo /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0

See details about capability here: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/features-on-demand-non-language-fod?view=windows-10#developer-mode

gavenkoa
  • 45,285
  • 19
  • 251
  • 303