Code Monkey home page Code Monkey logo

wsl-distribution-switcher's Introduction

Windows Subsystem for Linux Distribution Switcher

The purpose of this project is to let you easily download and install new Linux distributions under Windows Subsystem for Linux and seamlessly switch between them.

The rootfs archives are currently downloaded from Docker Hub's official images' repositories ("source") or published image layers ("prebuilt").

If you want to read about some of the challenges I faced while implementing the scripts, you can check out this blog post. This readme only contains usage information and some troubleshooting.

Usage

The scripts provided here are written in Python 3, and they need to be run from Windows, NOT from WSL. You can download a Python 3 installer from their official website, or you can use the one bundled with Cygwin. Since WSL is stored in %LocalAppData% for each user, you don't need admin rights in order to use any of the scripts.

To begin, clone the repository or download a copy of it.

Obtaining tarballs

get-source.py

This script can download the tarballs for the official images in Docker Hub.

The first argument of the script is the name of the image, optionally followed by a colon and the desired tag: get-source.py image[:tag]. For example, to get the rootfs tarball for Debian Sid, just run get-source.py debian:sid. If you don't specify a tag, latest will be used, which is generally the stable edition of the distribution.

$ python get-source.py debian:sid
[*] Fetching official-images info for debian:sid...
[*] Fetching Dockerfile from repo tianon/docker-brew-debian/.../sid...
[*] Downloading archive https://raw.githubusercontent.com/.../sid/rootfs.tar.xz...
[*] Rootfs archive for debian:sid saved to rootfs_debian_sid.tar.xz.

For presentation purposes, the following images and tags are available as of August 18th:

  • debian – 8.5, 8, jessie, latest | jessie-backports | oldstable | oldstable-backports | sid | stable | stable-backports | stretch | testing | unstable | 7.11, 7, wheezy | wheezy-backports | rc-buggy | experimental
  • ubuntu – 12.04.5, 12.04, precise-20160707, precise | 14.04.5, 14.04, trusty-20160802, trusty | 16.04, xenial-20160809, xenial, latest | 16.10, yakkety-20160806.1, yakkety, devel
  • fedora – latest, 24 | 23 | 22 | 21 | rawhide | 20, heisenbug
  • centos – latest, centos7, 7 | centos6, 6 | centos5, 5 | centos7.2.1511, 7.2.1511 | centos7.1.1503, 7.1.1503 | centos7.0.1406, 7.0.1406 | centos6.8, 6.8 | centos6.7, 6.7 | centos6.6, 6.6 | centos5.11, 5.11
  • opensuse – 42.1, leap, latest | 13.2, harlequin | tumbleweed
  • mageia – latest, 5
  • oraclelinux – latest, 7, 7.2 | 7.1 | 7.0 | 6, 6.8 | 6.7 | 6.6 | 5, 5.11
  • alpine – 3.1 | 3.2 | 3.3 | 3.4, latest | edge
  • crux – latest, 3.1
  • clearlinux – latest, base

get-prebuilt.py

This script can download the layers of the prebuilt images published on Docker Hub. This is what Docker downloads when you run docker pull.

The first argument of the script is the name of the image, optionally followed by a colon and the desired tag: get-prebuilt.py image[:tag]. For example, to get the rootfs tarball for Debian Sid, just run get-prebuilt.py debian:sid. If you don't specify a tag, latest will be used, which is generally the stable edition of the distribution.

$ python get-prebuilt.py kalilinux/kali-linux-docker
[*] Requesting authorization token...
[*] Fetching manifest info for kalilinux/kali-linux-docker:latest...
[*] Downloading layer sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4...
[*] Downloading layer sha256:6e61dde25369335dcf17965aa372c086db53c8021e885df0e09f9c4536d3231e...
[*] Downloading layer sha256:45f74187929d366242688b3d32ccb5e86c205214071b99e94c0214e7ff2bc836...
[*] Downloading layer sha256:e5b4b71338633a415ad948734490e368e69605ba508a5fa8ad64775433798fb2...
[*] Downloading layer sha256:3f96326089c0580ebbcbb68d2f49dce1d7b6fe5cd79d211e4c887b0c9cdbeb02...
[*] Downloading layer sha256:d4ecedcfaa73285da5657fd51173fa9955468bf693332c03dce58ded73615c62...
[*] Downloading layer sha256:340395ad18dbbbd79d902342eef997fbd3ecb6679ad5005e5e714e8b0bc11e77...
[*] Downloading layer sha256:b2860afd831e842446489d37f8933c71dbd4f5d5f4b13d35185c4341fcca9a84...
[*] Rootfs archive for kalilinux/kali-linux-docker:latest saved to rootfs_kali....tar.gz.

Installing new rootfs

The install.py script is responsible for installing the tarballs as new rootfs.

The first argument of the script is either the a) name of the file or the b) same image:tag notation used in the get.py script: install.py image[:tag] | tarball | squashfs. You can install tarballs from sources other than the Docker Hub, however, they're not guaranteed to work.

The specified file can be a .tar* archive, or a SquashFS image with .sfs or .squashfs extension. In order to process SquashFS images, the PySquashfsImage Python module nees to be installed, which you can do with pip3 install PySquashfsImage.

To install the freshly downloaded rootfs_debian_sid.tar.xz archive, run install.py debian:sid or install.py rootfs_debian_sid.tar.xz.

$ python install.py debian:sid
[*] Probing the Linux subsystem...
[*] Default user is RoliSoft at /home/RoliSoft.
[*] Switching default user to root...
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root and RoliSoft...
[*] Removing leftover rootfs-temp...
[*] Copying rootfs_debian_sid.tar.xz to /root/rootfs-temp...
[*] Beginning extraction...
[*] Waiting for the Linux subsystem to exit...
[*] Backing current rootfs to rootfs_ubuntu_trusty...
[*] Switching to new rootfs...
[*] Writing entries of root and RoliSoft to /etc/{passwd,shadow,group,gshadow}...
[*] Switching default user back to RoliSoft...

