-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
NixOS in Windows Store for Windows Subsystem for Linux (WSL) #30391
Comments
This would be super cool. I'd like to move to using NixOS, but I can't give up my Windows machine, and I don't want to run NixOS in a virtual machine. What I'd really like to try doing is a continuous integration system using NixOS based build management to kick off compilation on the Windows side. #28365 is an impediment, but drilling through the linked issue I saw an update yesterday from a MS staffer that they have been working on it. Also I'm not sure if NixOS/nix#1203 is the same or different root issue. |
@PierreR I also had this problem. I solved it by downloading the archive and copying the files to the directory manually. |
@jtojnar Thanks ! Indeed if I run each problematic Any idea where the issue is coming from. I would like to streamline that process but it is going to be a bit cumbersome if such issue lingers on. |
Just for the record I have hit microsoft/WSL#1671. Not only WSL seems to be unbearably slow, it would also fail strangely with this error:
My feeling is that WSL is too beta and adding an official NixOS image to the Windows Store might be premature. |
@PierreR disk I/O error is NixOS/nix#1203 |
@jtojnar yes it is. Thanks ! Everything works fine for me except for the sluggishness. |
Does NixOS the distro itself require anything special beyond what Ubuntu as a distro requires? If not, then it should be possible to get NixOS (and not just nix) onto WSL! |
NixOS the distro relies pretty heavily on systemd to run services. It would still be great to use |
Other distros will be in the same boat for any required services, but I can see this being a particular problem for Nix with the Nix Daemon. Since WSL is intended to be a single-user environment, a NixOS that runs like single-user Nix could be what is needed to make it work. |
I would love to see another distro in the Windows Store. It only took Kali a couple months from request to publishing into the Windows Store (which released 3/5/2017 for record). Note that you can manually run any services as most of the syscalls are supported though I'm not too familiar with NixOS to guess what specifics might not exist yet in WSL. So while Also try to use the latest Insider as it will greatly help in discovering what issues may still exist. For instance, you're able to perform background tasks on Insider. |
Microsoft open sourced a WSL Sample for Linux Distribution maintainers. Might be very helpful. |
Any news in this front? I'd manually compile myself to test it out but won't have time for it for awhile. If anybody on the NIXOS team is running build 17134 SCU (pre-release still), if they could give it a go on this build, it would be appreciated. |
I'm taking a stab at this. Initial success so far @ https://twitter.com/GeoffreyHuntley/status/995977211176927232 |
Blocked by microsoft/WSL#3207 |
Thanks for the work on this. Testing out linux distros on Windows is really easy now days and you can run several side by side. Getting NixOS on to the app store could be a great gateway drug to NixOS and the excellent Nix package manager. |
In private discussions with Microsoft about getting NixOS into the Microsoft App Store. Have been a little overwhelmed recently but it's high on my todo list. Microsoft are waiting on me. |
Thankyou Geoffrey. That would be great. Good luck.
cheers -ben
…On 8 August 2018 at 21:53, Geoffrey Huntley ***@***.***> wrote:
In private discussions with Microsoft about getting NixOS into the
Microsoft App Store. Have been a little overwhelmed recently but it's high
on my todo list. Microsoft are waiting on me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30391 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABolJ5GqjSUUwHIr31g5VDfmu11890Qhks5uOu1PgaJpZM4P4sYF>
.
|
Considering nixcon is on; it only makes sense to pick this back up again. I had to park it because I was overcommitted. Let's start this back up again. Next steps are as follows:
|
What's the structure of install.tar.gz? I couldn't find that documented. Also, someone using WSL might want to add a package for "wslu" which has some nice things for interacting between Linux and Windows: |
@ghuntley do you have a URL for the NixOS Foundation to review the documents? |
Thanks for pushing NixOS towards running over WinNT! That would be handy. The roadmap above is much about putting NixOS into the appstore. Which is quite separate a task from making NixOS runnable on WSL. I'd pretty much do with a ZIP which I'd download from nix site and install for me, not sure I even like the idea of mouseclicking it out of the fancy store instead. Especially if we have to wait for the legal stuff just for the sake of some GUI install scenario. What's the technical status of running NixOS on WSL? Is it still blocked by the question marks and pipes in the paths? If not, are there any distributions we could try and run right away? |
I don't have WSL, but in theory, You can manipulate this into an install.tar.gz file and get it to run (and make a PR to get it in future release). There will most likely be bugs encountered doing this though. wslu looks to be a good resource to base the install.tar.gz on. EDIT: It looks like WSL doesn't support systemd! So we will need to do a little more work to get this to work. How would we run the Nix daemon? Another question that remains to be solved: how can we get Nix to detect that it can run Windows binaries? Nix supports "extra-platforms" so we can reuse that if there were an easy way to run a builder in "windows" mode. Can't find any sort of syscall/API to do this though. |
I don't pretend to understand enough about linux, wsl, and systemd to know if this is useful, but there's a long thread about systemd on WSL2 here that might have some useful information |
I will note that I've seen plenty of init.rc scripts that including calling systemctl and other systemd functions (we have some for a few Fedora VMs/containers due to things used for managing the hosts.) So the functionality can remain exactly the same except you can add to the scripts other non-systemd stuff so if you don't have systemd, you don't run any of the systemd specific stuff. For redundancies found within a script, those should be abstracted away as much as possible to keep the file size down as well as possibly improve perf from not having to read so many lines. We do want to keep these scripts as small as possible following best coding practices. |
I looked into Genie and figured out how it's running systemd. I then wrote a NixOS module to wrap systemd and systemctl instead: It's somewhat working. Sometimes systemd starts up well and you can run systemctl to check on services, etc. It seems like |
Whilst the |
Looks like somebody has it working 100% here, but I haven't tried it out yet https://github.com/Trundle/NixOS-WSL |
Systemd now has the --system flag which lets it run even if it doesn't have PID 1, so maybe all we need to do is set that flag? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@lulcat The init system used to be upstart iirc, feel free to find those commits and propose a maintainable combined system. There's also a lot to read in previous issues on this topic. The gist of it is that it's hard to create a wrapper around init systems with such diverse capabilities without being very limiting or re-writing systemd capabilities; as such, NixOS modules use only systemd. |
Seems like it works now. |
At the very least, an offline msix could be provided (that's still signed) to make usable outside of Store. The wsl --import option is great but an offline msix would be even greater. |
I marked this as stale due to inactivity. → More info |
Not Stale - still not in the Store |
Are there any specific instructions for planting it into the WSL? Preferably, ones which do not involve writing an app in C++ and compiling it with Visual Studio. Everything there sounds not too hard — if you've done it before, and got all the tooling. But for the first time… If not in the Store, a ready set of the DistroLauncher and Rumors are, you can install an Another issue is that you need NixOS to make a tar.gz you need to run NixOS, which in context of our task (running NixOS on Windows NT) sounds close to "unzip.zip". |
@GuillaumeDesforges or @WSLUser , do you know if anyone actually have tried to get this into Windows Store? Is there a request I could give thumbs up to somewhere? (don't know anything about how windows store works) .. |
From @ghuntley (#30391 (comment))
Other than that idk. It would help to have someone who knows the procedure to be accountable (maybe a strong word but I don't know another) on this (both follow technical issues and WS request) |
It would be great to have some manual steps to get it running as well. Is https://github.com/Trundle/NixOS-WSL the recommended way for example? |
Is following the Trundle's repo still the best way to generate latest NixOS for WSL? Or are some forks or other repos that have 20.09+ images available? Possibly with WSLg, wslu support etc. |
I commented in that repo that distrod claims to help with the systemd issue. Distrod relies on https://linuxcontainers.org which doesn't have anything for NixOS. Would it be difficult to create NixOS images for LXC/LXD and linuxcontainers.org so that distrod could be leveraged? |
I'm running NixOS on lxd, but tbh it's not straight forward and you need to configure quite a lot in os level. There's also https://github.com/nix-community/nixos-generators which is able to generate LCD images.
19 Jan 2022 19:29:32 Alex Vorobiev ***@***.***>:
… I commented[nix-community/NixOS-WSL#49 (comment)] in that repo that distrod[https://github.com/nullpo-head/wsl-distrod] claims to help with the systemd issue. Distrod relies on https://linuxcontainers.org which doesn't have anything for NixOS. Would it be difficult to create NixOS images for LXC/LXD and linuxcontainers.org so that distrod could be leveraged?
—
Reply to this email directly, view it on GitHub[#30391 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AALKAEDI6ZDLGPL46XSEZ5DUW37IZANCNFSM4D7CYYCQ].
Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub].
You are receiving this because you are subscribed to this thread. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAnSURBVHic7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAAPBjRFIAASHKmKkAAAAASUVORK5CYII=###24x24:true###][Tracking image][https://github.com/notifications/beacon/AALKAEE5NVSY4ERUC2A52Z3UW37IZA5CNFSM4D7CYYC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHSNGACY.gif]
|
The nixos-wsl repo under nix-community is under a new maintainer and getting a lot of much-needed attention. There’s a good chance that we can get this done, soon. |
Please close this and redirect discussion here. |
Closing as requested. Feel free to reopen if it is not appropriate. |
Nix already runs in Ubuntu via WSL afaik.
I think it would make sense to add an official NixOS image to the Windows Store.
Arch Linux is trying already. (microsoft/WSL#2253)
Are there any showstoppers?
The text was updated successfully, but these errors were encountered: