Error: 0x80070002
Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!
-
A brief description After update to Windows Insider Preview 14971 the Linux subsystem is broken.
-
Expected results Be able to run bash and update Ubuntu packages to the latest version.
-
Actual results (with terminal output if applicable) Microsoft Windows [Version 10.0.14971] (c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\rado>bash Error: 0x80070002 Press any key to continue...
-
Your Windows build number 10.0.14971
-
Steps / All commands required to reproduce the error from a brand new installation bash.exe
-
Strace of the failing command
-
Required packages and commands to install
See our contributing instructions for assistance.
lxrun /uninstall /full /y followed by lxrun /y fixed the problem and Ubuntu 16.04 has been installed replacing Ubuntu 14.04 .
Update has errors though as shown below:
Microsoft Windows Version 10.0.14971 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>bash root@IntersolPC:/mnt/c/Windows/System32# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: accountsservice apparmor apt-transport-https bind9-host cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf curl distro-info-data dnsutils initramfs-tools initramfs-tools-bin initramfs-tools-core isc-dhcp-client isc-dhcp-common kbd klibc-utils libaccountsservice0 libapparmor-perl libbind9-140 libcurl3-gnutls libdns-export162 libdns162 libisc-export160 libisc160 libisccc140 libisccfg140 libklibc liblwres141 liblxc1 libpam-systemd libssl1.0.0 libsystemd0 libudev1 lxc-common lxcfs lxd lxd-client multiarch-support open-iscsi openssl overlayroot pollinate python3-distupgrade python3-update-manager snap-confine snapd systemd systemd-sysv tzdata ubuntu-core-launcher ubuntu-release-upgrader-core udev unattended-upgrades update-manager-core update-notifier-common vlan 57 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 7 not fully installed or removed. Need to get 0 B/23.4 MB of archives. After this operation, 531 kB disk space will be freed. Do you want to continue? [Y/n] y Extracting templates from packages: 100% Preconfiguring packages ... (Reading database ... 26096 files and directories currently installed.) Preparing to unpack .../libsystemd0_229-4ubuntu12_amd64.deb ... Unpacking libsystemd0:amd64 (229-4ubuntu12) over (229-4ubuntu8) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Setting up libsystemd0:amd64 (229-4ubuntu12) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... (Reading database ... 26096 files and directories currently installed.) Preparing to unpack .../libpam-systemd_229-4ubuntu12_amd64.deb ... Unpacking libpam-systemd:amd64 (229-4ubuntu12) over (229-4ubuntu8) ... Preparing to unpack .../systemd_229-4ubuntu12_amd64.deb ... Unpacking systemd (229-4ubuntu12) over (229-4ubuntu8) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for ureadahead (0.100.0-19) ... Setting up systemd (229-4ubuntu12) ... Initializing machine ID from random generator. addgroup: The group
systemd-journal' already exists as a system group. Exiting. Failed to set capabilities on file/usr/bin/systemd-detect-virt' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file Operation failed: No such file or directory (Reading database ... 26096 files and directories currently installed.) Preparing to unpack .../udev_229-4ubuntu12_amd64.deb ... Unpacking udev (229-4ubuntu12) over (229-4ubuntu8) ... Preparing to unpack .../libudev1_229-4ubuntu12_amd64.deb ... Unpacking libudev1:amd64 (229-4ubuntu12) over (229-4ubuntu8) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for systemd (229-4ubuntu12) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Setting up libudev1:amd64 (229-4ubuntu12) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... (Reading database ... 26096 files and directories currently installed.) Preparing to unpack .../klibc-utils_2.0.4-8ubuntu1.16.04.2_amd64.deb ... Unpacking klibc-utils (2.0.4-8ubuntu1.16.04.2) over (2.0.4-8ubuntu1.16.04.1) ... Preparing to unpack .../initramfs-tools_0.122ubuntu8.5_all.deb ... Unpacking initramfs-tools (0.122ubuntu8.5) over (0.122ubuntu8.1) ... Preparing to unpack .../initramfs-tools-core_0.122ubuntu8.5_all.deb ... Unpacking initramfs-tools-core (0.122ubuntu8.5) over (0.122ubuntu8.1) ... Preparing to unpack .../initramfs-tools-bin_0.122ubuntu8.5_amd64.deb ... Unpacking initramfs-tools-bin (0.122ubuntu8.5) over (0.122ubuntu8.1) ... Preparing to unpack .../libklibc_2.0.4-8ubuntu1.16.04.2_amd64.deb ... Unpacking libklibc (2.0.4-8ubuntu1.16.04.2) over (2.0.4-8ubuntu1.16.04.1) ... Preparing to unpack .../systemd-sysv_229-4ubuntu12_amd64.deb ... Unpacking systemd-sysv (229-4ubuntu12) over (229-4ubuntu8) ... Processing triggers for man-db (2.7.5-1) ... Setting up systemd-sysv (229-4ubuntu12) ... (Reading database ... 26096 files and directories currently installed.) Preparing to unpack .../libapparmor-perl_2.10.95-0ubuntu2.5_amd64.deb ... Unpacking libapparmor-perl (2.10.95-0ubuntu2.5) over (2.10.95-0ubuntu2.2) ... Preparing to unpack .../apparmor_2.10.95-0ubuntu2.5_amd64.deb ... Unpacking apparmor (2.10.95-0ubuntu2.5) over (2.10.95-0ubuntu2.2) ... Preparing to unpack .../liblxc1_2.0.5-0ubuntu1~ubuntu16.04.2_amd64.deb ... Unpacking liblxc1 (2.0.5-0ubuntu1~ubuntu16.04.2) over (2.0.4-0ubuntu1~ubuntu16.04.2) ... Preparing to unpack .../lxc-common_2.0.5-0ubuntu1~ubuntu16.04.2_amd64.deb ... Unpacking lxc-common (2.0.5-0ubuntu1~ubuntu16.04.2) over (2.0.4-0ubuntu1~ubuntu16.04.2) ... Preparing to unpack .../lxcfs_2.0.4-0ubuntu1~ubuntu16.04.1_amd64.deb ... Unpacking lxcfs (2.0.4-0ubuntu1~ubuntu16.04.1) over (2.0.3-0ubuntu1~ubuntu16.04.1) ... Preparing to unpack .../lxd_2.0.5-0ubuntu1~ubuntu16.04.1_amd64.deb ... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of stop. Unpacking lxd (2.0.5-0ubuntu1~ubuntu16.04.1) over (2.0.4-0ubuntu1~ubuntu16.04.1) ... invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of stop. Preparing to unpack .../open-iscsi_2.0.873+git0.3b4b4500-14ubuntu3.1_amd64.deb ... Unpacking open-iscsi (2.0.873+git0.3b4b4500-14ubuntu3.1) over (2.0.873+git0.3b4b4500-14ubuntu3) ... Preparing to unpack .../snap-confine_1.0.43-0ubuntu1~16.04.1_amd64.deb ... Unpacking snap-confine (1.0.43-0ubuntu1~16.04.1) over (1.0.38-0ubuntu0.16.04.8) ... Preparing to unpack .../ubuntu-core-launcher_1.0.43-0ubuntu1~16.04.1_amd64.deb ... Unpacking ubuntu-core-launcher (1.0.43-0ubuntu1~16.04.1) over (1.0.38-0ubuntu0.16.04.8) ... Preparing to unpack .../update-notifier-common_3.168.2_all.deb ... Unpacking update-notifier-common (3.168.2) over (3.168.1) ... Preparing to unpack .../multiarch-support_2.23-0ubuntu4_amd64.deb ... Unpacking multiarch-support (2.23-0ubuntu4) over (2.23-0ubuntu3) ... Processing triggers for systemd (229-4ubuntu12) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Setting up multiarch-support (2.23-0ubuntu4) ... (Reading database ... 26098 files and directories currently installed.) Preparing to unpack .../tzdata_2016h-0ubuntu0.16.04_all.deb ... Unpacking tzdata (2016h-0ubuntu0.16.04) over (2016f-0ubuntu0.16.04) ... Preparing to unpack .../distro-info-data_0.28ubuntu0.2_all.deb ... Unpacking distro-info-data (0.28ubuntu0.2) over (0.28ubuntu0.1) ... Preparing to unpack .../libisc-export160_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libisc-export160 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libdns-export162_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libdns-export162 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../isc-dhcp-client_4.3.3-5ubuntu12.4_amd64.deb ... Unpacking isc-dhcp-client (4.3.3-5ubuntu12.4) over (4.3.3-5ubuntu12.1) ... Preparing to unpack .../isc-dhcp-common_4.3.3-5ubuntu12.4_amd64.deb ... Unpacking isc-dhcp-common (4.3.3-5ubuntu12.4) over (4.3.3-5ubuntu12.1) ... Preparing to unpack .../kbd_1.15.5-1ubuntu5_amd64.deb ... Unpacking kbd (1.15.5-1ubuntu5) over (1.15.5-1ubuntu4) ... Preparing to unpack .../libssl1.0.0_1.0.2g-1ubuntu4.5_amd64.deb ... Unpacking libssl1.0.0:amd64 (1.0.2g-1ubuntu4.5) over (1.0.2g-1ubuntu4.4) ... Preparing to unpack .../accountsservice_0.6.40-2ubuntu11.3_amd64.deb ... Unpacking accountsservice (0.6.40-2ubuntu11.3) over (0.6.40-2ubuntu11.2) ... dpkg: error processing archive /var/cache/apt/archives/accountsservice_0.6.40-2ubuntu11.3_amd64.deb (--unpack): unable to open '/usr/lib/accountsservice/accounts-daemon.dpkg-new': Permission denied dmesg: read kernel buffer failed: Function not implemented /bin/df: /proc/sys/fs/binfmt_misc: Operation not permitted Preparing to unpack .../libaccountsservice0_0.6.40-2ubuntu11.3_amd64.deb ... Unpacking libaccountsservice0:amd64 (0.6.40-2ubuntu11.3) over (0.6.40-2ubuntu11.2) ... Preparing to unpack .../curl_7.47.0-1ubuntu2.2_amd64.deb ... Unpacking curl (7.47.0-1ubuntu2.2) over (7.47.0-1ubuntu2.1) ... Preparing to unpack .../libcurl3-gnutls_7.47.0-1ubuntu2.2_amd64.deb ... Unpacking libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.2) over (7.47.0-1ubuntu2.1) ... Preparing to unpack .../apt-transport-https_1.2.15_amd64.deb ... Unpacking apt-transport-https (1.2.15) over (1.2.12~ubuntu16.04.1) ... Preparing to unpack .../bind9-host_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking bind9-host (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../dnsutils_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking dnsutils (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libisc160_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libisc160:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libdns162_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libdns162:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libisccc140_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libisccc140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libisccfg140_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libisccfg140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../liblwres141_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking liblwres141:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../libbind9-140_1%3a9.10.3.dfsg.P4-8ubuntu1.2_amd64.deb ... Unpacking libbind9-140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.2) over (1:9.10.3.dfsg.P4-8ubuntu1) ... Preparing to unpack .../openssl_1.0.2g-1ubuntu4.5_amd64.deb ... Unpacking openssl (1.0.2g-1ubuntu4.5) over (1.0.2g-1ubuntu4.4) ... Preparing to unpack .../ubuntu-release-upgrader-core_1%3a16.04.18_all.deb ... Unpacking ubuntu-release-upgrader-core (1:16.04.18) over (1:16.04.16) ... Preparing to unpack .../python3-distupgrade_1%3a16.04.18_all.deb ... Unpacking python3-distupgrade (1:16.04.18) over (1:16.04.16) ... Preparing to unpack .../python3-update-manager_1%3a16.04.4_all.deb ... Unpacking python3-update-manager (1:16.04.4) over (1:16.04.3) ... Preparing to unpack .../update-manager-core_1%3a16.04.4_all.deb ... Unpacking update-manager-core (1:16.04.4) over (1:16.04.3) ... Preparing to unpack .../lxd-client_2.0.5-0ubuntu1~ubuntu16.04.1_amd64.deb ... Unpacking lxd-client (2.0.5-0ubuntu1~ubuntu16.04.1) over (2.0.4-0ubuntu1~ubuntu16.04.1) ... Preparing to unpack .../pollinate_4.23-0ubuntu1~16.04_all.deb ... Unpacking pollinate (4.23-0ubuntu1~16.04) over (4.21-0ubuntu1~16.04) ... Preparing to unpack .../snapd_2.16ubuntu3_amd64.deb ... Unpacking snapd (2.16ubuntu3) over (2.14.2~16.04) ... Preparing to unpack .../unattended-upgrades_0.90ubuntu0.2_all.deb ... Unpacking unattended-upgrades (0.90ubuntu0.2) over (0.90) ... Preparing to unpack .../cloud-init_0.7.8-1-g3705bb5-0ubuntu1~16.04.3_all.deb ... Unpacking cloud-init (0.7.8-1-g3705bb5-0ubuntu1~16.04.3) over (0.7.8-1-g3705bb5-0ubuntu1~16.04.1) ... Preparing to unpack .../cloud-initramfs-copymods_0.27ubuntu1.2_all.deb ... Unpacking cloud-initramfs-copymods (0.27ubuntu1.2) over (0.27ubuntu1) ... Preparing to unpack .../cloud-initramfs-dyn-netconf_0.27ubuntu1.2_all.deb ... Unpacking cloud-initramfs-dyn-netconf (0.27ubuntu1.2) over (0.27ubuntu1) ... Preparing to unpack .../overlayroot_0.27ubuntu1.2_all.deb ... Unpacking overlayroot (0.27ubuntu1.2) over (0.27ubuntu1) ... Preparing to unpack .../vlan_1.9-3.2ubuntu1.16.04.1_amd64.deb ... Unpacking vlan (1.9-3.2ubuntu1.16.04.1) over (1.9-3.2ubuntu1) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for systemd (229-4ubuntu12) ... Errors were encountered while processing: /var/cache/apt/archives/accountsservice_0.6.40-2ubuntu11.3_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) root@IntersolPC:/mnt/c/Windows/System32#
Looks like this is a duplicate of #1378.
I had an install that was working, sort of. I tried to edit my non-root account's .bashrc file using my Windows install of jEdit, and it appeared that the file became unreadable by my non-root account. ls -l showed it as being owned by root, and in root's group; I'd run chown on it, and chown would claim it had changed the owner to my non-root name, but ls -l showed no change.
I eventually gave up and tried the uninstall, but got the dreaded 0x80070002 error when I tried to run bash. (That's running from a non-admin cmd; if you run it from the Start menu, you get a momentary flicker, nothing more.)
I eventually tried the full uninstall: lxrun /uninstall /full, turn off "Windows Subsystem for Linux" in the Control Panel, delete the hidden lxss dir under AppData/Local/ (except Windows refuses to delete the rootfs subdir, which seems to be a link to the root of the C: drive). Reboot, turn "Windows Subsystem for Linux" back on, reboot again, run lxrun /install from an admin cmd prompt, then run set default user.... Now I can log in to that account from an admin cmd prompt, but trying to log in from a non-admin cmd prompt still gives the 0x80070002 error.
From that admin-based bash shell, I can run sudo apt-get update, then sudo apt-get upgrade (bunch of stuff), and even sudo apt-get dist-upgrade. Still get 80070002 error when trying to start bash from a non-administrator cmd prompt.
I shouldn't have to have to be admin just to run bash. What gives? Is there progress on this bug? Do you need any logs, or can I test s.t. for you?
BTW, I have checked that bash.exe has read & execute permissions for all users.
Possible clue to my problem (dunno if it has anything to do with any of the other 80070002 problems): It turns out the new account that I've been trying to log in under is located under c:\users\Admin\AppData\Local\lxss, whereas my own Windows home is c:\users\maxwell\AppData\Local\lxss. So maybe what it's telling me is that there is no accessible account for maxwell. How to fix? How to setup an account for linux user maxwell under Windows user maxwell, so I don't have to log in under an admin account?
@mcswell -- this sounds like a new issue. Could you open up a new ticket?
Sure (I fly out of town in a couple hours, so if I don't get to this now, it will be a week). I'm not sure which part is new, the part where I can't create a Linux account under my non-admin Windows username?
@mcswell - Looking forward to the new issue.
1. You cannot modify files located in %localappdata%\lxss with windows editors due to a current limitation of how Linux file attributes are stored. To recover these files I suggest copying them to a DrvFs mount (/mnt/c etc) and copying them back to the original location from within a bash shell.
2. You do not need to be a Windows administrator to create usernames. The command to create a new user account is: lxrun.exe /setdefaultuser@mcswell - Looking forward to the new issue.
1. You cannot modify files located in %localappdata%\lxss with windows editors due to a current limitation of how Linux file attributes are stored. To recover these files I suggest copying them to a DrvFs mount (/mnt/c etc) and copying them back to the original location from within a bash shell.
2. You do not need to be a Windows administrator to create usernames. The command to create a new user account is: lxrun.exe /setdefaultuser
@rcconsult - The issue in your second comment is being investigate internally. As of right now it looks like a bug that we've uncovered in Windows Defender.
ok, will do. For the record, the bug I'm going to submit is that I can only run 'lxrun.exe /setdefaultuser' under the Administrator's cmd
Done, issue 1520. Feel free to delete any of my msgs on this 1393 thread. (BTW, re your comment above about Windows Defender, I'm running Avira antivirus.)
@mcswell -- thanks for posting the new ticket ( #1520 )! Hopefully that'll get you a quick answer.
Regarding "not sure which part is new", as it turns out, I would actually say "all of it" :-) It was certainly reasonable for you to post here first; I'm just triaging based on experience.
One observation: According to #1520 , you're running build 14393. That's the latest Windows stable build. The OP on this thread is running build 14971, which is an Insider pre-release build. A lot has changed about WSL since Windows's latest stable release; those changes are only available in Insider builds. For example, the OP discusses having antivirus-related issues that appear to be specific to Ubuntu 16.04. The version of Windows that you are running does not (officially) support Ubuntu 16.04 at all. So that's presumably not relevant to you?
Also, the OP's problem appears to have been triggered by upgrading to a recent pre-release build. Your issue was apparently triggered by editing a Linux file from Windows. These are, as it turns out, both interesting potential causes of bugs, and they imply rather different things. The OP's implies a regression in a recent Insider build. (It happens; that's what pre-release builds are for.) Yours implies an issue whose underlying cause may well be related to the issues discussed in this blog post:
https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
For any that run into this issue from Windows Fall Creator's Update (using Ubuntu from the Windows Store), you can run the following command to uninstall Ubuntu app so you can reinstall:
Get-AppxPackage *Ubuntu* | Remove-AppxPackage