This operation extracts the tarball into your home directory in WSL, then replaces the current rootfs with the new one.

Earlier version of this script spawned a new WSL shell, and ran the extraction command under the subsystem. For newer versions, the bundled ntfsea library provides functionality to write the NTFS extended attributes required for VoIFS, and as such, extraction now happens without the involvement of WSL. This means that broken rootfs installations can now be repaired to some extent, since the WSL does not have to be able to start beforehand.

Running bash after installation should launch the new distribution:

> bash
$ cat /etc/debian_version
stretch/sid

Post-install hook scripts

It's possible to write hook scripts which are copied to WSL and run as root by the installer during the initial installation.

Hooks have the file naming convention hook_<event>_<label>.sh, where:

  • event – Only postinstall is supported currently. Open a ticket if you have suggestions for more.
  • label
    • all – Runs on all installations. Make sure to have your script check if the current environment is suitable and exit gracefully if not, otherwise you might end up breaking some of your installations.
    • image – Runs on name of the image, which is the first argument before the tag separator. E.g. debian in debian:sid.
    • label – Runs on a specific label. E.g. debian_sid for debian:sid; see the value in /.switch_label, but it's generally the tag-separator replaced from : to _.

The hook scripts are currently run in the order of least to most specific: all -> image -> label.

The installer will set the REGULARUSER environmental variable to the name of your regular user.

To prevent the invocation of the hook scripts, specify the --no-hooks argument to the installer.

Sample global hook script

A sample global hook script is provided in hook_postinstall_all.sample.sh. If you would like to run this during all of your installations, remove the .sample from the file name.

The provided script supports Arch Linux, APT-based (such as Debian and Ubuntu) and RPM-based (such as Fedora and CentOS) distributions. For all other distributions, it will gracefully terminate.

As noted above, the REGULARUSER environmental variable will be provided by install.py, which is the name of your regular user. This value will be used to add your user to the corresponding sudo group, e.g. sudo on Debian/Ubuntu and wheel on Fedora/CentOS.

If you would like your user to be added directly to sudoers with NOPASSWD, send SUDONOPASSWD=1 as an environmental variable.

The ROOTPASSWD environmental variable should contain the password to set for the root account. If this is not specified, the root password will not be reset. On most distributions the root account has no password, i.e. it is locked.

Additionally, the WINVER environmental variable allows for feature detection of the LXSS, so patches can be applied accordingly. E.g. chroot became available in 14936, so fakeroot workarounds are not required anymore.

On Arch Linux, the AUR helper pacaur will be installed unless WITHOUTPACAUR=1 is set as an environmental variable.

The script does the following:

  • Upgrades the system, installs some critical missing packages. (Such as apt-utils on Debian.)
  • Fixes locale warnings with apt/dpkg.
  • Resets the root password, if asked.
  • Installs sudo and adds user to corresponding sudo group or directly to sudoers.
  • Fixes sudo hostname resolution warning.
  • Installs pacaur and patched fakeroot for makepkg on Arch, and if WSL build is older than 14936, chroot() faker for pacman.
  • Installs basic dependencies required to install new distributions.
  • Installs git, vim, tmux.

Switching between distributions

The switch.py script is responsible for switching between the installed distributions.

All installed distributions are labelled through a .switch-label file in the root directory. This is created from Windows, so it is not visible from within WSL and is only used by the switcher script.

When switching between distributions, the rootfs folder is renamed: the old one will get the value from the .switch-label file appended to it, e.g. rootfs_debian_sid, while the new one will be renamed from its rootfs_ubuntu_trusty name to rootfs in order to become the active one.

The /home, /root and similar directories are stored separately, and as such switching between distributions can be seamless, as your personal and dotfiles will persist and will never be touched during any operation.

The default installation is Ubuntu Trusty. Any rootfs directory with no switch label inside will automatically be labelled ubuntu:trusty, so this is the argument you'll have to specify if you want to go back to the original installation.

When the script is run without any arguments, the list of installed distributions will be returned:

$ python switch.py
usage: ./switch.py image[:tag]

The following distributions are currently installed:

  - debian:sid*
  - fedora:rawhide
  - ubuntu:trusty

To switch back to the default distribution, specify ubuntu:trusty as the argument.

To switch between the distributions, just run the script with the image:tag you want to switch to:

$ python switch.py fedora:rawhide
[*] Probing the Linux subsystem...
[*] Moving current rootfs to rootfs_ubuntu_trusty...
[*] Moving desired rootfs_fedora_rawhide to rootfs...

$ bash -c 'dnf --version'
1.1.9
  Installed: dnf-0:1.1.9-6.fc26.noarch at 2016-08-12 08:30
  Built    : Fedora Project at 2016-08-09 16:53
	...

$ python switch.py debian:sid
[*] Probing the Linux subsystem...
[*] Moving current rootfs to rootfs_fedora_rawhide...
[*] Moving desired rootfs_debian_sid to rootfs...

$ bash -c 'apt-get -v'
apt 1.3~pre2 (amd64)
Supported modules:
*Ver: Standard .deb
	...

As mentioned before, switching is just 2 directory rename operations. However, WSL cannot be running while this is happening.

To-do list

  • Figure out pulling and merging the layers from Docker Hub directly, in order to support all published prebuilt images. The procedure is thoroughly documented on the Docker Registry HTTP API V2 page, however, merging the downloaded layers might present an issue. Done, see get-prebuilt.py.

  • Check whether extracting the SquashFS files from within ISO images to a rootfs works as well as Docker's rootfs tarballs. If so, implement new installer to automate it. Done, installer now supports SquashFS images as the first argument.

  • Implement hooks, so patches can be applied to fix WSL issues on a per-image basis, or just user-specific ones, such as preinstalling a few packages. Done, see section "Post-install hook scripts".

  • Figure out if it's possible to attach the Linux-specific metadata from outside of WSL, so then tarballs can be extracted and processed without invoking WSL. Done, installation now happens without spawning WSL for extraction. If you wish to use this in your own project, see ntfsea.[c|py].

