
Show HN: Boot Windows 10 Directly into Linux Desktop of Choice - nxc18
https://github.com/NathanCastle/BootShellCredentialProvider
======
TheRealDunkirk
The worst of both worlds! The Windows kernel and the Linux UI!

I kid; I kid. Looks fun.

~~~
mtdewcmu
Right... You can make Windows 10 look like a unix workstation from 1995.

~~~
kuschku
KDE Plasma 5 is actually reasonably modern.
[http://i.imgur.com/XcnYxy0.png](http://i.imgur.com/XcnYxy0.png)

~~~
swah
Looks almost nice, but feels like spacing and font size is wrong on some
places. Maybe I'm just used to win10...

~~~
kuschku
Definitely, there’s a lot to improve, and it certainly isn’t perfect – but
it’s not a desktop that you’d compare to Windows 95 or CDE.

------
mee_too
I bet RMS will now ask people to start calling it GNU/Windows :)

~~~
Analemma_
No, it's "GNU\Windows" ;)

~~~
CodeWriter23
Pretty sure that's GNU\Window~1

------
chrisper
I was experimenting running stuff like PyCharm, VS Code, Sublime etc. in WSl
through X11 Forwarding. Eventually I gave up and just run it properly in
VirtualBox with seamless mode.

~~~
nix0n
What windowing system do you use this with?

~~~
chrisper
I just saw I read it wrong. Are you referring to seamless mode? I use mate for
that.

~~~
nix0n
The question was not as clear as it could've been but this was the answer I
was looking for. Thanks mate.

