Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plans for alternative distributions: e.g. Fedora, ArchLinux, etc? #8

Closed
jokeyrhyme opened this issue Apr 7, 2016 · 43 comments
Closed
Labels

Comments

@jokeyrhyme
Copy link

My Windows machines always have a dual-booting Linux partition: playing games in Windows, and getting work done in Linux. As such, I'm extremely excited about WSL and Ubuntu on WSL.

I'm curious about whether or not there is room for more choice in distributions? Is there an open specification that describes what was necessary for Ubuntu to do? Can alternative distribution images that conform to this specification be used instead? Is it possible to build such an image myself, or is there a signing requirement?

I'd love to see ArchLinux and Fedora alternatives, once the dust settles of course.

@primeinc
Copy link

primeinc commented Apr 7, 2016

This was the first question I had when watching the demo video +1

@jokeyrhyme
Copy link
Author

An effort to release an open specification could be related to #1 ?

@Krutonium
Copy link

I would be all over an Arch version of this.

@jernejs
Copy link

jernejs commented Apr 7, 2016

I replaced the userland with a Gentoo stage 3, which didn't seem to break anything (however, emerge doesn't work due to failing sanity checks on /dev).

@eugenelet
Copy link

I think that Manjaro is a great arch distribution

@RaeesBhatti
Copy link

I would say that they should make Windows Subsystem for Linux open-source, so that, developers can add their own flavors. Because WSL team will never have enough resources to meet the expectations of such broad community.

UserVoice issue for making Windows Subsystem for Linux open-source

@tkelman
Copy link

tkelman commented Apr 15, 2016

WSL doesn't need to be open source for this to be possible. WSL is kernel mode code anyway (I think, correct me if I'm wrong) so I don't think the community would have the ability to compile and run custom patched copies of WSL easily. But for this item, all we'd need is documentation on what modifications Canonical made between the standard Ubuntu distribution (iso or whatever) and the userland-only version that Bash on Windows downloads. And either documentation or source for the C:\Windows\System32\bash.exe launcher/installer, which is a win32 executable so presumably anyone would be able to build an equivalent or modified version to pull down an alternate distro's userland.

@benhillis
Copy link
Member

@tkelman You are correct. We would not need to make the project open source to open up to other distributions. Currently we're focused on delivering a solid bash shell but there are many other exciting potential applications of our technology, including allowing people to select their distro of choice.

As far as the image we got from Canonical it has absolutely zero modifications. Dustin Kirkland from Canonical has a great blog post with some more info if you are interested.

@tkelman
Copy link

tkelman commented Apr 15, 2016

I read that blog post when it went up, I'm curious on the technical specifics of which image it's using though. Is it literally the exact http://releases.ubuntu.com/releases/trusty/ubuntu-14.04.4-server-amd64.iso image, or is it a userspace-only version derived from it with the Linux kernel removed?

@benhillis
Copy link
Member

benhillis commented Apr 15, 2016

You are correct, it's just the userspace pieces. It's kind of hidden in his post but he points you to the exact .tar.gz:

So as part of the engineering work, I needed to wrap the stock Ubuntu root filesystem into a Windows application package (.appx) file for suitable upload to the Windows Store.