Looks like all the challenges I listed here initially have been solved. Feel free to open a new ticket if you have any suggestions on how the project could be enhanced.

Troubleshooting

  • no root rights / no sudo / su -l fails with Authentication failure

The script migrates both your regular user and root's password, however, for some reason I found it to be not working perfectly with all distributions in case of root.

In any case, to fix this, you can switch the default user to root on WSL and then reset the root password with with:

> lxrun /setdefaultuser root
> bash
$ passwd

Logging in with su -l as root should work now. If passwd is not available, you can install it with the package manager of the distribution. Same goes with sudo, just make sure to edit the sudoers with visudo to empower your regular account.

  • sudo fails with no tty present and no askpass program specified

This happens if your WSL is from the AU update. Subsequent Insider builds do not have this issue. A workaround for this issue is to run it with sudo -S, which instructs sudo to read the password from stdin.

You can add an alias for this workaround to your .bash_profile:

alias sudo="sudo -S"
  • pacman fails with could not change the root directory (Function not implemented)

This happens because WSL did not support chroot() before build 14936, and you are running one of them. A workaround for this issue, albeit not a clean solution, is to mock the chroot() function.

To compile a library with a no-op chroot(), run:

echo 'int chroot(const char *path){return 0;}' > chroot.c
gcc chroot.c -shared -fPIC -o libmockchroot.so

You can then inject this via LD_PRELOAD, during each command execution:

LD_PRELOAD=libmockchroot.so pacman ...

If you installed Arch Linux with the provided global hook script and your WSL was detected not to have chroot support, a library was already written to /lib64/libmockchroot.so and added to /etc/ld.so.preload, so you will not need to compile it manually or specify it everytime with LD_PRELOAD.

You can view its source and compilation instructions in the libmockchroot.so gist.

  • get-source.py returns "Failed to find a suitable rootfs specification in Dockerfile."

The Dockerfile has no ADD archive.tar / directive. All suitable Linux distributions are packaged similarly and added into root with this directive. Its absence may mean you are trying to download an application based on an OS instead, or the Dockerfile for the operating system is a bit more complex than just "add these files".

FROM directives are not currently processed. Try downloading the image with get-prebuilt.py.

  • install.py returns an error after "Beginning extraction..."

Earlier versions of the script invoked WSL for the extraction part, and this proved quite problematic in scenarios where some depedencies were missing in the distribution, it was behaving in a non-standard way, or the current WSL was broken to begin with.

Current versions of the script extract the archives from Windows and write the necessary NTFS extended attributes for WSL at the same time. This is less errorprone, and does not require a working rootfs to be present.

In case you get errors with the newer versions, open %LocalAppData%\lxss from Windows Explorer and try checking if you have permission to write into the /root or /home/username directories. Also check if there are any leftover rootfs-temp directories in them, if so, make sure to delete them.

Screenshots

installation

switching

wsl-distribution-switcher's People

Contributors

cry avatar jameshartig avatar josip-stanic avatar luckcolors avatar rolisoft avatar srgom avatar tobix avatar yyjdelete avatar zmedico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wsl-distribution-switcher's Issues

Failed to fetch manifest info for distro: HTTP Error 404: NOT FOUND

Not sure why but I seem to be getting errors for any of the tagged official distros, but not 3rd party. Anyone have any ideas why this might be?


C:\Users\USER\Code\WSL-Distribution-Switcher>python get-prebuilt.py alpine:latest
[*] Requesting authorization token...
[*] Fetching manifest info for alpine:latest...
[!] Failed to fetch manifest info for alpine: HTTP Error 404: NOT FOUND

C:\Users\USER\Code\WSL-Distribution-Switcher>python get-prebuilt.py ubuntu:trusty
[*] Requesting authorization token...
[*] Fetching manifest info for ubuntu:trusty...
[!] Failed to fetch manifest info for ubuntu: HTTP Error 404: NOT FOUND

C:\Users\USER\Code\WSL-Distribution-Switcher>python get-prebuilt.py pritunl/archlinux
[*] Requesting authorization token...
[*] Fetching manifest info for pritunl/archlinux:latest...
[*] Downloading layer sha256:fa15d8aec9382c4924fd3ec2f716d6d7733acdcb5ce2dff508e0a783dbe2d469...

Unable to use bash.exe after installing centos:6

Using WSL on Windows build 10.0.14393 centos:6 installs without and warnings/errors. However, when trying to run bash.exe it silently exists with a non-zero exit code.

C:\WSL-Distribution-Switcher-master>python.exe install.py centos:6
[*] Probing the Linux subsystem...
[*] Default user is root at /root.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root...
[*] Beginning extraction...
[*] Backing up current rootfs to rootfs_ubuntu_trusty...
[*] Switching to new rootfs...
[*] Writing entries of root to /etc/{passwd,shadow,group,gshadow}...

C:\WSL-Distribution-Switcher-master>bash.exe

C:\>echo %ERRORLEVEL%
139

C:\>

goreliu's fakefakeroot hack

Hiya, @RoliSoft I noticed you pushed an update today to support Arch, and I saw that you added @goreliu 's hack to get chroot working.

He also wrote a little hack to get fakeroot (needed for makepkg) working, where he replaces the fakeroot executable with a shellscript that quits. Would you add that too?

Also, I like how you stored the binary of the fake libchroot as text, that was a cute trick.

Also, side note, Arch also uses the wheel group for sudoer by default.

kali linux docker image returns 401 with get-prebuild.py: unauthorized

for some reason when I try to download the docker image for kali it downloads through about 6 layers, but the last layer tells me http error 401: unauthorized.

Could I perhaps use a different tool to download the image to see if the problem persists? I'm a bit of a docker newb.

