10
Bubbles
5y

Okay so I have a question about Windows Linux Subsystem and idk where else to ask this.

So should I think of it as a virtual machine except instead of being a completely separate environment it’s my current computers environment?

I don’t know how to word this how I’m thinking about it but I’m trying to figure it out.

Also do Bash scripts work with it? I assume they do but it’s just a double check.

Comments
  • 2
    Think of it as a Unix emulator until WSL2 arrives.

    It uses your local file storage, but those files should only be accessed via > bash

    You can install / run a lot of Linux based software from apt.
  • 1
    @C0D4 okay. Would you recommend using it?
  • 2
    @Bubbles for simple things sure. It's good place to go when windows can't do what I want and I don't have Cygwin installed, I actually stopped using Cygwin.

    If you just want somewhere to learn the cli and not have the fuss of a full blown Vm or dual boot it works fine.
  • 0
    @C0D4 oh cool that was another question on my mind. So if i learn with it it’ll be very similar to the real thing? I’ve use the real thing but I’m on Windows 75% of the time
  • 2
    @Bubbles pretty much.
    It's not an emulator though, but for getting your head around understanding it, that's the best thing I can compare it too.
  • 1
    @C0D4 WSL2 will be working with the same virtualization as windows defender right? similar to the new windows sandbox
  • 4
    It's not an emulator tho, and it's much more light than a VM, it runs a linux kernel running with the windows kernel and it translates all the linux syscalls to the windows kernel(linux system calls, which are different and more plenty then windows ones, were implemented in windows as part of wsl) so that they are run by the windows kernel, which means a lot of the code is exectuted by windows instead of in a full virtual environment which makes it much faster than a regular VM
  • 3
    @JoshBent based on what I've read, it will work under Hyper-V, which creates the same problems we already face with docker/VMware/Virtualbox and what not.

    mind you VirtualBox 6 has support for Hyper-V so that's something.
  • 1
    @SoldierOfCode oh okay yeah, I figured it wasn’t emulation I just didn’t know how to word what I was thinking. But I like the way you worded it I was gonna explain it as lightweight vm but I just didn’t know how to express what I was thinking
  • 1
    @Bubbles always glad to help
  • 1
    We use it at work on our dotnet projects since it's a very easy setup for a best of both worlds environment where we can use Visual Studio and Make. We mostly use it for shared docker-compose setups and kubectling into our dev env.

    This is a little rambly but I remember being unsure in a similar way about what it "is".

    It's closer to a VM than an amulator or gitbash for Windows. You have a .bashrc at ~/ but you can go cd /c/Users/ltlian out of the box. You "can" find the WSL filesystem in Windows but you are absolutely not meant to access it from that direction.

    I haven't investigated running anything graphical on it but my assumption is that you won't run a desktop env. It "feels" like a unix shell, right down to using right mouse to paste.

    Scrolling sucks though.
  • 0
    @ltlian interesting so I could potentially setup a Linux C environment in it?
  • 1
    I'd think that should work just fine. Installing packages with apt, pip, and npm has always worked as expected. We mostly use Make for batching setup jobs, but I assume it's not limited by WSL at all.
  • 3
    @C0D4 @SoldierOfCode @Bubbles isn't emulation at its base translating a systems calls to the host systems calls? therefore that naming is valid.
  • 2
    @Bubbles You might want to give the idea a try of going full virtualized with something like https://unraid.net/

    I have a windows VM I use daily and for work I nomachine/x2go into my linux VM, no lag, audio redirection, clipboard support bidirectionally, ..

    It also allows me to:

    - use a proper linux environment

    - if windows shits itself, I can still do my work

    - backups are easy, because all virtual machines are e.g. qcow images

    - I can easily restore my working environment in a matter of minutes if anything happens, can't say the same about windows, but that's because it is basically my lazy machine - with games and browsing, where browsing is securely synced and games can be all redownloaded the same day, if not the same hour.
  • 1
    @C0D4 Virtual box has Hyper-V support since at least version 5.
  • 2
    @sbiewald it's experimental in 6.

    You still had to disable hyper-v to be able to use VB in 5.
  • 1
    @Bubbles Yes. It _is_ Linux, jusr limited to command line. Choose your distribution and do what you would do if it was a real machine.
  • 1
    I'd define it as a compatibility layer for linux software over windows in its current state :)
Add Comment