lxc-unshare - Online Linux Manual PageSection : 1
Updated : 2021-01-26
Source :
Note :
NAMElxc-unshare − Run a task in a new set of namespaces.
SYNOPSIS.fi lxc-unshare {-s, --namespaces namespaces} [-u, --user user] [-H, --hostname hostname] [-i, --ifname ifname] [-d, --daemon] [-M, --remount] {command}
DESCRIPTIONlxc-unshare can be used to run a task in a cloned set of namespaces. This command is mainly provided for testing purposes. Despite its name, it always uses clone rather than unshare to create the new task with fresh namespaces. Apart from testing kernel regressions this should make no difference.
OPTIONS\FC\fB\-s, \-\-namespaces \fR\*(T>\fInamespaces\fR Specify the namespaces to attach to, as a pipe-separated list, e.g. NETWORK|IPC. Allowed values are MOUNT, PID, UTSNAME, IPC, USER and NETWORK. This allows one to change the context of the process to e.g. the network namespace of the container while retaining the other namespaces as those of the host. (The pipe symbol needs to be escaped, e.g. MOUNT\|PID or quoted, e.g. "MOUNT|PID".) \FC\fB\-u, \-\-user \fR\*(T>\fIuser\fR Specify a userid which the new task should become. \FC\fB\-H, \-\-hostname \fR\*(T>\fIhostname\fR Set the hostname in the new container. Only allowed if the UTSNAME namespace is set. \FC\fB\-i, \-\-ifname \fR\*(T>\fIinterfacename\fR Move the named interface into the container. Only allowed if the NETWORK namespace is set. You may specify this argument multiple times to move multiple interfaces into container. \FC\fB\-d, \-\-daemon\fR\*(T> Daemonize (do not wait for the container to exit before exiting) \FC\fB\-M, \-\-remount\fR\*(T> Mount default filesystems (/proc /dev/shm and /dev/mqueue) in the container. Only allowed if MOUNT namespace is set.
EXAMPLESTo spawn a new shell with its own UTS (hostname) namespace, \FC
lxc−unshare −s UTSNAME /bin/bash
If the hostname is changed in that shell, the change will not be reflected on the host. To spawn a shell in a new network, pid, and mount namespace, \FC
lxc−unshare −s "NETWORK|PID|MOUNT" /bin/bash
The resulting shell will have pid 1 and will see no network interfaces. After re-mounting /proc in that shell, \FC
mount −t proc proc /proc
ps output will show there are no other processes in the namespace. To spawn a shell in a new network, pid, mount, and hostname namespace. \FC
lxc−unshare −s "NETWORK|PID|MOUNT|UTSNAME" −M −H myhostname −i veth1 /bin/bash
The resulting shell will have pid 1 and will see two network interfaces (lo and veth1). The hostname will be "myhostname" and /proc will have been remounted. ps output will show there are no other processes in the namespace.
SEE ALSOlxc(7), lxc-create(1), lxc-copy(1), lxc-destroy(1), lxc-start(1), lxc-stop(1), lxc-execute(1), lxc-console(1), lxc-monitor(1), lxc-wait(1), lxc-cgroup(1), lxc-ls(1), lxc-info(1), lxc-freeze(1), lxc-unfreeze(1), lxc-attach(1), lxc.conf(5)
AUTHORDaniel Lezcano <\FCdaniel.lezcano@free.fr\*(T>> 0
Johanes Gumabo
Data Size : 11,490 byte
man-lxc-unshare.1Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 200,885
Visitor ID : :
Visitor IP : 18.218.219.11 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 10 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (rof_escape_sequence|91|lxc-unshare.1|2|\FC |.ds T< \\FC
) (rof_fi|19|lxc-unshare.1|13|1|.fi
) (rof_nr_xx|137|lxc-unshare.1|17|\n(.iu+\nxu |'in \n(.iu+\nxu
) (rof_unit_scale_ch|22|lxc-unshare.1|17|u+\nxu|'in \n(.iu+\nxu
) (rof_in|18|lxc-unshare.1|17|\n(.iu+\nxu|'in \n(.iu+\nxu
) (rof_nr_xx|137|lxc-unshare.1|19|\n(.iu-\nxu |'in \n(.iu-\nxu
) (rof_unit_scale_ch|22|lxc-unshare.1|19|u-\nxu|'in \n(.iu-\nxu
) (rof_in|18|lxc-unshare.1|19|\n(.iu-\nxu|'in \n(.iu-\nxu
) (rof_escape_sequence|91|lxc-unshare.1|30|\FC\fB\-s, \-\-namespaces \fR\*(T>\fInamespaces\fR |\*(T<\fB\-s, \-\-namespaces \fR\*(T>\fInamespaces\fR
) (rof_escape_sequence|91|lxc-unshare.1|43|\FC\fB\-u, \-\-user \fR\*(T>\fIuser\fR |\*(T<\fB\-u, \-\-user \fR\*(T>\fIuser\fR
) (rof_escape_sequence|91|lxc-unshare.1|46|\FC\fB\-H, \-\-hostname \fR\*(T>\fIhostname\fR |\*(T<\fB\-H, \-\-hostname \fR\*(T>\fIhostname\fR
) (rof_escape_sequence|91|lxc-unshare.1|50|\FC\fB\-i, \-\-ifname \fR\*(T>\fIinterfacename\fR |\*(T<\fB\-i, \-\-ifname \fR\*(T>\fIinterfacename\fR
) (rof_escape_sequence|91|lxc-unshare.1|56|\FC\fB\-d, \-\-daemon\fR\*(T> |\*(T<\fB\-d, \-\-daemon\fR\*(T>
) (rof_escape_sequence|91|lxc-unshare.1|59|\FC\fB\-M, \-\-remount\fR\*(T> |\*(T<\fB\-M, \-\-remount\fR\*(T>
) (rof_escape_sequence|91|lxc-unshare.1|66|\FC|\*(T<
) (rof_escape_sequence|91|lxc-unshare.1|77|\FC|\*(T<
) (rof_escape_sequence|91|lxc-unshare.1|86|\FC|\*(T<
) (rof_escape_sequence|91|lxc-unshare.1|97|\FC|\*(T<
) (rof_escape_sequence|91|lxc-unshare.1|125|\FCdaniel.lezcano@free.fr\*(T>> |Daniel Lezcano <\*(T>
)