EDIT: I've tried doing it with docker pull and docker save but this saves layers in a tar.gz instead of the actual rootfs.

EDIT2: Do I simply combine the layers into a single .tar.gz? How would I go about doing this? I have the docker image but it contains layers...

Any way to share files between distributions outside of home?

I want to share my java distribution (currently in /opt) between distributions. Is there a recommended way to share it? The way I see it, only home directory stays outside rootfs.

Only asking, not requesting a feature.

Thank you, Great work btw!

dnf on fedora 25 results in a broken rpm database

I don't know what the issue is, but installing fedora 25 and then doing a dnf update results in the rpm database being broken and trying to repair it failed.

I doubt that the issue has anything to do with wsl-distribution-switcher, but wanted to note if in case anyone else ran in to this or anyone has a workaround

Install.py homedirw is broken somehow

Latest version, when using install.py, it fails to move the homedir to the new temp directory because "homedirw" gets translated as

%localappdir%\lxss\home/usernameblah

instead of %localappdir%\lxss\home\usernameblahblah

Not sure exactly why the stripping thing that you do doesn't work right, but it doesn't work properly right now.

wmic not checked to see if it is on the path early enough

Running the hook causes wmic to be invoked, which fails if C:\Windows\system32\wbem is not on the PATH. It would be nice if wmic was searched for earlier and an error message with the appropriate suggestion on how to fix the issue was done before actually installing the distribution so that it could be fixed and the install run again

Sample script does not fix locale or sudo for ubuntu:devel, default sudoers dangerous

Hiya,

I played around with the scripts a bit, and I noticed that the sample script does a couple of bad things.

First, instead of adding the primary user directly to the sudoers with no password, the user should be added to the group sudo with the shell command

usermod -aG sudo $defaultusername

Second, it should install sudo if the package manager is supported.

Third, for some reason with the ubuntu:devel docker image, you need to decompress with gzip the UTF8 charmap:

gzip -d /usr/share/i18n/charmaps/UTF-8.gz

before generating the locale, or else it won't work. I don't know if this happens with the ubuntu:latest docker image, but I checked a couple of times with ubuntu:devel.

Got a 404 error when trying to download Debian Jessie

Using Windows 10 b1703 and the latest code from this repo:

<redacted>\WSL-Distribution-Switcher>python get-source.py debian:jessie
[*] Fetching official-images info for debian:jessie...
[*] Fetching Dockerfile from repo debuerreotype/docker-debian-artifacts/47859e2e12eadf1ff7f449d0d8b541a68289a40f/jessie...
[!] Failed to fetch Dockerfile from https://raw.githubusercontent.com/debuerreotype/docker-debian-artifacts/47859e2e12eadf1ff7f449d0d8b541a68289a40f/jessie/Dockerfile: HTTP Error 404: Not Found

Manjaro

Are there any plans to add support for Manjaro? It's at no.3 on DistroWatch, so it might make sense to support it if possible.

Removing a rootfs

The following distributions are currently installed:

  - debian:latest*
  - debian:latest
  - fedora:latest
  - ubuntu:trusty

To switch back to the default distribution, specify ubuntu:trusty as the argument.

I have to versions of debian:lates installed. How do I remove one of them ?

cannot install centos:latest

python install.py rootfs_centos_latest.tar.xz
[*] Probing the Linux subsystem...
[!] Failed to get home directory of default user in WSL: [WinError 2] 。

