How did we create a virtual machine?
Start with a physical machine.
Create software (hypervisor) responsible for isolating the guest OS inside the VM
VM resources (memory, disk, networking, etc) are provided by the physical machine but visibility outside of the VM is limited
What are the three implications of creating a virtual machine?
How do we create a virtual operating system (container)?
What are the 3 implications of creating a virtual operating system (container)?
True or False: You can run Windows inside a container provided by Linux.
FALSE. Container shares the kernel with the host
True or False: You can run SUSE Linux inside an Ubuntu container.
TRUE. As long as both distributions use the same kernel, differences are confined to different binary tools and file locations
True or False: Running ps inside the container will show all processes.
FALSE. Container process namespaces is isolated from the host
What is the difference between hypervisor and container virtualization?
The hypervisor exists above the Host OS and on top of that hypervisor are a number of Guest OSs. Above each Guest OS is a copy of the binaries/libraries and then the apps.
In container virtualization, multiple copies of the binaries/libraries and apps sit on top of the Host OS.
Why virtualize an operating system?
Shares many (but not all) of the benefits of hardware virtualization with much lower overhead
Describe the three properties of Decoupling in container virtualization
Describe the two properties of Isolation in container virtualization
What is the hardware virtualization system call path?
Application inside the VM makes a system call.
Trap to the host OS (or hypervisor)
Hand trap back to the guest OS
What is the OS virtualization system call path?
Application inside the container makes a system call.
Trap to the OS.
Remember all of the work we had to do to deprivilege the guest OS and deal with uncooperative machine architectures like x86? OS virtualization does not require any of this: there is only one OS!
What kind of names must the container virtualize?
Process IDs:
File names:
User names:
Host name and IP address:
-processes inside the container may use a different host name and IP address when performing network operations
What resources does OS virtualization concern itself with?
IOW: The OS may want to ensure that the entire container - or everything that runs inside it - cannot consume more than a certain amount of:
CPU time
Memory
Disk or network bandwidth
What resources does Linux provide namespace separation for?
Mount points, process IDs, network, and devices.
Describe how Linux handles namespace separation for mounting points.
Allows different namespaces to see different views of the file system
Describe how Linux handles namespace separation for process IDs.
New processes are allocated IDs in their current namespace and all parent namespaces
Describe how Linux handles namespace separation for networks.
Namespaces can have private IP addresses and their own routing tables, and can communicate with other namespaces through virtual interfaces
Describe how Linux handles namespace separation for devices.
Devices can be present or hidden in different namespaces
What do cgroups do?
cgrousp make it possible to control the resources (CPU time, memory, disk or network bandwidth) allocated to a set of processes
How does path name resolution work in UnionFS?
UnionFS is a stackable unification file system
First: Does foo/bar exist in the top layer? If yes, return its contents
Else: Does foo/bar exist in the next layer? If yes, return its contents.
Etc…
Note: Can also stop at a certain point if access is only permitted to a certain level
What is the principle underlying copy-on-write file systems?
Only make modifications to the underlying file system when the container modifies files
This speeds start up and reduces storage usage (the container mainly needs read-only access to host files)
What is Docker?
Docker builds on previous technologies: