bash on Windows is real–not a VM

I have talked to a few folks recently, and they still don’t believe bash on Windows (RS1) is ‘real’ and think it some kind of a VM. No it is not. It is the ‘real’ user mode running on Windows. It is not Cygwin, and it is not a VM. It is essentially all of the user mode (I.e. Linux without the kernel).

The kernel in this case is a wrapper around the NT kernel that translates the Linux commands to Windows and then things run. As far as Linux is concerned, its the same code and doesn’t have any changes). Technically this is called Windows Subsystem for Linux (WSL).

On windows, this is installed in the user space; so each user get their own instance effectively which is isolated from the other users. Once you install it (and if you are still reading this, then you probably know how to install it), then this shows up under C:\Users\your-user-ID\AppData\Local\lxss. If you can’t find that folder, you can still type it and navigate to it. Below is  a screen shot on what this looks like:

image

It is a little interesting and been mucking around this. Here is you can see the installation of gcc:

image

And here is the output of the CPU details:

image

<br />
root@localhost:/proc# cat cpuinfo<br />
processor       : 0<br />
vendor_id       : GenuineIntel<br />
cpu family      : 6<br />
model           : 78<br />
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz<br />
stepping        : 3<br />
microcode       : 0xffffffff<br />
cpu MHz         : 2808.000<br />
cache size      : 256 KB<br />
physical id     : 0<br />
siblings        : 4<br />
core id         : 0<br />
cpu cores       : 2<br />
apicid          : 0<br />
initial apicid  : 0<br />
fpu             : yes<br />
fpu_exception   : yes<br />
cpuid level     : 6<br />
wp              : yes<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor<br />
bogomips        : 5616.00<br />
clflush size    : 64<br />
cache_alignment : 64<br />
address sizes   : 36 bits physical, 48 bits virtual<br />
power management:</p>
<p>processor       : 1<br />
vendor_id       : GenuineIntel<br />
cpu family      : 6<br />
model           : 78<br />
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz<br />
stepping        : 3<br />
microcode       : 0xffffffff<br />
cpu MHz         : 2808.000<br />
cache size      : 256 KB<br />
physical id     : 0<br />
siblings        : 4<br />
core id         : 0<br />
cpu cores       : 2<br />
apicid          : 0<br />
initial apicid  : 0<br />
fpu             : yes<br />
fpu_exception   : yes<br />
cpuid level     : 6<br />
wp              : yes<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor<br />
bogomips        : 5616.00<br />
clflush size    : 64<br />
cache_alignment : 64<br />
address sizes   : 36 bits physical, 48 bits virtual<br />
power management:</p>
<p>processor       : 2<br />
vendor_id       : GenuineIntel<br />
cpu family      : 6<br />
model           : 78<br />
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz<br />
stepping        : 3<br />
microcode       : 0xffffffff<br />
cpu MHz         : 2808.000<br />
cache size      : 256 KB<br />
physical id     : 0<br />
siblings        : 4<br />
core id         : 1<br />
cpu cores       : 2<br />
apicid          : 0<br />
initial apicid  : 0<br />
fpu             : yes<br />
fpu_exception   : yes<br />
cpuid level     : 6<br />
wp              : yes<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor<br />
bogomips        : 5616.00<br />
clflush size    : 64<br />
cache_alignment : 64<br />
address sizes   : 36 bits physical, 48 bits virtual<br />
power management:</p>
<p>processor       : 3<br />
vendor_id       : GenuineIntel<br />
cpu family      : 6<br />
model           : 78<br />
model name      : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz<br />
stepping        : 3<br />
microcode       : 0xffffffff<br />
cpu MHz         : 2808.000<br />
cache size      : 256 KB<br />
physical id     : 0<br />
siblings        : 4<br />
core id         : 1<br />
cpu cores       : 2<br />
apicid          : 0<br />
initial apicid  : 0<br />
fpu             : yes<br />
fpu_exception   : yes<br />
cpuid level     : 6<br />
wp              : yes<br />
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor<br />
bogomips        : 5616.00<br />
clflush size    : 64<br />
cache_alignment : 64<br />
address sizes   : 36 bits physical, 48 bits virtual<br />
power management:</p>
<p>root@localhost:/proc#<br />

All, in all a very interesting world. A few things to note:

  • This is still in beta, so there will be issues.
  • It is user mode and not server mode. Live with it.
  • There would be path issues if you stray into the 256 character limit of Windows and then try and manipulate it in bash.

Happy hacking!

Published by

Amit Bahree

This blog is my personal blog and while it does reflect my experiences in my professional life, this is just my thoughts. Most of the entries are technical though sometimes they can vary from the wacky to even political – however that is quite rare. Quite often, I have been asked what’s up with the “gibberish” and the funny title of the blog? Some people even going the extra step to say that, this is a virus that infected their system (ahem) well. [:D] It actually is quite simple, and if you have still not figured out then check out this link – whats in a name?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.