Error installing Fedora [Specified Module could not be found

PS C:\Users\knigh> C:\Windows\py.exe C:\Users\knigh\Git\WSL-Distribution-Switcher\install.py fedora
[] Probing the Linux subsystem...
[!] The Linux subsystem is currently running. Please kill all instances before continuing.
PS C:\Users\knigh> C:\Windows\py.exe C:\Users\knigh\Git\WSL-Distribution-Switcher\install.py fedora
[
] Probing the Linux subsystem...
[] Default user is thinkdigital at /home/thinkdigital.
[
] Reading /etc/{passwd,shadow,group,gshadow} entries for root and thinkdigital...
[] Beginning extraction...
[!] Failed to extract archive: [WinError 126] The specified module could not be found
PS C:\Users\knigh> C:\Windows\py.exe C:\Users\knigh\Git\WSL-Distribution-Switcher\install.py fedora
[
] Probing the Linux subsystem...
[] Default user is thinkdigital at /home/thinkdigital.
[
] Reading /etc/{passwd,shadow,group,gshadow} entries for root and thinkdigital...
[] Beginning extraction...
[!] Failed to extract archive: [WinError 126] The specified module could not be found
PS C:\Users\knigh> C:\Windows\py.exe C:\Users\knigh\Git\WSL-Distribution-Switcher\get-prebuilt.py fedora
[
] Requesting authorization token...
[] Fetching manifest info for fedora:latest...
[
] Downloading layer sha256:691bc14ee27487db536172a1fcdbbf956f460d1e1e1b201828e3a2bab81c5ec8...
[] Downloading layer sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4...
[
] Rootfs archive for fedora:latest saved to rootfs_fedora_latest.tar.gz.
PS C:\Users\knigh> C:\Windows\py.exe C:\Users\knigh\Git\WSL-Distribution-Switcher\install.py .\rootfs_fedora_latest.tar.
gz
[] Probing the Linux subsystem...
[
] Default user is thinkdigital at /home/thinkdigital.
[] Reading /etc/{passwd,shadow,group,gshadow} entries for root and thinkdigital...
[
] Beginning extraction...
[!] Failed to extract archive: [WinError 126] The specified module could not be found

Windows Info

                     ....::::       knigh@DESKTOP-0LAUJSG
             ....::::::::::::       OS: Microsoft Windows 10 Home Insider Preview 64-bit
    ....:::: ::::::::::::::::       Kernel: 10.0.16199

....:::::::::::: :::::::::::::::: Uptime: 0d 5h 35m 44s
:::::::::::::::: :::::::::::::::: Motherboard: HP 81A1
:::::::::::::::: :::::::::::::::: Shell: PowerShell 5.1.16199.1000
:::::::::::::::: :::::::::::::::: Resolution: 1280 x 720
:::::::::::::::: :::::::::::::::: Window Manager: DWM
................ ................ Font: Segoe UI
:::::::::::::::: :::::::::::::::: CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
:::::::::::::::: :::::::::::::::: GPU: Intel(R) HD Graphics 520
:::::::::::::::: :::::::::::::::: RAM: 7121 MB / 16295 MB (44%)
'''':::::::::::: :::::::::::::::: Disk: 198GB / 233GB (85%)
'''':::: ::::::::::::::::
''''::::::::::::
''''::::

New error 0x80070040 w/WSL after using Switcher, Win build 16241

Experiencing this on 10.0.16241 Build 16241 Home, Insider Fast Ring
Everything was working fine until the latest build came down for me. I previously was using Fedora 25. The first time I experienced this I did an lxinstall /uninstall /y /full - and uninstalled WSL in Windows features, then reinstalled.

C:\Users\tronik>lxrun /install
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Windows Store:
https://aka.ms/wslstore

-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical and licensed under its terms available here:
https://aka.ms/uowterms

Type "y" to continue: y
Downloading from the Windows Store... 100%
Extracting filesystem, this will take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: tronik
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
Documentation is available at:  https://aka.ms/wsldocs

I then run bash, passwd for tronik, sudo passwd root, to change passwords.

And then... get-prebuilt.py for fedora:latest and

C:\opt\WSL-Distribution-Switcher>install.py fedora:latest
[*] Probing the Linux subsystem...
[*] Default user is tronik at /home/tronik.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root and tronik...
[*] Removing leftover rootfs-temp...
[*] Beginning extraction...
[*] Backing up current rootfs to rootfs_ubuntu_xenial...
[*] Switching to new rootfs...
[*] Writing entries of root and tronik to /etc/{passwd,shadow,group,gshadow}...

C:\opt\WSL-Distribution-Switcher>switch.py
usage: ./switch.py image[:tag]

The following distributions are currently installed:

  - fedora:latest*
  - ubuntu:xenial

You do not seem to have the default distribution installed anymore.
To reinstall it, run lxrun /uninstall and lxrun /install from the command prompt.

C:\opt\WSL-Distribution-Switcher>bash
Error: 0x80070040
Press any key to continue...

In addition, restarting or stopping/starting lxssmanager has no effect.
As well as trying to switch back to ubuntu:xenial with switch.py yields message about Linux subsystem is currently running. Please kill all instances before continuing.

Installation using Cygwin's Python is broken

Hi guys.
I am trying to install debian:latest from cygwin console, but keep getting the error:

$ python3 install.py debian:latest
[*] Probing the Linux subsystem...
Traceback (most recent call last):
File "install.py", line 34, in
basedir, lxpath = probe_wsl()
File "/cygdrive/c/Users/amadeus/Desktop/tmp/WSL-Distribution-Switcher/utils.py", line 125, in probe_wsl
basedir = os.path.join(os.getenv('LocalAppData'), 'lxss')
File "/usr/lib/python3.4/posixpath.py", line 82, in join
path += b
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Steps to reproduce:

python3 get-prebuilt.py debian:latest
python3 install.py debian:latest

My python version is:

$ python3 --version
Python 3.4.3

Same thing happens for python2(2.7.10), but with a slightly different error:

$ python install.py debian:latest
[*] Probing the Linux subsystem...
Traceback (most recent call last):
File "install.py", line 34, in
basedir, lxpath = probe_wsl()
File "/cygdrive/c/Users/amadeus/Desktop/tmp/WSL-Distribution-Switcher/utils.py", line 125, in probe_wsl
basedir = os.path.join(os.getenv('LocalAppData'), 'lxss')
File "/usr/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

WSL is enabled, lxrun /? shows the help text.

Thanks in advance!

Unable to run get-sources

Can't even start the thing. Output below. I don't know what other info I can provide.

c:\Users\Chris\Downloads>python get-source.py opensuse:tumbleweed
Traceback (most recent call last):
  File "get-source.py", line 10, in <module>
    ensure_ca_load()
  File "c:\Users\Chris\Downloads\utils.py", line 85, in ensure_ca_load
    if ssl.create_default_context().cert_store_stats()['x509_ca'] == 0:
AttributeError: 'module' object has no attribute 'create_default_context'

c:\Users\Chris\Downloads>python --version
Python 3.3.5

Linux From Scratch?

I would love to have an LFS system in my WSL. What would be the best way to get there? I can build it all under WSL, I think (been a while since I tried). Should I try to put it in a SquashFS archive and then unsquash it as you mention in your blog for ArchLinux?

Install process incorrectly extracts tarball in case-retentive fashion

After manually fetching Gentoo's stage3-amd64-nomultilib-20170525.tar.bz2 and using install.exe from v0.1.0 to install it under Windows 10 (1703), I discovered that the tarball was not extracted properly:-

$ cd /usr/share/terminfo/
$ echo *
1 2 3 4 5 6 7 8 9 a b c d e f g h i j k L M n o P q r s t u v w X z

This is missing eight additional directories. Had it been extracted properly, the list would have appeared as follows:-

$ echo *
1 2 3 4 5 6 7 8 9 a A b c d e E f g h i j k l L m M n N o p P q Q r s t u v w x X z

The damage is not limited to files owned by ncurses. However, this particular example is interesting because it manifests as weird terminal behaviour. This is because Windows sets TERM=xterm-256color, but the corresponding terminfo file cannot be located. Normally it would be beneath the lower-case x directory but, instead, it is beneath the upper-case X directory.

I recall previously using an older version of WSL-Distribution-Switcher with a standalone Python, without issue.

cpio: cap_set_file failed - Operation not supported

Thanks to Dist Switch I've changed my WSL from Ubuntu to CentOS.

I got my sudo problems worked out, but there are a handful of packages that I can't install due to the following error: error: unpacking of archive failed on file /some/file/name: cpio: cap_set_file failed - Operation not supported

Searching for this error, I found several references to Docker users having the same problem, but their solution seems to involve the Docker client/server and doesn't seem to apply back to WSL's VolFs filesystem.

Obviously the ideal solution would be for WSL to support every possible operation, but the fact that this mostly works on Ubuntu but fails to CentOS makes me wonder about other options. Unfortunately, I'm not terribly familiar with cpio and not really sure where to go next.

CentOS packages I've seen impacted are httpd and iputils

For example, try sudo yum install -y httpd
···
Loaded plugins: ovl, verify
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================== Package Arch Version Repository Size ========================================================================================================================================================Installing:
httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 M

Transaction Summary
========================================================================================================================================================Install 1 Package

Total download size: 2.7 M
Installed size: 9.4 M
Downloading packages:
httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : httpd-2.4.6-40.el7.centos.4.x86_64 1/1 Error unpacking rpm package httpd-2.4.6-40.el7.centos.4.x86_64
error: unpacking of archive failed on file /usr/sbin/suexec: cpio: cap_set_file
Verifying : httpd-2.4.6-40.el7.centos.4.x86_64 1/1

Failed:
httpd.x86_64 0:2.4.6-40.el7.centos.4

Complete!
···

When iputils fails, it's on:

Error unpacking rpm package iputils-20121221-7.el7.x86_64
error: unpacking of archive failed on file /usr/bin/ping: cpio: cap_set_file

Can't install ubuntu xenial

I am hitting this after a fresh re-install of WSL and have Ubuntu:trusty installed:

python get-source.py ubuntu:xenial
[] Fetching official-images info for ubuntu:xenial...
[
] Fetching Dockerfile from repo tianon/docker-brew-ubuntu-core/1a5cb40f41ac4829d8c301ccd2cf3b7a13687a8b/xenial...
[] Downloading archive https://raw.githubusercontent.com/tianon/docker-brew-ubuntu-core/1a5cb40f41ac4829d8c301ccd2cf3b7a13687a8b/xenial/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz...
[
] Rootfs archive for ubuntu:xenial saved to rootfs_ubuntu_xenial.tar.gz.

python get-prebuilt.py ubuntu:xenial
[] Requesting authorization token...
[
] Fetching manifest info for ubuntu:xenial...
[] Downloading layer sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4...
[
] Downloading layer sha256:6d9ef359eaaa311860550b478790123c4b22a2eaede8f8f46691b0b4433c08cf...
[] Downloading layer sha256:9654c40e9079e3d5b271ec71f6d83f8ce80cfa6f09d9737fc6bfd4d2456fed3f...
[
] Downloading layer sha256:e8db7bf7c39fab6fec91b1b61e3914f21e60233c9823dd57c60bc360191aaf0d...
[] Downloading layer sha256:f8b845f45a87dc7c095b15f3d9661e640ebc86f42cd8e8ab36674846472027f7...
[
] Downloading layer sha256:d54efb8db41d4ac23d29469940ec92da94c9a6c2d9e26ec060bebad1d1b0e48d...
[*] Rootfs archive for ubuntu:xenial saved to rootfs_ubuntu_xenial.tar.gz.

python install.py ubuntu:xenial
[] Probing the Linux subsystem...
[
] Default user is ikky at /home/ikky.
[] Reading /etc/{passwd,shadow,group,gshadow} entries for root and ikky...
[
] Beginning extraction...
[!] Failed to extract archive: [WinError 126] The specified module could not be found

P.S: WSL was NOT running when I was executing these commands.

SOLVED: sudo: unable to create sockets: Socket type not supported (CentOS on WSL)

Hello,

@jdmansour pointed out in Atlas on Windows that he was also getting sudo: unable to create sockets: Socket type not supported. This was the only reference to sudo: unable to create sockets: Socket type not supported that I was able to find.

Since sudo works under Ubuntu but fails under CentOS, I thought it must be a CentOS issue rather than a WSL issue.

If you're running as root, you can use sudo -V to dump a detailed sudo configuration, along with ./configure compile time flags. After a lot of trial and error, I was able to get sudo working under CentOS via WSL Distribution Switcher.

First, download the sudo sourcecode from sudo.ws.
Then you'll need to install a boatload of dependancies to get this to build.

yum install file make zlib zlib-devel \
gcc vim svn wget make \
sssd sssd-libwbclient-devel \
pam-devel libselinux-devel

Then you'll want to configure with:

./configure  -v --with-all-insults --with-pam \
--with-nsswitch=no --without-ldap --without-sendmail \
--with-logfac=authpriv --with-logging=syslog \
--with-editor=/bin/vi --with-env-editor \
--with-timeout=15 --with-password-timeout=0 \
--with-passprompt="[sudo] password for %p:" \
--without-lecture --with-tty-tickets \
--disable-root-mailer --enable-admin-flag \
--with-sssd --with-sssd-lib=/usr/lib64 \
--with-selinux --enable-zlib \
--without-fqdn

Last, you'll want to edit /etc/sudoers. On the very last line, you'll want to put:

me   ALL=(ALL) NOPASSWD: ALL

Of course me should be your actual username. You'll also want to make sure to include a blank line after this line, as it also seems to be required by sudo. This should fix: sudo: no tty present and no askpass program specified errors.

I'm sure that it's not the best solution, but it's a viable way to get sudo working on CentOS under WSL. I wish I could think of a way to include this into the post_install script but it's such a long winded process, building a custom RPM would seem to be the most viable option, but then is WSL-Distribution-Switcher going to want to host packages that handle compatability for certain programs?

Having the script in a folder with spaces doesn't work.

I have WSL downloaded on my C drive under ~\Downloads\Anything Techy\Useful Software\WSL-Distribution-Switcher, and when I go to install a rootfs:

cp: cannot stat '/mnt/c/Users/Jorge/Downloads/Anything': No such file or directory
cp: cannot stat 'techy/Useful': No such file or directory
cp: cannot stat 'Software/WSL-Distribution-Switcher/rootfs_pritunl_archlinux_latest.tar.gz': No such file or directory

Probably a simple error to fix

Clean Arch Install, latest pull

Heya, @RoliSoft

I have a log of a brand new install off a new arch.SFS and you mislocated the libmockchroot in the preinstall script, probably forgot to change its location later on.

Also, lots of problems with sigchecks failing even after fixing that on my end. It says it can't look up the keys remotely.

Edit: Oops, I pulled it like 4 hours ago =.=.

Edit2: Nope, I was right, you are overwriting it after all. Find where you write "libfakechroot" and you'll see you're overwriting it.

Anyway, after fixing it, I think you need to add two lines to the postinstall script for arch:
pacman-key --init

pacman-key --populate archlinux

Edit: Maybe I'll just do a pull request

Anyway, afterwards, I'm still getting this acl error afterwards

Edit 3: I'm going to fix this properly then submit a proper pull request. The last one was messed up.

Spurious "missing default" warning

When running switch.py I get:

You do not seem to have the default distribution installed anymore.
To reinstall it, run lxrun /uninstall and lxrun /install from the command prompt.

This happens because switch.py checks for Ubuntu trusty, but lxrun /install installs xenial nowadays.

Different path for lxrun and bash

Hi, on my system lxrun and bash are not in c:\windows\sysnative but in c:\windows\system32

I fixed the scripts by removing the c:\windows\sysnative and allow the scripts to run the the lxrun and bash from PATH, but that may conflict with users using cygwin/msys2.

An option to select the path for lxrun/bash should be provided or to verify the executables before.

Thanks!

CentOS can't start services (eg. SSH)

When I try to start something like SSH, I get the following error:
Failed to get D-Bus connection: Operation not permitted

On the CentOS docker page, they mention that you need to use this pre-build and then lunch it using:
docker run --privileged --name httpd -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 80:80 -d httpd

I can download the pre-build just fine, but how would you implement the docker run command from above?

Store the switch.py rootfs files somewhere else or remove their /etc/shadow files for security reasons.

Hiya Roli, I found a kind of security flaw in the design of the distro switcher.

Suppose you have a no-goodnik on your bash install through ssh. Right now, if you've used the WSL-switcher, they can just go do

cd /mnt/c/Users/Username/AppData/Local/lxss

then if there is any other rootfs than the default one, say rootfs_ubuntu_xenial, they can just enter that with cd and read off of /etc/shadow.

Two possible solutions: One, regenerate/delete the /etc/passwd and /etc/shadow files in switch.py, or store the rootfs_distro_tag folders inside of %localappdata%\lxss\rootfs\sbin, since Microsoft protects viewing that from bash, and bash prevents non-root users from viewing it (because of the nature of sbin).

debian doesn't install sudo

i just installed debian, but sudo didn't get installed. i set the regular username/password, but how do i su into root to install sudo? thanks

Unable to start bash after installation of openSuse

Because package installation isn't working properly on Fedora, I tried installing openSuse (using the Creator's Update). Now when opening bash I get the code "Error: 0x80070040". Based on google results, it appears the issue is usually the result of manually removing the /etc/resolv.conf symlink on WSL, so the problem could be that file isn't present on the openSUSE Docker package.

