Closed Guerra24 closed 6 years ago
Um, this doesn't seem like it will work unless you do the untar+edit fstab step inside of WSL.
@fpqc The fstab edit can be done before compression, is trivial.
@guerra24 This seems a whole lot more annoying and difficult than the methods in the linked thread. For one, it requires you to build and set up an arch tarball. I expect that there could be a number of network config problems if you just tarred up your arch system's rootfs including /etc.
It's not necessary to edit fstab, just leaving an empty fstab also works. And no network problems will happen, WSL doesn't care any network config, and none of ifconfg/ip/dhcpcd/iwconfig/netctl/... will work.
@Guerra24 How can I get an Arch tar? Using a virtual machine or ?
@fpqc Really no, I never changed any configuration and network is ok, but this method will work with any distro, not only arch.
@crazymonkeylyc Yea, install arch in a VM then compress all files inside a tar and use that.
Just update to Debian sid inplace but hold the libprocps3 and procps packages. Otherwise top(1) stops working.
@russalex Hi Alex, what percentage of the good work you are doing is the result of Canonical? or WSL layer is only by Microsoft?
@iz0eyj For legal reasons, pretty much all of the work has to be done by Microsoft, by a team that has not read the Linux Kernel sourcecode or decompiled it.
Also, his name is Russ Alexander, not Alex, lol.
@fpqc I'm sorry for the name :)
Thanks for the answer, I think "Linux Kernel sourcecode" is "Win kernel source code", right? Another question, do you know if exists a list for System Calls supported by WSL?
@iz0eyj I'm not sure if a full list exists as one file, but if you read the changelogs:
https://msdn.microsoft.com/en-us/commandline/wsl/release_notes
You can read all of the syscalls implemented version-by-version.
@Guerra24 Thank you for your guide, but after I decompressed the arch tar to rootfs, I got 0x8007001f error when I tried to get into bash. Could you tell me more things about this? such as the command line on tar etc.
@crazymonkeylyc Where did you decompressed arch? Inside Windows or WSL?
@Guerra24 lol this was exactly what I was saying would happen if people followed those instructions you gave........
I used airrootfs.sfs in Arch Linux Installation ISO and managed to run it.Except some problems:
could not change the root directory (Function not implemented) error: command failed to execute correctly
- systemctl not work because "Failed to connect to bus: No such file or directory".
- makepkg cannot run as root,but if you use useradd command to create a user,you will cannnot use su command to change to it because "su: failed to execute /bin/bash (or other shell like /bin/zsh) : Permission denied"
@KenOokamiHoro I tried messing around with Arch, and there are a few problems that have workarounds for the lack of chrooting, but they don't work all that well. I would suggest holding off on using Arch until chroot is supported. I tested it extensively last night and gave up after pacman started installing packages and telling me they were inaccessible (and I had to manually chmod them to fix it).
If you want to test the workarounds yourself, check out #8
@SRGOM You need chrooting for "Use Privilege Separation" in sshd. I'm 80% sure that I saw the WSL devs mention that it's planned. One of the development situations we're talking about here is using Visual Studio's new Linux build plugin without running a separate VM for compiling with gcc, and right now the way you do this is by connecting Visual Studio by ssh to a Linux VM for building. It's, I think, one of the original use cases.
@iz0eyj, wanted to jump in here for just a minute and confirm what @fpqc stated. WSL contains no code from Canonical or from the Linux kernel (nor do we read their source). You can read a bit more about what we do on our blog as we are trying to be very open about our implementation. Oh, and no worries about the name, very common mistake.
Also, for the record, we are working on supporting chroot.
By the way, I would like to plug this nice project https://github.com/RoliSoft/WSL-Distribution-Switcher
It handles everything pretty nice and safe, and with Insider build 14905, I have got ubuntu:devel (yakkety) working with no hacks and no problems.
I don't suggest using distros other than Ubuntu or Debian atm, because their package managers are using unsupported syscalls (pacman makes extensive use of chroot, and the current hacks to fix in #8 only lead to a semi-broken system. I understand that there is a similar problem with CentOS and Redhat). Also, read the instructions on how to enable the sample postinstall script, or you will end up with locale and sudo problems.
I request that the OP move this into the top post, since it is a much preferred alternative to the procedure he described above.
@Guerra24 Thanks for your reply. I executed "pacstrap -i /mnt base base-devel". mounted my USB to /media and did "tar -cvf /media/arch.tar /mnt". After that, I use bash on windows to decompress arch.tar in C:\ (tar -xvf arch.tar). rename the /mnt to rootfs ,and move it to %LOCALAPPDATA%\lxss. Then I tried to get into the bash, but got 0x8007001f. That is all.
@crazymonkeylyc you need to untar it inside of VolFS, or else it loses all of the permissions and linux data and breaks it. You could sudo untar it to /root/rootfs_tmp, then move it in windows. That's why the above instructions are bad.
@fpqc It works! Thank you for your help!
In case anyone is curious, I managed to get Gentoo working using https://github.com/RoliSoft/WSL-Distribution-Switcher by simply using the Gentoo stage3 tarball as the rootfs instead of a docker image. From there I followed the standard Gentoo installation process of installing portage. There were a few gotchas though:
/usr/lib64/python2.7/site-packages/_emerge/AbstractEbuildProcess.py
and set _enable_ipc_daemon
to False
as IPC isn't supported as of yet (#1016). I would also recommend setting the -ipc USE flag in your make.conf file. You can also add sys-apps/portage -ipc
to your /etc/portage/profile/package.use.force
file to allow disabling IPC if you ever rebuild or upgrade portage before #1016 is fixed/usr/lib64/python2.7/site-packages/portage/util/writeable_check.py
and replace: attr2 = mount[1].split()[2]
with:
try:
attr2 = mount[1].split()[2]
except IndexError:
attr2 = mount[1].split()[1]
This is because WSL, at least for this machine, had invalid entries for /home
and /root
in /proc/self/mountinfo
. However, I didn't have the same behavior on another machine, so this step wouldn't be required there. YMMV
/usr/lib/perl5/5.20.2/x86_64-linux/Config.pm
Once those fixes were in place I was able to build packages just fine. I'd also suggest putting the lxss rootfs in your antivirus exclusion list, and windows search indexer exclusion list as emerge downloads lots of source files, and having the rootfs not excluded can slow down things significantly.
Oh and I also wouldn't suggest turning on emerge in parallel mode. Parallel builds works by limiting the number of parallel builds to the load average you provide (as well as a max number of builds). However WSL hardcodes the load average to 0.52, 0.58, 0.59
, so Portage has no way of knowing if it's overloading the CPU with too many parallel builds. For now, I would suggest running a single build at a time with the -j
option to make
to at least the single build will run faster.
@Sazpaimon for me it was /usr/lib64/python3.4/
but thanks a lot
Does locale-gen work for you? I get file not found errors even though the specified locale files exist.
Edit: I found a solution. I went to /usr/share/i18n/charmaps
and did gzip -d UTF-8.gz
. For whatever reason this fixed the problem!
So I installed Arch using this guide: https://www.reddit.com/r/bashonubuntuonwindows/comments/5vnne8/howto_installing_arch_on_wsl_manually/
Everything worked as expected and Pacman is running rather well. Setting the locale has failed however. Running locale-gen fails with this error:
Generating locales... en_US.UTF-8...localedef: ../sysdeps/unix/sysv/linux/spawni.c:360: __spawnix: Assertion `ec >= 0' failed. /usr/sbin/locale-gen: line 41: 36 Aborted (core dumped) localedef -i $input -c -f $charset -A >/usr/share/locale/locale.alias $locale
Anyone know a workaround? The Arch Repos and AUR have proven to be very useful.
@Vaporeon -- a similar issue is reported on #1878 . Does the workaround there help you?
I instead worked around it by running locale-gen on a "real" Arch install and copied the generated file into the WSL instance.
The posix spawn issue fix is currently being merged into the http://github.com/alwsl/alwsl Arch Linux for WSL installer.
More distrubitons have been added with others on the way.
First was a DE, now is time to run another distro, the process is simple but time consuming.
Running Arch For running Arch in WSL you need:
Steps
That's it, very simple but time consuming like I said. The Arch instalation that I used was provided by @matiuri. The same process applies to other distros.
Any problem please leave a comment and I will help you.