1 21b-Virtualization


Previous: 21a-OSHardening.html

https://en.wikipedia.org/wiki/Down_the_Rabbit_Hole
21b-Virtualization/vms.jpg

1.1 Screencasts

Included as part of lecture: 21a-OSHardening.html

1.2 Background and reading

../../DataStructuresLab/Content/00-VirtualMachines.html

https://doc.opensuse.org/documentation/leap/virtualization/html/book.virt/book.virt.html

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/virtualization_getting_started_guide/

1.3 Benefits: why virtualize?

1.4 Hypervisors and Virtual Machines

https://en.wikipedia.org/wiki/Virtual_machine
* A virtual machine (VM) is an emulation of a computer system.
* Virtual machines are based on computer architectures and provide functionality of a physical computer.
* Their implementations may involve specialized hardware, software, or a combination.
* Software simulates hardware, so that an operating system can run inside of a software environment.

https://en.wikipedia.org/wiki/Hypervisor
* A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines.
* A computer on which a hypervisor runs one or more virtual machines is called a host machine.
* Each virtual machine is called a guest machine.
* The hypervisor presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems.

1.4.1 Normal OS

21b-Virtualization/f1-crop.png

1.4.2 Two types of hypervisor (and another category below)

21b-Virtualization/hyper.png

1.4.3 Type-1, native or bare-metal hypervisors

21b-Virtualization/f2-crop.png
21b-Virtualization/Type-1-Hypervisor.png
21b-Virtualization/type2.png

1.4.4 Type-2 or hosted hypervisors

21b-Virtualization/f3-crop.png
21b-Virtualization/Type-2-Hypervisor.png
21b-Virtualization/type1.png

1.4.5 Levels (within type 1 and 2)

1.4.6 Type-3: Containers (OS-level pseudo-virtualization)

https://en.wikipedia.org/wiki/Container_(virtualization)
https://en.wikipedia.org/wiki/LXC
21b-Virtualization/containers.png

1.4.6.1 chroot jail (almost a container)

1.4.6.2 Container

Warning:
* Containers like docker are pretty easy to escape.
* Use them only for minor sandboxing purposes.

1.5 Examples (of all types)

1.5.1 Virtualbox (type 2)

1.5.2 KVM (type 2)

21b-Virtualization/kvm0.png
21b-Virtualization/KVM.png

1.5.3 Xen (type 1)

21b-Virtualization/Xen-architecture-29.png
21b-Virtualization/Xen.png

1.5.4 Docker (container)

https://en.wikipedia.org/wiki/LXC
https://en.wikipedia.org/wiki/Docker_(software)
https://codereviewvideos.com/course/docker-tutorial-for-beginners
21b-Virtualization/docker.png

Docker vs. VM:
21b-Virtualization/docker2.png

21b-Virtualization/vm-vs-docker-diagram.png

+++++++++++++++++++++
Cahoot-21b.1

1.6 Management of VMs

1.6.1 Virtualbox manager

21b-Virtualization/Screenshot_20180606_013918.png

1.6.2 Libvirt (interface to many backend hypervisors)

21b-Virtualization/libvirt.png

1.6.3 VM-based operating systems

Security by isolation, in addition to security by correctness

1.6.3.1 Spectrum OS

https://spectrum-os.org/

1.6.3.2 Bottlerocket OS

https://github.com/bottlerocket-os

1.6.3.3 Rancher OS

https://rancher.com/

1.6.3.4 Fedora silverblue OS

https://silverblue.fedoraproject.org/
https://fedoramagazine.org/what-is-silverblue/

1.6.3.5 Genode OS

A compartmentalized micro-kernel OS framework
* https://genode.org/index
* https://en.wikipedia.org/wiki/Genode

1.6.3.6 CLIP os

https://clip-os.org/en/

1.6.3.7 SubGraph OS: docker containers for isolation

21b-Virtualization/sgos.png
* Not really a mature/stable/alive project.
* Known exploits can escape docker containers with relative ease.

1.6.3.8 Qubes OS

Bare metal hypervisor (Xen), with full VM for isolation.
* https://www.qubes-os.org/intro/
* https://www.qubes-os.org/video-tours/
21b-Virtualization/qubes0.png

Qubes OS: detailed
21b-Virtualization/qubes-trust-level-architecture.png
21b-Virtualization/r4.0-snapshot12.png
21b-Virtualization/r4.0-qubes-manager.png
21b-Virtualization/qubes-partition-data-flows.jpg
21b-Virtualization/qubes-components.png

1.7 Security and virtualization

21b-Virtualization/sandboxes.png

Are we going in circles here… what about security by correctness and minimalism?

1.8 Unikernels

1.9 Microkernels

https://en.wikipedia.org/wiki/Microkernel
In computer science, a microkernel (often abbreviated as μ-kernel) is the near-minimum amount of software that can provide the mechanisms needed to implement an operating system (OS). These mechanisms include low-level address space management, thread management, and inter-process communication (IPC).

If the hardware provides multiple rings or CPU modes, the microkernel may be the only software executing at the most privileged level, which is generally referred to as supervisor or kernel mode. Traditional operating system functions, such as device drivers, protocol stacks and file systems, are typically removed from the microkernel itself and are instead run in user space.

In terms of the source code size, microkernels are often smaller than monolithic kernels.

1.9.1 Minix

https://www.minix3.org/
https://en.wikipedia.org/wiki/Minix
The MINIX3 microkernel, for example, has approximately 12,000 lines of code, compared to 12,000,000 for a small monolithic kernel.

1.9.2 Redox

https://www.redox-os.org
https://en.wikipedia.org/wiki/Redox_(operating_system)
Inspired by those like Minix, but written in a memory safe language, Rust.

1.9.3 xous

Microkernel in Rust
https://betrusted.io/xous-book/ch00-00-introduction.html
https://github.com/betrusted-io/xous-core

1.9.4 rCore

Educational kernel in Rust
https://github.com/rcore-os/rCore
https://github.com/rcore-os/zCore

1.9.5 Other minimalist operating systems

https://softwareengineering.stackexchange.com/questions/117973/are-there-any-os-which-are-simple-enough-for-learning
https://homepage.divms.uiowa.edu/~jones/opsys/notes/06.shtml

1.10 Virtual networking

https://en.wikipedia.org/wiki/Network_virtualization

Note: More to come here when we get to the next section (Networking) when you will build your own virtual network.

1.10.1 VirtualBox

1.10.2 KVM

1.10.3 Xen

1.10.4 Qubes

1.11 Meta-management

How do you manage and build hordes of networked VMs in your virtual network?

1.11.1 Mass-administration and provisioning

+++++++++++++++++++++
Cahoot-21b.2

Next: 21d-PracticalPersonal.html