curl, wget, and git not working on debian jessie

Debian jessie was installed by get-source.py.
After apt-get install ... , wget, curl and git are not working properly.
See below, git clone was not successful, nothing fetched from server.

root@DESKTOP-1LAII7P:/sbin# wget
Aborted (core dumped)
root@DESKTOP-1LAII7P:/sbin# curl
Aborted (core dumped)
root@DESKTOP-1LAII7P:/sbin# git clone https://github.com/RoliSoft/WSL-Distribution-Switcher.git
Cloning into 'WSL-Distribution-Switcher'...
root@DESKTOP-1LAII7P:/sbin#

Core dumped on fedora:25, dnf install -y sudo

Steps to reproduce:

C:/> python install.py fedora:25
C:/> lxrun /setdefaultuser root
C:/> bash
$ dnf install -y sudo

During the install a Segmentation fault (Code dumped) occurs and the RPM db is corrupted.

The image fedora:24 works as expected:

C:/> python install.py fedora:24
C:/> lxrun /setdefaultuser root
C:/> bash
$ dnf install -y sudo

Installs and finishes.

Windows error 139

Hey, trying to set up Centos 6.6, no real errors in console while installing but bash keeps crashing with error 139.

C:\dev\WSL-Distribution-Switcher>get-source centos:6.6
[*] Fetching official-images info for centos:6.6...
[*] Fetching Dockerfile from repo CentOS/sig-cloud-instance-images/8911843d9a6cc71aadd81e491f94618aded94f30/docker...
[*] Downloading archive https://raw.githubusercontent.com/CentOS/sig-cloud-instance-images/8911843d9a6cc71aadd81e491f94618aded94f30/docker/centos-6.6-20150304_1234-docker.tar.xz...
[*] Rootfs archive for centos:6.6 saved to rootfs_centos_6.6.tar.xz.

