Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on windows subsystem for linux
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message

Joined: 27 Mar 2013
Posts: 5
Location: Tokyo, Japan

PostPosted: Fri Jun 03, 2016 6:47 am    Post subject: Gentoo on windows subsystem for linux Reply with quote

Gentoo on windows subsystem for linux

any idea?

looks like they already did for fedora
Back to top
View user's profile Send private message

Joined: 05 Aug 2006
Posts: 2100
Location: Berlin, Germany

PostPosted: Fri Jun 03, 2016 12:37 pm    Post subject: Reply with quote

I looked a bit into it. Deleting all the Ubuntu stuff and replacing it with a stage3 (akin to what Fedora did) is one possibility.

The Ubuntu on Windows development unfortunately was done in secret. And despite promises of technical details, not much has been released publicly yet.
Dustin Kirkland wrote:
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. That required me to use Microsoft Visual Studio to clone a sample application, edit a few dozen XML files, create a bunch of icon .png's of various sizes, and so on.
I searched, but I could not find any documentation which describes how to perform these steps.
Back to top
View user's profile Send private message

Joined: 12 Jul 2016
Posts: 1

PostPosted: Tue Jul 12, 2016 7:10 pm    Post subject: Reply with quote

I actually had a go at this.

You can do the swapping of the root's pretty much, install WSL, run 'bash', install its ubuntu base, unarchive the stage 3 into a directory (i called /s3) and basically swap the file systems over.

You have some problems because of what I presume is the way windows implements file locking... I think you can specify what command to 'start' as a parameter to 'the windows 'bash' executable', so something like "bash /s3/bin/busybox etc etc" might be useful

Essentially mv everything from / into /old, rm -rf sensibly whatever's left (ignore sys proc mnt dev), you'll need to use busybox probably to do this because of the static linking. rm -rf any 'safe' folders that remain (usr, bin, sbin etc), it might complain about purging some parts of /usr or /bin but persistence paid off (!)

Once done you can mv or cp the stage3 from /s3 into the root. You'll need to move "init" from the old install back into the root. (dont know what happens if you dont, actually).

Set your /etc/locale.gen and locale-gen ... resolver doesn't seem to matter thus far (or is auto configured, i didn't even look). ICMP doesn't work.

You might need to use "lxrun /setdefaultuser root" (or may just find this useful).

None of the above is particularly of note, it's a bit fudgy but i've actually done this on real linux machines recently (swapping remote operating systems), it's a little more fudgey for reasons of windows locking i guess but it works still.

I suggest you "su -" after you run bash, i dont think the default init thing properly sets up bits of the environment, i get locale errors sometimes etc etc.

The reason I'm making this post, aside from having the time while my machine does some building, was to share the next "hurdle" I came across and it's resolution.

The problem is emerging anything fails pretty early on (after the unpacking of the source) with some error about "ebuild-ipc daemon process not detected". At first I was worried there was some limitation in the filesystem implementation that was being tripped, but I manually compiled bash (as a test package) so it seemed like in theory trying to build stuff oughta be possible.

The problem comes down to a file called "". this is located on my system at /usr/lib64/portage/python3.5/ , though your lib directory may change, as may your python version directory (python 2.7 on my other machines mostly)...

In here you can find "def _daemon_is_alive(self)" which 'tries' to do something to do with locking, which fails miserably (i guess). If you delete this entire try/except/else and just replace it with "return True" (with the correct level of indentation, cant remember but python cares I believe), then ebuild commands run and complete.

I'm no gentoo expert, and worry a bit about the problem being to do with locking, since such things are sometimes used as guards, but if I look at this segment of code, not only is it only supposed to "check if something is running", which presumably it is since the builds succeed, and thus its just the check thats defective....
but also the whole check is centered around trying to FAIL to do something - it tries to get the lock, and if it fails, it assumes the daemon has the file open and says "all good here!". if the lock succeeds, it unlocks it again and says the daemon isn't running..... so i guess the locking code doesn't properly enforce something in microsoft's implementation here...

anyone know if this is likely to be an issue somewhere? I'm pretty sure bodging this check is fine, but are there any well known problems with locking not functioning properly and always returning the "OK" state? I know this is a bit of an old gripe for unix anyway as various NFS setups have 'struggled' with this and caused issues for things like MTAs (i think, its been a long time since i did nfs-root work, and i imagine the support/code has progressed in the decade gone by).

Mostly just sharing progress, I'm currently updating world, and i'll probably do an 'emerge -e @world' at some point for lulz, and to see what breaks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum