What is meant by a "lightweight vm" as discussed in the technology stack for WSL2? - virtualization

My understanding is that Docker on Windows currently uses a "regular VM" under the hood. WSL2 (and Docker) will switch to using a lightweight VM. But what does this actually mean; is it just using a smaller initial memory foot print with some memory passthrough technnique, or is there more to it?

TL;DR
The big change is in the move from a virtualized Linux system call interpreter for the Windows kernel in WSL to a full-on Linux kernel provided in WSL2. This move dramatically cuts down on virtualization overhead.
Juicy Details
Directly from the DevBlogs Post on the announcement of WSL2:
Microsoft will be shipping a Linux kernel with Windows ... This kernel has been specially tuned for WSL 2. It has been optimized for size and performance to give an amazing Linux experience on Windows.
This is a departure from the ways of the current (as of writing) WSL which doesn't make use of a proper Linux kernel, demonstrated in the original WSL overview from 2016.
WSL executes unmodified Linux ELF64 binaries by virtualizing a Linux kernel interface on top of the Windows NT kernel.
The WSL LXCore service runs an interpreter of sorts for native Linux system calls as well as running its own VolFs and DriveFs operations to provide file access between WSL and Windows 10, which essentially performs the role of a traditional VM's translation layer the likes of VirtualBox.
Citation: MSDN Blog
Little is known as of yet about the exact system employed for WSL2, what we do know is from the Build2019 WSL2 talk. To help answer the question regarding file system changes and the light VM:
Here, we see that the Linux kernel runs alongside the NT Kernel instead of as a virtualized environment on top of it. (as a Windows service). The lightweight VM likely comes into play for facilitating the necessary interactions between the two kernels.
This gives a peek into the inner workings of that interoperability layer. Discussed verbally in the Build2019 talk, the two kernels serve each other files via natively hosted file servers (inaccessible to the Windows userspace via means other than WSL2).
Again, much is still up in the air from our perspective as users due to the limited details currently available to us at the time of writing.

Related

MongoDB Performance : Windows 2016 Server DC vs Same machine running Hyper-V Ubuntu

I have read a few articles that say that running MongoDB on Windows is a lot slower than Linux. They mention filesystems like XFS is better than NTFS etc, and that it's more designed for Linux.
Reference Why Mongodb performance better on Linux than on Windows?
So my question is, has anyone done any benchmarking of MongoDB performance on Windows (e.g installed directly on the server) vs the same machine (running Windows) but it running a VM (Ubuntu 18.04, XFS) via HyperV?
the same machine (running Windows) but it running a VM (Ubuntu 18.04, XFS) via HyperV
The reason why Linux performs better than Windows for MongoDB is because Linux is more efficient with hardware resources (disk, memory and networking were called out in the post you referenced). Putting Linux in a Windows VM does not eliminate the overhead of Windows that makes it slower for MongoDB. Instead you would have two overheads (Linux AND Windows).
You should also troubleshoot your actual performance problems (per your other post) rather than trying random things like OS changes in the hope that they will make your performance issues go away. The particular issue might go away but chances are you'll run into another one down the road, then what?

I've heard that Smalltalk is also an OS. How can I install Smalltalk on my X86 instead of Linux or windows?

I've heard that Smalltalk is also an OS.
How can I install Smalltalk on my X86 instead of Linux or windows?
What are the steps to do that?
Any tutorials on installing Smalltalk on a bare-metal machine ?
I don't know if there is a standalone smalltalk environment, but you can try squeak, which runs above your os (linux, windows or mac). Not just an os but a complete working environment.
There was a project called SqueakNOS. That was the only post-PARC experiment to use Smalltalk directly loaded over the hardware, with no other operating system. It had even a version to work on an OLPC.
I don't know if currently someone follows that development, but it's very interesting and an excellent place to learn about hardware, in human-readable (but executable) terms. You can see and debug how a device driver works, for instance.
Smalltalk Virtual Machine is handling memory allocation, access to file systems, network connections, process (green thread)...
So viewed from Smalltalk world, it is very similar to an OS.
But how to implement the virtual machine without an underlying OS?
There is a project SqueakNOS and a fork PharoNOS meaning No Operating System, whose goal is to completely bypass the OS, and have Squeak/Pharo running on bare hardware.
So yes, it's possible.
But what you'll get with this is still a Smalltalk world, maybe not what you expect from a linux or windows distribution...

hypervisors and java virtual machine