C:\dev\WSL-Distribution-Switcher>install centos:6.6
[*] Probing the Linux subsystem...
[*] Default user is tost at /home/tost.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root and tost...
[*] Beginning extraction...
[*] Backing up current rootfs to rootfs_ubuntu_trusty...
[*] Switching to new rootfs...
[*] Writing entries of root and tost to /etc/{passwd,shadow,group,gshadow}...

C:\dev\WSL-Distribution-Switcher>bash

C:\dev\WSL-Distribution-Switcher>echo %errorlevel%
139

From windows docs:

ERROR_SUBST_TO_SUBST
139 (0x8B)
The system tried to substitute a drive to a directory on a substituted drive.

Any idea what's causing this?
Awesome project btw :))

edit

Tested on another PC, same issue, Centos 7 works fine. Weird...

Alpine Linux

Excuse me, did anyone install Alpine Linux?
python install.py alpine:latest
... OK ...
But, Bash cant't run.

Request

Not an issue persay, but I really love your colour scheme in the WSL preview screenshot. Any chance you could post your config?

Can't install CentOS 6

I'm trying to install CentOS 6. Fetching the filesystem works, but I get an error message during installation (see below). It is the same error message that you got here under "Installing the new rootfs".

If I try to start WSL with bash.exe afterwards, nothing happens. No error message, it just returns me to the prompt.

