<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Virtualization on Council of Elrond</title><link>https://songkou.github.io/tags/virtualization/</link><description>Recent content in Virtualization on Council of Elrond</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 01 Jan 2021 14:52:01 +0800</lastBuildDate><atom:link href="https://songkou.github.io/tags/virtualization/index.xml" rel="self" type="application/rss+xml"/><item><title>Linux_name_space</title><link>https://songkou.github.io/posts/linux_name_space/</link><pubDate>Fri, 01 Jan 2021 14:52:01 +0800</pubDate><guid>https://songkou.github.io/posts/linux_name_space/</guid><description>&lt;h1 id="linux-namespace"&gt;Linux NameSpace&lt;/h1&gt;
&lt;p&gt;Docker denpends on Linux NameSpace, Thus this is a brief explaination on linux name space.&lt;/p&gt;
&lt;p&gt;We can use unshare command to manipulate/playaround with linux name spaces.&lt;/p&gt;
&lt;h2 id="how-to-check-what-kind-of-linux-namespace-is-supported"&gt;How to check what kind of linux namespace is supported&lt;/h2&gt;
&lt;p&gt;We can use “man unshare” to check what kind of linux namespace is supported. There are 8 types of name spaces:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; mount namespace
 Mounting and unmounting filesystems will not affect the rest of the system (CLONE_NEWNS flag), except for filesystems which are explicitly marked as shared (with mount --make-shared; see /proc/self/mountinfo or
 findmnt -o+PROPAGATION for the shared flags).

 unshare automatically sets propagation to private in the new mount namespace to make sure that the new namespace is really unshared. This feature is possible to disable by option --propagation unchanged. Note
 that private is the kernel default.

 UTS namespace
 Setting hostname or domainname will not affect the rest of the system. (CLONE_NEWUTS flag)

 IPC namespace
 The process will have an independent namespace for System V message queues, semaphore sets and shared memory segments. (CLONE_NEWIPC flag)

 network namespace
 The process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the /proc/net and /sys/class/net directory trees, sockets, etc. (CLONE_NEWNET flag)

 pid namespace
 Children will have a distinct set of PID to process mappings from their parent. (CLONE_NEWPID flag)

 user namespace
 The process will have a distinct set of UIDs, GIDs and capabilities. (CLONE_NEWUSER flag)

 See clone(2) for the exact semantics of the flags.
&lt;/code&gt;&lt;/pre&gt;&lt;ol&gt;
&lt;li&gt;Mount（mnt） isolate mounting space&lt;/li&gt;
&lt;li&gt;Process ID (pid) isolate process ID.&lt;/li&gt;
&lt;li&gt;Network (net) isolate network , port ID, etc&lt;/li&gt;
&lt;li&gt;Interprocess Communication (ipc) isolate System V IPC &amp;amp; POSIX message queues&lt;/li&gt;
&lt;li&gt;UTS Namespace(uts) Isolate hostname and domain name&lt;/li&gt;
&lt;li&gt;User Namespace (user) isolate user group and users.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Additionally, Linux 4.6 and 5.6 introduced cgroups and time two types. in total it’s 8.&lt;/p&gt;</description></item></channel></rss>