------
wereHamster
Am I the only one surprised that a project which is still under active
development still uses sourceforge
([https://sourceforge.net/projects/vcxsrv/](https://sourceforge.net/projects/vcxsrv/))?
SF should be dead after it began hijacking projects and added adware to
installers?

[https://arstechnica.com/information-
technology/2015/05/sourc...](https://arstechnica.com/information-
technology/2015/05/sourceforge-grabs-gimp-for-windows-account-wraps-installer-
in-bundle-pushing-adware/)

~~~
frozenport
Did you juat forgive github for the recent change to their TOS that bans GPL?!
No, we should host everything on high uptime content agnostic platforms like
S3. Or run our own infastructure but use a 3rd party service like GitLab for
improved redundancy!

~~~
baldfat
I think once the dust falls everyone will realize that GPL is fine. This
github is lawyer speech for how they allow search results. TOS releases always
are drama till people settle down and read what it actually says and its
intent.

------
youdontknowtho
This is so awesome. I love the guys notes as well. Right on. Great work dude.
Keep it up.

------
abtinf
I will surely look into this - it would be very helpful to run a proper tiling
window manager like spectrwm/i3/dwm/xmonad under Windows.

------
ChuckMcM
Nice. For a long time when I ran windows I also ran Xwin-32 from Starnet[1].
That let me putty -X[2] into a linux box and run things with GUIs on the PC
where I was sitting. I found I still had xwin-32 installed so I opened up WSL,
set my display to :0 and started up xeyes, and blam! there the were. Very
nice.

[1] [https://starnet.com/](https://starnet.com/)

[2] Not literal, putty has a setting to allow X just like ssh does.

------
djloche
Right now I'm waiting for a GCC related fix in WSL that is scheduled to get
pushed in April. In the meantime I've spun up Ubuntu in VirtualBox that gets
the job done. This looks like a great option to play around with once that GCC
fix is pushed

~~~
Mayzie
What's wrong with GCC? What's it fixing?

~~~
djloche
edit: it's not gcc, it's wsl that needs fixing. this is the issue thread:
[https://github.com/Microsoft/BashOnWindows/issues/307](https://github.com/Microsoft/BashOnWindows/issues/307)

------
imafish
That looks awesome. How well do Linux DE's run on Windows?

~~~
nxc18
Its a bit of a mixed bag. Just getting them set up tends to be pretty iffy;
they tend to rely on lots of sockets, which I gather aren't actually
implemented by WSL.

In terms of performance once they are up and running, things are actually
pretty decent. The biggest bottleneck appears to be I/O, which is kind of a
problem for everything WSL. That part makes installing a gig+ desktop package
frustrating as it takes way longer than it should.

The funny thing is the types of issues I get with WSL are also had by people
using actual Linux. And there's no compositing.

Final answer: Full Linux DEs run as well on Windows today as they ran on Linux
in 2007.

~~~
hashhar
Yes. Sockets are available in Insider releases though but I/O still remains a
pain.

~~~
chrisper
Yes, but not everything. They do not implement everything 1:1 so not
everything may work. For example, they implemented inotify, but they left away
a few things and certain applications crash because they expect certain
functionality.

------
zaggynl
Cool but appears to be broken, when starting the configurator for the first
time, the registry keys don't exist and it fails silently.

Issue here:
[https://github.com/NathanCastle/BootShellCredentialProvider/...](https://github.com/NathanCastle/BootShellCredentialProvider/issues/1)

------
doggydogs94
I am impressed when someone can make a credential provider. I think
Microsoft's documentation and samples are still for Vista.

------
int_handler
Cool experiment, but holy Tour de France coding style Batman:
[https://github.com/NathanCastle/BootShellCredentialProvider/...](https://github.com/NathanCastle/BootShellCredentialProvider/blob/master/BSCP/CredentialProvider/BSCredential.cpp#L334)

~~~
partycoder
In flowchart decision points, it's clearer to make "yes" co-linear and "no"
orthogonal.

Likewise I prefer to structure cyclomatic complexity like this by doing
something like

    
    
       if not <condition 1>
          return
       else if not <condition 2>
          return
    
       <logic>
    

Rather than

    
    
        if <condition1>
            if <condition2>
                if <condition 3>
                    ...

~~~
richardwhiuk
Early returns here will require duplicated free() calls, which makes it hard
to prevent leaks.

This coding style is standard practice for Win32 API development.

~~~
int_19h
The more typical coding style for raw Win32 is to have a block of
CloseHandle/Free/... block at the end of the function, and goto it for early
exit. Usually with some helper macros to easily write "if it failed, goto
cleanup" one-liners.

~~~
richardwhiuk
You can't have a single cleanup (because subsequent calls use memory/handles
from prior - otherwise you'd have a function wrapper), so it ends up getting
really nasty - at which point, the logic feels clearer (and easier to match
alloc and free) if you have indented blocks. The change I'd make to the code
would be to have a shorter indent block.

    
    
      HRESULT hr;
    
      hr = DoFoo();
    
      if (!SUCCESS(hr))
      {
        goto exit;
      }
    
      hr = DoBar();
    
      if (!(SUCCESS(hr))
      {
        goto cleanup_foo;     
      }
    
      hr = DoBar();
    
      if (!(SUCCESS(hr))
      {
        goto cleanup_bar;     
      }
    
      hr = DoBaz();
    
      if (SUCCESS(hr))
      {
        CleanupBaz();
      }
    
      cleanup_bar:
        CleaupBar();
    
      cleanup_foo:
        CleanupFoo();
    
      exit:
    
      return hr;

~~~
int_19h
> You can't have a single cleanup (because subsequent calls use memory/handles
> from prior

Why not? You just initialize them all to NULL (or INVALID_HANDLE_VALUE etc, as
appropriate). And then in your cleanup block, you check whether each was
initialized, and clean it up. So long as you consistently do this in reverse
order of their initialization, it works.

------
ge96
Edit: nvm I read this backwards

Do you need a license of Windows 10? (Read the article)

I think now it's hardware licensed in the case of a computer that was bought
with Windows 10 on it. Then on re-installs you just get an iso of Windows 10,
no key. So in this case if you didn't have Windows 10 to begin with...

------
yarper
This looks cool! I initially thought by the title you'd made a new grub, but
was pleasantly surprised!

------
floatboth
Heh, I'm using VcXsrv + PuTTY + a custom PowerShell script
[https://github.com/myfreeweb/xvmmgr](https://github.com/myfreeweb/xvmmgr) to
quickly launch a terminal forwarded from a FreeBSD VirtualBox VM.

------
mmjaa
CTRL-F: embrace

<not found>

I disappoint! Why you no understand, this is the same ol' Microsoft?

(really I pressed Cmd-F)

------
maaaats
Can someone explain what this is for someone not really into the lingo here?

~~~
killjoywashere
He's sort of running open source desktops on a Windows 10 kernel. But not
really, there's an abstraction layer called WSL in between. There are some
interesting effects though: you can touch test.txt in Bash and then open that
file in Notepad without setting up any network shares, virtual machines, etc.

In my mind, Microsoft developed WSL to try to keep developers: if you grew up
on Linux but are now employed maintaining Windows servers, WSL gives you a way
to get to your shell of choice and maybe you won't tell your boss to migrate
from Azure to GCP or AWS.

There's a lot of stuff (notably a lot of hardware) that still doesn't work as
advertised. Graphics cards being a big one. This fellow got graphical desktops
running. Sounds like I/O is an issue, but it works.

~~~
Florin_Andrei
> _In my mind, Microsoft developed WSL to try to keep developers: if you grew
> up on Linux but are now employed maintaining Windows servers, WSL gives you
> a way to get to your shell of choice_

IMO Cygwin did that well enough before WSL.

I "grew up on Linux" (starting back in the day when it came on a stack of
floppies and nobody knew what it was) and I've always installed Cygwin on all
Windows systems where I had admin privileges. It worked fairly well for
command line stuff.

~~~
mtdewcmu
Cygwin is slow at things like process creation, I think, which made shell
scripts slow. Plus, cygwin was its own environment that required some porting,
or, at least, recompiling to get apps to work. The new Linux subsystem runs
Linux binaries at something like full speed (to the extent that I've played
with it).

------
zujko
This is really awesome!

------
Eridrus
This seems totally pointless, but also quite cool :)

Xming/VcXsrv seem to be working pretty well for me and I get to keep my
windows desktop.

------
0xTJ
I just wish you could do it the other way around from WSL. (LSW I guess)
Windows executable inside the Linux kernel.

------
lightedman
This is almost as useful as Dragon Linux on Windows nearly 20 years ago.

------
blackflame7000
Looks pretty sweet, nice work!

------
interfixus
Run your Tesla on a petrol engine.

Whatever is the bleedin' point?

~~~
nxc18
Its just a fun little project. The idea is to make you question what it means
to be a Linux desktop. Here we have very convincing (running authentic
binaries!) Linux DEs, but there's no Linux.

~~~
killjoywashere
What a great purpose! GNU/Windows indeed!