The issue seems to be that the old CentOS version's adduser doesn't take the --quiet parameter, and that trips up lxrun.exe. However /etc/passwd and /etc/shadow seem to be edited correctly. Any ideas how to get this running?

> python get-source.py centos:6
> python install.py centos:6
[*] Probing the Linux subsystem...
[*] Default user is jason at /home/jason.
[*] Switching default user to root...
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root and jason...
[*] Copying rootfs_centos_6.tar.xz to /root/rootfs-temp...
[*] Beginning extraction...
[*] Waiting for the Linux subsystem to exit...
[*] Backing up current rootfs to rootfs_ubuntu_trusty...
[*] Switching to new rootfs...
[*] Writing entries of root and jason to /etc/{passwd,shadow,group,gshadow}...
[*] Switching default user back to jason...
/usr/sbin/adduser: unrecognized option '--quiet'
Usage: adduser [options] LOGIN
       adduser -D
       adduser -D [options]

Options:
  -b, --base-dir BASE_DIR       base directory for the home directory of the
                                new account
  -c, --comment COMMENT         GECOS field of the new account
  -d, --home-dir HOME_DIR       home directory of the new account
  -D, --defaults                print or change default useradd configuration
  -e, --expiredate EXPIRE_DATE  expiration date of the new account
  -f, --inactive INACTIVE       password inactivity period of the new account
  -g, --gid GROUP               name or ID of the primary group of the new
                                account
  -G, --groups GROUPS           list of supplementary groups of the new
                                account
  -h, --help                    display this help message and exit
  -k, --skel SKEL_DIR           use this alternative skeleton directory
  -K, --key KEY=VALUE           override /etc/login.defs defaults
  -l, --no-log-init             do not add the user to the lastlog and
                                faillog databases
  -m, --create-home             create the user's home directory
  -M, --no-create-home          do not create the user's home directory
  -N, --no-user-group           do not create a group with the same name as
                                the user
  -o, --non-unique              allow to create users with duplicate
                                (non-unique) UID
  -p, --password PASSWORD       encrypted password of the new account
  -r, --system                  create a system account
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shell SHELL             login shell of the new account
  -u, --uid UID                 user ID of the new account
  -U, --user-group              create a group with the same name as the user
  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping

[!] Failed to switch default user in WSL: Command '['cmd', '/C', 'C:\\Windows\\System32\\lxrun.exe', '/setdefaultuser', 'jason']' returned non-zero exit status 4294967295
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "install.py", line 119, in switch_user_back
    subprocess.check_output(['cmd', '/C', lxpath + '\\lxrun.exe', '/setdefaultuser', user])
  File "C:\Users\jdman\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "C:\Users\jdman\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['cmd', '/C', 'C:\\Windows\\System32\\lxrun.exe', '/setdefaultuser', 'jason']' returned non-zero exit status 4294967295

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "install.py", line 123, in switch_user_back
    exit(-1)
  File "C:\Users\jdman\AppData\Local\Programs\Python\Python35\lib\_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: -1

Couldn't get root access in Fedora

I used the script to install fedora and enabled the hook script but still can not get access to the root account neither can install sudo
note: I already put ROOTPASSWD in system environment variables - System Variables

also how can I delete installed image as I tried to re install fedora after removing the sample from the hook file and now the switch script show I have two copies of fedora:latest

switch to centos bash.exe is cant work

Hello!

Ask a question!
there is no problem when running the python program,
download and install doker rootfs! but bash.exe is not working.
run bash.exe directly after the exit.he will not enter the bash command line mode.

when i switch back to the default subsystem bash.exe is running

Windows version 10.0.14393

how should I fix it?

-----command log-----

C:\WSL-Distribution-Switcher>install.py centos:6.6
[*] Probing the Linux subsystem...
[*] Default user is root at /root.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root...
[*] Beginning extraction...
[*] Backing up current rootfs to rootfs_centos_6.9...
[*] Switching to new rootfs...
[*] Writing entries of root to /etc/{passwd,shadow,group,gshadow}...

C:\WSL-Distribution-Switcher>bash

C:\WSL-Distribution-Switcher>switch.py
usage: ./switch.py image[:tag]

The following distributions are currently installed:

  - centos:6.6*
  - centos:6.9
  - ubuntu:trusty

To switch back to the default distribution, specify ubuntu:trusty as the argument.

C:\WSL-Distribution-Switcher>switch.py ubuntu:trusty
[*] Probing the Linux subsystem...
[*] Moving current rootfs to rootfs_centos_6.6...
[*] Moving desired rootfs_ubuntu_trusty to rootfs...

C:\WSL-Distribution-Switcher>bash
root@NANDER:/mnt/c/WSL-Distribution-Switcher#

Failed to run hook in WSL when using Fedora:latest

Is this a know issue? I am not finding anyone who documented such issue:

[] Installing tools...
error: rpmdb: BDB0113 Thread/process 7/140163040478976 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
Error: Error: rpmdb open failed
[!] Failed to run hook in WSL: Command '['cmd', '/C', 'C:\windows\System32\bash.exe', '-c', 'REGULARUSER="ikky" WINVER="14393" /root/hook_postinstall_all.sh']' returned non-zero exit status 1.
[
] Switching default user back to ikky...

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.