The questions I would like to ask are:
1) What exactly does hypervisor do? Why is it needed?
2) What is the difference between hypervisor and Java Virtual mMchine?
3) Does JVM use a hypervisor?
4) When a host operating system like linux can handle multiple guest operating system,why use hypervisor?
Would be great help if someone shed light on this
A Hypervisor also known as hardware virtualization are a virtualization layer that allows running one or more native operating system on top of it, as if they run on a physical machine. It is similar to emulation but only runs operating systems that would be able to run without the Hyperviser, which are much faster.
Both are virtualization layers. However Java are optimized for performance and portability. While Java are technicaly an emulator, it are much faster than an hyperviser. This can be achieved because the emulated platform are designed for fast emulation. Java do not run x86 or x86_64/amd64 code, it runs something called Bytecode. The technical term for Bytecode are Intermediate Language (IL). It are compiled to code that are native to your processor when you run it, by the Just In Time compiler (JIT). As the JIT do a compilation process it can make sure that the program follows Java:s security constraints, by simply not generating code that violates such constraints. The Hyperviser enforce security constraints by intercepting so called privileged instructions and by emulating devices such as disk drives. This are done because native x86 or x86_64/amd64 code are very hard for a program to understand, and changing it so that it self-enforce security constraints are next to impossible. Java on the other hand runs Bytecode which are easy for a program to understand and chance so that it self-enforce security rules.
The short answer: An hyperviser are slower than Java but allows you to run a multitude of complete operating systems, and all the software available for them. This while Java are faster, but you can only run Java software on it. If you want to run Windows and Office in your virtual machine, you can't do that in Java.
I think I answered this above but no, it use code inspection and modifies the program so that it self-enforce security rules. This can be done because runnable Java application are in a intermediate state called Bytecode, which are easy for Java to understand, inspect, find code that may violate the rules and modify it in order to obey them. This are a rather complex process that have several advantage over hypervisor. The first advantage are "compile once run everywhere", as Java are compiled and distributed as bytecode. The second advantage are speed, JIT:ed code have the same speed as non-virtualized code even when strict security are enforced. The disadvantage are that only Bytecode programs can run, so you for example cannot run Windows or Linux inside the virtual machine.
If you are running another operating system like Windows or another Linux distribution - you are running an Hyperviser. KVM, Xen and VirtualBox are examples of Hypervisors. You can also run multiple instances of Linux with one shared kernel, known as OS-based virtualization or "Container". But a Container share the kernel and therefor you can only virtual machines with the OS you are running. The advantage with Containers it are more lightweight as you do not need to run multiple kernels on top of each other...
Hypervisor or virtual machine manager, is a program that allows multiple operating systems to share a single hardware host.
JVM or Java Virtual Machine interprets bytecode for a computers processor so that it can perform Java program instructions.
No JVM does not use hypervisor as it is not an virtual machine that runs an OS rather it is just a interpreter.
A host operating system manages different VMs using Hypervisor or virtual machine manager
Before answering your questions, I would recommend you search related entries in wikipedia. A hypervisor is used to run multiple guest OSes while JVM is used to interpret java byte code. JVM runs on top of OS and it doesn't care whether the OS runs on top of bare metal or on a hypervisor. Actually, linux can handle multiple guest operating systems with KVM which is part of the linux kernel. So the description of the last question is totally wrong.

Newbie Hypervisor Questions

If I install a bare-metal hypervisor (say, ESXi), would it allow me to run Windows 7 concurrently with Linux?
Would it allow me to run multiple instances of Windows 7?
When I'm sitting at the PC that's running Win7 and Linux on a hypervisor, which OS do I see when I look at the screen? (I'm suspecting that the only way to access either OS is to do a remote login.)
Assuming the answer to #2 is yes, how do you manage multiple installs of Win7 on the same hard drive?
Thanks in advance!
If you simply want to run Linux and Windows in parallel you may of course do this on e.g. ESXi. Still, the OSes would run with virtualized (or emulated) hardware available to them, i.e. you would not be able to easily access all the hardware directly and the hypervisor itself not only introduces an overhead but this overhead is not deterministic.
If you want to run an RTOS (like Real-Time Linux) or any other RTOS, then you need a "real-time hypervisor".
You can google for such hypervisors - there are a few out there.
(I dont want to recommend one here as we are a vendor of such a solution our selves)
Regards
GFL

How do i create a VM Ware Image of an AIX LPAR?

I want to clone a AIX LPAR and was wondering if the physical machine could be converted into a VM Image?
I have used the VMWare Converter to create a VM Image of a physical windows box and the documentation states that you can do that for Linux Boxes too.
http://www.vmware.com/products/converter/
I don't see information on AIX or the other UNIXes.
If creating an VM Image of an existing physical AIX box is not feasible is there any easy way to clone the AIX image to another AIX machine.
The primary intent is to avoid re-creating the setup that is already performed for the current AIX box and we want a duplicate environment with the same setup.
VMware supports x86 (and x86_64) architectures for host and guest only. IBM AIX runs on the Power architecture, and VMWare does not do architecture emulation, so what you want does not exist.
If you want to back up/clone your AIX instance to another machine, look for information regarding mksysb and AIX Sysback.
You might want to take a look at the following, but there are no guarantees, and I'm fairly certain running AIX on anything but a Power architecture is still not a reality at this time:
Qemu
PearPC
Based on further reading, i understand that VMWare does not support AIX. The guest OS can primarily be Windows, various distros of LINUX and Mac-OSX. I also see Solaris as a supported guest OS, but i don't see AIX. So i don't think this is possible.
I would have to look at the Virtualization features supported from IBM for this activity.
Thanks,
Manglu