(his link points to the xenial version and we're using trusty, but you get the idea)

@tkelman
Copy link

tkelman commented Apr 15, 2016

D'oh, thanks for that! Does make sense that this would have some commonality with "cloud images" you might use in a container. So it's the "wrap [...] into a Windows application package" equivalent step that we'd need to reverse engineer or get source or documentation of some kind to be able to recreate on a different distro. Should look into whether any other distros have equivalent userspace-only images already prepared.

@sjenning
Copy link

sjenning commented Apr 19, 2016

I've done it for Fedora:
https://www.youtube.com/watch?v=lRg0BXhxncM

How to:
https://www.variantweb.net/blog/running-fedora-on-windows-10-using-wsl/

The install is not user friendly as lxrun.exe is hardcoded for the Ubuntu userspace tarball and seems to be the only utility in all of Windows that can actually create proper symlinks on NTFS.

Need the source for lxrun.exe please!

# strings lxrun.exe | grep base
base\subsys\lxss\lxrun\main.cpp
base\subsys\lxss\lxrun\download.cpp
base\subsys\lxss\lxrun\install.cpp
base\subsys\lxss\lxrun\uninstall.cpp
base\subsys\lxss\lxrun\update.cpp
base\subsys\lxss\lxcmdlineshared\console.cpp
base\subsys\lxss\lxcmdlineshared\svccomm.cpp
base\subsys\lxss\lxcmdlineshared\helpers.cpp
base\subsys\lxss\tar2lx\lib\tar2lx.cpp   <-- I assume this is the symlink magic

@hanetzer
Copy link

I've actually done arch linux within this, but I've ran into a major problem that would likely have to be fixed in pacman/libalpm itself, in that it makes numerous calls to chroot() from unistd.h which apparently isnt currently supported within lxss

@jokeyrhyme
Copy link
Author

The chroot issue is here: #47

@hanetzer
Copy link

Oh, so it is! btw, I'm talking about the c call for chroot() and not the command itself. As I said, I actually have a 'running' archlinux going, but I can't use pacman :P

@hanetzer
Copy link

For whatever reason I can't replicate it again, and even then until we can do chroot() it's next to useless :/

@goreliu
Copy link

goreliu commented Aug 16, 2016

@SRGOM

Install Arch Linux to WSL:

  1. Download latest iso file from https://www.archlinux.org/download/
  2. Extract arch\x86_64\airootfs.sfs from archlinux-2016.08.01-dual.iso to /path/to/airootfs.sfs
  3. Enter bash.exe, install squashfs-tools with apt-get, run unsquashfs /path/to/airootfs.sfs in /root
  4. Close bash.exe, enter c:\Users%username%\AppData\Local\lxss with explorer.exe, backup rootfs, move root\squashfs-root to rootfs
  5. Enter bash.exe again, it's Arch Linux now

Solve(skip) chroot problem:

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

LD_PRELOAD=/path/to/libchroot.so pacman

A screenshot:

archlinux_in_wsl

@goreliu
Copy link

goreliu commented Aug 16, 2016

@SRGOM

  • fakeroot doesn't work, but makepkg depends it
$ fakeroot
fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support.
fakeroot: error while starting the `faked' daemon.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

I wrote a fakefakeroot, replace it, just works, but then owners of files in .pkg.xz are not root.

#!/bin/bash

if [ "$1" = "-v" ]; then
    echo 1.0
    exit
fi

export FAKEROOTKEY=1

exec "$@"

unset FAKEROOTKEY
  • Versions of packages in Arch Linux are much higher then which in Ubuntu 14.04, some tools failed to run, such as script command and socat UNIX-LISTEN:aa - command.
  • We can't start any serivce with systemctl start foo, and no service command exists. The only method seems to be manually run /usr/bin/sshd , /usr/bin/crond, ...

@RoliSoft
Copy link

For what it's worth, I wrote a few scripts to easily grab the Docker official images, install them as the rootfs for WSL, and switch between the installed distributions seamlessly.

The project is in its infancy, and available from here: https://github.com/RoliSoft/WSL-Distribution-Switcher

I'll look into adding more sources and post-install hooks to fix known issues for each image, where the issue is known and fixable.

@aseering
Copy link
Contributor

@SRGOM -- sorry for the delay -- do you think the existing "Tools and Instructions" category would work? If not, or if it gets too crowded, I'd be happy to make a new section.

@fpqc
Copy link

fpqc commented Aug 26, 2016

@goreliu I had a problem where the unsquashfs'd thing didn't have GCC.

@goreliu
Copy link

goreliu commented Aug 26, 2016

@fpqc Compile codes in Ubuntu and move output binaries to Arch also works.

@fpqc
Copy link

fpqc commented Aug 26, 2016

@goreliu yeah I figured.

@fpqc
Copy link

fpqc commented Aug 27, 2016

@goreliu Sorry, one other thing: Where do I put the fakefakeroot script? Do I overwrite the downloaded fakeroot?

Also, can I add the libchroot to /etc/ld.so.preload ?

@turbo
Copy link

turbo commented Sep 1, 2016

Think of it as a replacement for lxrun. Instead of installing and managing a ubuntu server WSL, it does the same with archlinux. Sure you can make a vanilla arch compatible, but this is meant for folks who look for something as simple to run as lxrun itself.

@fpqc
Copy link

fpqc commented Sep 1, 2016

@minxomat Interesting, I'll try it out. It won't delete my /home and /root, will it?

Also, in the readme you really ought to explain what changed packages you're using.

@turbo
Copy link

turbo commented Sep 1, 2016

@fpqc Well, I don't recommend to use it just now. But you can try. Backup everything in any case.

Full documentation is ofc included in the final version. Also, not all mods are applied in the dev branch, so there might be some warnings until testing is finished. If you find something, open an issue. It's better to have duplicate issues to be reminded of important things 😄

@WSLUser
Copy link

WSLUser commented Oct 23, 2017

Are there plans for Red Hat Linux, Kali, and SELinux to be added to the Windows Store?

@marcthe12
Copy link

Can we sdk to create our own from chroot or tarball

@WSLUser
Copy link

WSLUser commented Jan 17, 2018

Just to give everyone an update to Kali, see this Twitter post from Kali https://twitter.com/kalilinux/status/951140177510006793/photo/1

@WSLUser
Copy link

WSLUser commented Mar 7, 2018

Both Kali Linux and Debian are now available on the Windows Store

@Biswa96
Copy link

Biswa96 commented Mar 7, 2018

My questions @tara-raj 1. Who does provide the install.tar.gz file? Does Microsoft make that own or the developer of that distro? 2. Who publish the appx in Windows Store? 3. And last, who build the added distro_name.exe in Appx package?

@bitcrazed
Copy link
Contributor

@Biswa96 - @tara-raj is currently working with several Linux distro vendors to help them bundle & publish their distros to the store - we feel it's best for the distro owners to control and manage the release of their distros on their schedule.

We believe that it's best for all concerned, if a distro is published from the store under the auspices of the owning organization. This way, when you see "Ubuntu" published by "Canonical Inc.", you can feel confident that it's the real-deal, whereas if you saw "Ubuntu" published by "Joe Bloggzzz the MegaGeek", you might pause and question whether the app is legitimate.

Distro owners are responsible for everything that goes into their APPX- the distro tar.gz itself, along with the launcher, and any icons/images etc.

Distro owners fork the sample distro launcher, modify a few settings, and build their launcher app. The launcher app is (deliberately) very simple, and basically handles registering a distro and launching of a distro instance when the user clicks a start menu tile, or calls the launcher's app execution alias (e.g. "ubuntu.exe").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests