https://wiki.archlinux.org/api.php?action=feedcontributions&user=Drkhsh&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:25:03ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Linux_Containers&diff=434652Linux Containers2016-05-11T09:12:29Z<p>Drkhsh: Removed systemd considerations (see https://github.com/lxc/lxc/pull/1011)</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:Virtualization]]<br />
[[ja:Linux Containers]]<br />
[[pt:Linux Containers]]<br />
{{Related articles start}}<br />
{{Related|LXD}}<br />
{{Related|AirVPN}}<br />
{{Related|Cgroups}}<br />
{{Related|Docker}}<br />
{{Related|OpenVPN}}<br />
{{Related|OpenVPN in Linux containers}}<br />
{{Related|PeerGuardian Linux}}<br />
{{Related|systemd-nspawn}}<br />
{{Related articles end}}<br />
<br />
Linux Containers (LXC) is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host (LXC host). It does not provide a virtual machine, but rather provides a virtual environment that has its own CPU, memory, block I/O, network, etc. space and the resource control mechanism. This is provided by [[Wikipedia:Linux namespaces|namespaces]] and [[cgroups]] features in Linux kernel on LXC host. It is similar to a chroot, but offers much more isolation.<br />
<br />
Alternatives for using containers are [[systemd-nspawn]] and [[docker]].<br />
<br />
== Setup ==<br />
=== Required software ===<br />
Install the {{Pkg|lxc}} and {{Pkg|arch-install-scripts}} packages.<br />
<br />
Verify that the running kernel is properly configured to run a container:<br />
$ lxc-checkconfig<br />
<br />
Due to security concerns, the default Arch kernel does '''not''' ship with the ability to run containers as an unprivileged user; therefore, it is normal to see a '''missing''' status for "User namespaces" when running the check. See {{Bug|36969}} for this feature request.<br />
<br />
=== Host Network Configuration ===<br />
LXCs support different virtual network types. A bridge device on the host is required for most types of virtual networking. The examples of creating a bridge provided below are not meant to be limiting, but illustrative. Users may use other programs to achieve the same results. A wired and wireless example is provided below, but other setups are possible. Users are referred to the [[Network bridge]] article for additional options.<br />
<br />
{{Merge|Network bridge|Duplication; this is not a guide on Linux networking.}}<br />
<br />
==== Example for a wired network ====<br />
<br />
This example uses [[netctl]]: a bridge template can be found in {{ic|/etc/netctl/examples}} which needs to be edited to match the host network hardware specs and IP ranges of the host network. Below are two example bridge configs, one using a dhcp setup and the other using a static IP setup.<br />
<br />
{{hc|1=/etc/netctl/lxcbridge|2=<br />
Description="LXC bridge"<br />
Interface=br0<br />
Connection=bridge<br />
BindsToInterfaces=('eno1')<br />
IP=dhcp<br />
SkipForwardingDelay=yes}}<br />
<br />
{{hc|1=/etc/netctl/lxcbridge|2=<br />
Description="LXC bridge"<br />
Interface=br0<br />
Connection=bridge<br />
BindsToInterfaces=('eno1')<br />
IP=static<br />
Address=192.168.0.2/24<br />
Gateway='192.168.0.1'<br />
DNS=('192.168.0.1')}}<br />
<br />
Before attempting to start the bridge, [[disable]] the running network interface on the host as the bridge will replace it; this depends on how the host network is configured, common networking examples are shown in [[Beginners' guide#Configure the network]].<br />
<br />
For users already using netctl to manage an adapter, simply switch-to it:<br />
# netctl switch-to lxcbridge<br />
# netctl enable lxcbridge<br />
<br />
Verify network connectivity on the host before continuing. This can be accomplished with a simple ping:<br />
$ ping -c 1 www.google.com<br />
<br />
==== Example for a wireless network ====<br />
<br />
Wireless networks cannot be bridged directly; a different method must be used in this case. First, a bridge must be created similar to the previous examples, but it should not have any interface defined to it (other than the virtual interface of the container itself, which is done automatically). Assign a static IP address to the bridge, but do not assign a gateway.<br />
<br />
The host must be configured to perform NAT using [[iptables]]:<br />
<br />
# iptables -t nat -A POSTROUTING -o ''wlp3s0'' -j MASQUERADE<br />
<br />
where {{ic|''wlp3s0''}} is the name of the wireless interface. [[Internet_sharing#Enable_packet_forwarding|Enable packet forwarding]], which is disabled by default.<br />
<br />
The remaining steps are similar, except for one thing: for the container, the gateway must be configured to be the IP address of the host (in this example, it was 192.168.0.2). This is specified in {{ic|/var/lib/lxc/''container_name''/config}} (see the following sections).<br />
<br />
=== Container creation ===<br />
Select a template from {{ic|/usr/share/lxc/templates}} that matches the target distro to containerize. Users wishing to containerize non-Arch distros will need additional packages on the host depending on the target distro:<br />
* Debian-based: {{Pkg|debootstrap}}<br />
* Fedora-based: {{AUR|yum}}<br />
<br />
Run {{ic|lxc-create}} to create the container, which installs the root filesystem of the LXC to {{ic|/var/lib/lxc/CONTAINER_NAME/rootfs}} by default. Example creating an Arch Linux LXC named "playtime":<br />
# lxc-create -n playtime -t /usr/share/lxc/templates/lxc-archlinux<br />
<br />
{{Tip|Users may optionally install {{Pkg|haveged}} and [[start]] {{ic|haveged.service}} to avoid a perceived hang during the setup process while waiting for system entropy to be seeded. Without it, the generation of private/GPG keys can add a lengthy wait to the process.}}<br />
<br />
{{Tip|Users of [[Btrfs]] can append {{ic|-B btrfs}} to create a Btrfs subvolume for storing containerized rootfs. This comes in handy if cloning containers with the help of {{ic|lxc-clone}} command. [[ZFS]] users may use {{ic|-B zfs}}, correspondingly.}}<br />
<br />
{{Tip|As of July 2015, creating an empty container using {{ic|-t none}} does not work, see the [https://bugs.launchpad.net/bugs/1466458 bug report]. As a workaround one can use {{ic|-t /bin/true}}.}}<br />
<br />
=== Container configuration ===<br />
==== Basic config with networking ====<br />
System resources to be virtualized/isolated when a process is using the container are defined in {{ic|/var/lib/lxc/CONTAINER_NAME/config}}. By default, the creation process will make a minimum setup without networking support. Below is an example config with networking:<br />
<br />
{{hc|/var/lib/lxc/playtime/config|<nowiki><br />
# Template used to create this container: /usr/share/lxc/templates/lxc-archlinux<br />
# Parameters passed to the template:<br />
# For additional config options, please look at lxc.container.conf(5)<br />
<br />
## default values<br />
lxc.rootfs = /var/lib/lxc/playtime/rootfs<br />
lxc.utsname = playtime<br />
lxc.arch = x86_64<br />
lxc.include = /usr/share/lxc/config/archlinux.common.conf<br />
<br />
## network<br />
lxc.network.type = veth<br />
lxc.network.link = br0<br />
lxc.network.flags = up<br />
lxc.network.ipv4 = 192.168.0.3/24<br />
lxc.network.ipv4.gateway = 192.168.0.1<br />
lxc.network.name = eth0<br />
<br />
## mounts<br />
## specify shared filesystem paths in the format below<br />
## make sure that the mount point exists on the lxc<br />
#lxc.mount.entry = /mnt/data/share mnt/data none bind 0 0<br />
#<br />
# if running the same Arch linux on the same architecture it may be<br />
# adventitious to share the package cache directory<br />
#lxc.mount.entry = /var/cache/pacman/pkg var/cache/pacman/pkg none bind 0 0<br />
</nowiki>}}<br />
<br />
==== Xorg program considerations (optional) ====<br />
In order to run programs on the host's display, some bind mounts need to be defined so that the containerized programs can access the host's resources. Add the following section to {{ic|/var/lib/lxc/playtime/config}}:<br />
## for xorg<br />
## fix overmounting see: https://github.com/lxc/lxc/issues/434<br />
lxc.mount.entry = tmpfs tmp tmpfs defaults<br />
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir<br />
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir<br />
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir<br />
lxc.mount.entry = /dev/video0 dev/video0 none bind,optional,create=file<br />
<br />
If you still get a permission denied error in your LXC guest, then you may need to call {{ic|xhost +}} in your host to allow the guest to connect to the host's display server. Take note of the security concerns of opening up your display server by doing this.<br />
<br />
==== OpenVPN considerations ====<br />
<br />
Users wishing to run [[OpenVPN]] within the container should read the [[OpenVPN in Linux containers]] article.<br />
<br />
== Managing Containers ==<br />
<br />
To list all installed LXC containers:<br />
# lxc-ls -f<br />
<br />
Systemd can be used to [[start]] and to [[stop]] LXCs via {{ic|lxc@CONTAINER_NAME.service}}. [[Enable]] {{ic|lxc@CONTAINER_NAME.service}} to have it start when the host system boots.<br />
<br />
Users can also start/stop LXCs without systemd.<br />
Start a container:<br />
# lxc-start -n CONTAINER_NAME<br />
<br />
Stop a container:<br />
# lxc-stop -n CONTAINER_NAME<br />
<br />
To login into a container:<br />
# lxc-console -n CONTAINER_NAME<br />
<br />
Once logged, treat the container like any other linux system, set the root password, create users, install packages, etc.<br />
<br />
To attach to a container:<br />
# lxc-attach -n CONTAINER_NAME<br />
<br />
It works nearly the same as lxc-console, but you are automatically accessing root prompt inside the container, bypassing login.<br />
<br />
== Running Xorg programs ==<br />
Either attach to or [[SSH]] into the target container and prefix the call to the program with the DISPLAY ID of the host's X session. For most simple setups, the display is always 0.<br />
<br />
An example of running Firefox from the container in the host's display:<br />
$ DISPLAY=:0 firefox<br />
<br />
Alternatively, to avoid directly attaching to or connecting to the container, the following can be used on the host to automate the process:<br />
# lxc-attach -n playtime --clear-env -- sudo -u YOURUSER env DISPLAY=:0 firefox<br />
<br />
== Troubleshooting ==<br />
<br />
=== root login fails ===<br />
<br />
If you get the following error when you try to login using lxc-console:<br />
<br />
login: root<br />
Login incorrect<br />
<br />
And the container's {{ic|journalctl}} shows:<br />
<br />
pam_securetty(login:auth): access denied: tty 'pts/0' is not secure !<br />
<br />
Add {{ic|pts/0}} to the list of terminal names in {{ic|/etc/securetty}} on the '''container''' filesystem, see [http://unix.stackexchange.com/questions/41840/effect-of-entries-in-etc-securetty/41939#41939]. You can also opt to delete {{ic|/etc/securetty}} on the '''container''' to allow always root to login, see [https://github.com/systemd/systemd/issues/852].<br />
<br />
Alternatively, create a new user in lxc-attach and use it for logging in to the system, then switch to root.<br />
<br />
# lxc-attach -n playtime<br />
[root@playtime]# useradd -m -Gwheel newuser<br />
[root@playtime]# passwd newuser<br />
[root@playtime]# passwd root<br />
[root@playtime]# exit<br />
# lxc-console -n playtime<br />
[newuser@playtime]$ su<br />
<br />
===no network-connection with veth in container config===<br />
<br />
If you can't access your LAN or WAN with a networking interface configured as '''veth''' and setup through {{ic|/etc/lxc/''containername''/config}}.<br />
If the virtual interface gets the ip assigned and should be connected to the network correctly.<br />
ip addr show veth0 <br />
inet 192.168.1.111/24<br />
You may disable all the relevant static ip formulas and try setting the ip through the booted container-os like you would normaly do.<br />
<br />
Example {{ic|''container''/config}}<br />
<br />
...<br />
lxc.network.type = veth<br />
lxc.network.name = veth0<br />
lxc.network.flags = up<br />
lxc.network.link = {{ic|bridge}}<br />
...<br />
<br />
And then assign your IP through your preferred method '''inside''' the container, see also [[Network configuration#Configure the IP address]].<br />
<br />
== See also ==<br />
<br />
* [https://www.stgraber.org/2013/12/20/lxc-1-0-blog-post-series/ LXC 1.0 Blog Post Series]<br />
* [http://www.ibm.com/developerworks/linux/library/l-lxc-containers/ LXC@developerWorks]<br />
* [http://docs.docker.io/en/latest/installation/archlinux/ Docker Installation on ArchLinux]</div>Drkhshhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=423346Dotfiles2016-02-28T13:34:52Z<p>Drkhsh: Changed from urxvt to st</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{Related articles start}}<br />
{{Related|XDG Base Directory support}}<br />
{{Related articles end}}<br />
This article collects user repositories with custom configuration files, commonly known as ''dotfiles''.<br />
<br />
== Version control ==<br />
<br />
Managing dotfiles with version control software such as [[Git]] helps to keep track of changes, share with others, and synchronize dotfiles across various hosts.<br />
<br />
=== Using gitignore ===<br />
<br />
Keeping a [https://git-scm.com/blog/2010/04/11/environment.html git directory] inside the home folder allows to directly keep track of changes. It is recommended to selectively add file contents to the index with [http://git-scm.com/docs/git-add git add]. <br />
<br />
To prevent untracked files (appearing in commits and removed by [http://git-scm.com/docs/git-clean git clean]), first exclude all files with [http://git-scm.com/docs/gitignore gitignore]:<br />
<br />
{{hc|~/.git/info/exclude|<br />
*}}<br />
<br />
Then use {{ic|git add -f}}, for example:<br />
<br />
$ git add -f ~/.config/*<br />
<br />
And [http://git-scm.com/docs/git-commit commit] the changes:<br />
<br />
$ git commit -a<br />
<br />
=== Other tools ===<br />
<br />
* {{App|vcsh|Allows separating differents modules (e.g., Emacs config vs. zsh config) into individual repositories which can be maintained separately, as opposed to keeping all dotfiles in a single repository. Works with git only.|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}<br />
* {{App|yadm|Manages files across systems using a single Git repository. Provides a way to use alternate files on a specific OS or host. Supplies a method of encrypting confidential data so it can safely be stored in your repository.|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm}}}}<br />
* {{App|etckeeper|Intended to version-control system-wide configuration in /etc. Works by keeping track of permissions and modes which version-control software often ignores. Can use various SCM systems as a backend. Hooks can auto-commit changes to the repository before a system-upgrade; for pacman, these hooks currently have to be triggered manually.|http://joeyh.name/code/etckeeper/|{{Pkg|etckeeper}}}}<br />
* {{App|GNU Stow|Can be used to symlink dotfiles from a repository into the $HOME tree. See [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] for more information.|http://www.gnu.org/software/stow/|{{Pkg|stow}}}}<br />
<br />
=== Maintaining dotfiles across multiple machines ===<br />
<br />
{{Style|This and the section below need a rewrite}}<br />
<br />
One way of maintaining dotfiles across various machines across various hosts while still allowing for per-host customizations, is by maintaining a master-branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; as shared configuration is added to the master-branch, the per-machine branches are then rebased on top of the updated master.<br />
<br />
=== Confidential information ===<br />
<br />
Occasionally, software may keep plain-text passwords in configuration files, as opposed to hooking into a keyring. In these cases, git clean-filters may be handy to avoid accidentally commiting confidential information. E. g., the following .gitattributes file assigns a filter to the file “some-dotfile”:<br />
<br />
<pre><br />
# .gitattributes<br />
some-dotfile filter=remove-pass<br />
</pre><br />
<br />
Whenever the file “some-dotfile” is checked into git, git will invoke the filter “remove-pass” on the file before checking it in. The filter must be defined in .git/config, e. g.:<br />
<br />
<pre><br />
[filter "remove-pass"]<br />
clean = "sed -e 's/^password=.*/#password=TODO/'"<br />
</pre><br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://bitbucket.org/ambrevar/dotfiles Ambrevar]<br />
| zsh || awesome || emacs || rxvt-unicode || || cmus || htop/vicious || mutt ||<br />
|-<br />
! [https://github.com/bamos/dotfiles bamos]<br />
| zsh || i3/xmonad || vim/emacs || rxvt-unicode || tmux || mpv/cmus || conky/xmobar || mutt || ERC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]<br />
|-<br />
! [https://github.com/cinelli/dotfiles cinelli]<br />
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat<br />
|-<br />
! [https://github.com/drkh5h/dotfiles drkhsh]<br />
| zsh || dwm || vim || st || screen || cmus || conky || mutt || weechat<br />
|-<br />
! [https://github.com/Earnestly/dotfiles Earnestly]<br />
| zsh || i3/orbment || vim/emacs || termite || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/ErikBjare/dotfiles ErikBjare]<br />
| zsh || xmonad/xfce4 || vim || terminator || tmux || || xfce4-panel || || weechat<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/insanum/dotfiles insanum]<br />
| bash || herbstluftwm || vim || evilvte || tmux || || dzen || mutt-kz ||<br />
|-<br />
! [https://github.com/izmntuk/archiso/tree/testing/configs/alter/airootfs/ izmntuk]<br />
| zsh || xfce4 || vim || rxvt-unicode/yaft || tmux || cmus || xfce4-panel || || irssi<br />
|-<br />
! [https://bitbucket.org/jasonwryan/shiv/src jasonwryan]<br />
| bash/zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irrsi<br />
|-<br />
! [https://github.com/jelly/Dotfiles jelly]<br />
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat<br />
|-<br />
! [https://github.com/meskarune/.dotfiles meskarune]<br />
| bash || herbstluftwm || vim || rxvt-unicode || screen || || conky || || weechat<br />
|-<br />
! [https://github.com/neersighted/dotfiles neersighted]<br />
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [https://github.com/vodik/dotfiles vodik]<br />
| zsh || xmonad || vim || termite-git || tmux || ncmpcpp || custom || mutt || weechat<br />
|-<br />
! [https://github.com/w0ng/dotfiles w0ng]<br />
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi<br />
|-<br />
! [https://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [https://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/thiagowfx/dotfiles thiagowfx]<br />
| bash/zsh || i3 || vim/emacs || rxvt-unicode || || ncmpcpp || i3blocks || ||<br />
|-<br />
! [https://github.com/zendeavor zendeavor]<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
! [https://github.com/bstaletic bstaletic]<br />
| [https://github.com/bstaletic/dotfiles/blob/master/.zshrc zsh] || [https://github.com/bstaletic/dotfiles/blob/master/dwm/config.h dwm] || [https://github.com/bstaletic/dotfiles/blob/master/.vimrc vim] || terminator || screen || [https://github.com/bstaletic/blob/master/.ncmpcpp/config ncmpcpp] || [https://github.com/bstaletic/dotfiles/blob/master/.conkyrc conky] || ||<br />
|}<br />
<br />
== See also ==<br />
<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://wiki.haskell.org/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]{{dead link|2015|08|16}} - [http://techie.cat/all-contents-from-dotfiles-org/ Copy of contents]{{dead link|2015|08|16}}<br />
* [https://dotfiles.github.io/ dotfiles.github.io]</div>Drkhshhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=421326Dotfiles2016-02-19T07:56:59Z<p>Drkhsh: Added my programs</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{Related articles start}}<br />
{{Related|XDG Base Directory support}}<br />
{{Related articles end}}<br />
This article collects user repositories with custom configuration files, commonly known as ''dotfiles''.<br />
<br />
== Version control ==<br />
<br />
Managing dotfiles with version control software such as [[Git]] helps to keep track of changes, share with others, and synchronize dotfiles across various hosts.<br />
<br />
=== Using gitignore ===<br />
<br />
Keeping a [https://git-scm.com/blog/2010/04/11/environment.html git directory] inside the home folder allows to directly keep track of changes. It is recommended to selectively add file contents to the index with [http://git-scm.com/docs/git-add git add]. <br />
<br />
To prevent untracked files (appearing in commits and removed by [http://git-scm.com/docs/git-clean git clean]), first exclude all files with [http://git-scm.com/docs/gitignore gitignore]:<br />
<br />
{{hc|~/.git/info/exclude|<br />
*}}<br />
<br />
Then use {{ic|git add -f}}, for example:<br />
<br />
$ git add -f ~/.config/*<br />
<br />
And [http://git-scm.com/docs/git-commit commit] the changes:<br />
<br />
$ git commit -a<br />
<br />
=== Other tools ===<br />
<br />
* {{App|vcsh|Allows separating differents modules (e.g., Emacs config vs. zsh config) into individual repositories which can be maintained separately, as opposed to keeping all dotfiles in a single repository. Works with git only.|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}<br />
* {{App|yadm|Manages files across systems using a single Git repository. Provides a way to use alternate files on a specific OS or host. Supplies a method of encrypting confidential data so it can safely be stored in your repository.|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm}}}}<br />
* {{App|etckeeper|Intended to version-control system-wide configuration in /etc. Works by keeping track of permissions and modes which version-control software often ignores. Can use various SCM systems as a backend. Hooks can auto-commit changes to the repository before a system-upgrade; for pacman, these hooks currently have to be triggered manually.|http://joeyh.name/code/etckeeper/|{{Pkg|etckeeper}}}}<br />
* {{App|GNU Stow|Can be used to symlink dotfiles from a repository into the $HOME tree. See [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] for more information.|http://www.gnu.org/software/stow/|{{Pkg|stow}}}}<br />
<br />
=== Maintaining dotfiles across multiple machines ===<br />
<br />
{{Style|This and the section below need a rewrite}}<br />
<br />
One way of maintaining dotfiles across various machines across various hosts while still allowing for per-host customizations, is by maintaining a master-branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; as shared configuration is added to the master-branch, the per-machine branches are then rebased on top of the updated master.<br />
<br />
=== Confidential information ===<br />
<br />
Occasionally, software may keep plain-text passwords in configuration files, as opposed to hooking into a keyring. In these cases, git clean-filters may be handy to avoid accidentally commiting confidential information. E. g., the following .gitattributes file assigns a filter to the file “some-dotfile”:<br />
<br />
<pre><br />
# .gitattributes<br />
some-dotfile filter=remove-pass<br />
</pre><br />
<br />
Whenever the file “some-dotfile” is checked into git, git will invoke the filter “remove-pass” on the file before checking it in. The filter must be defined in .git/config, e. g.:<br />
<br />
<pre><br />
[filter "remove-pass"]<br />
clean = "sed -e 's/^password=.*/#password=TODO/'"<br />
</pre><br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://bitbucket.org/ambrevar/dotfiles Ambrevar]<br />
| zsh || awesome || emacs || rxvt-unicode || || cmus || htop/vicious || mutt ||<br />
|-<br />
! [https://github.com/bamos/dotfiles bamos]<br />
| zsh || i3/xmonad || vim/emacs || rxvt-unicode || tmux || mpv/cmus || conky/xmobar || mutt || ERC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]<br />
|-<br />
! [https://github.com/cinelli/dotfiles cinelli]<br />
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat<br />
|-<br />
! [https://github.com/drkh5h/dotfiles drkhsh]<br />
| zsh || dwm || vim || rxvt-unicode || screen || cmus || conky || mutt || weechat<br />
|-<br />
! [https://github.com/Earnestly/dotfiles Earnestly]<br />
| zsh || i3/orbment || vim/emacs || termite || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/ErikBjare/dotfiles ErikBjare]<br />
| zsh || xmonad/xfce4 || vim || terminator || tmux || || xfce4-panel || || weechat<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/insanum/dotfiles insanum]<br />
| bash || herbstluftwm || vim || evilvte || tmux || || dzen || mutt-kz ||<br />
|-<br />
! [https://github.com/izmntuk/archiso/tree/testing/configs/alter/airootfs/ izmntuk]<br />
| zsh || xfce4 || vim || rxvt-unicode/yaft || tmux || cmus || xfce4-panel || || irssi<br />
|-<br />
! [https://bitbucket.org/jasonwryan/shiv/src jasonwryan]<br />
| bash/zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irrsi<br />
|-<br />
! [https://github.com/jelly/Dotfiles jelly]<br />
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat<br />
|-<br />
! [https://github.com/meskarune/.dotfiles meskarune]<br />
| bash || herbstluftwm || vim || rxvt-unicode || screen || || conky || || weechat<br />
|-<br />
! [https://github.com/neersighted/dotfiles neersighted]<br />
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [https://github.com/vodik/dotfiles vodik]<br />
| zsh || xmonad || vim || termite-git || tmux || ncmpcpp || custom || mutt || weechat<br />
|-<br />
! [https://github.com/w0ng/dotfiles w0ng]<br />
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi<br />
|-<br />
! [https://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [https://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/thiagowfx/dotfiles thiagowfx]<br />
| bash/zsh || i3 || vim/emacs || rxvt-unicode || || ncmpcpp || i3blocks || ||<br />
|-<br />
! [https://github.com/zendeavor zendeavor]<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
! [https://github.com/bstaletic bstaletic]<br />
| [https://github.com/bstaletic/dotfiles/blob/master/.zshrc zsh] || [https://github.com/bstaletic/dotfiles/blob/master/dwm/config.h dwm] || [https://github.com/bstaletic/dotfiles/blob/master/.vimrc vim] || terminator || screen || [https://github.com/bstaletic/blob/master/.ncmpcpp/config ncmpcpp] || [https://github.com/bstaletic/dotfiles/blob/master/.conkyrc conky] || ||<br />
|}<br />
<br />
== See also ==<br />
<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://wiki.haskell.org/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]{{dead link|2015|08|16}} - [http://techie.cat/all-contents-from-dotfiles-org/ Copy of contents]{{dead link|2015|08|16}}<br />
* [https://dotfiles.github.io/ dotfiles.github.io]</div>Drkhshhttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=417127Dotfiles2016-01-25T14:46:56Z<p>Drkhsh: Added my repo</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{Related articles start}}<br />
{{Related|XDG Base Directory support}}<br />
{{Related articles end}}<br />
This article collects user repositories with custom configuration files, commonly known as ''dotfiles''.<br />
<br />
== Version control ==<br />
<br />
Managing dotfiles with version control software such as [[Git]] helps to keep track of changes, share with others, and synchronize dotfiles across various hosts.<br />
<br />
=== Using gitignore ===<br />
<br />
Keeping a [https://git-scm.com/blog/2010/04/11/environment.html git directory] inside the home folder allows to directly keep track of changes. It is recommended to selectively add file contents to the index with [http://git-scm.com/docs/git-add git add]. <br />
<br />
To prevent untracked files (appearing in commits and removed by [http://git-scm.com/docs/git-clean git clean]), first exclude all files with [http://git-scm.com/docs/gitignore gitignore]:<br />
<br />
{{hc|~/.git/info/exclude|<br />
*}}<br />
<br />
Then use {{ic|git add -f}}, for example:<br />
<br />
$ git add -f ~/.config/*<br />
<br />
And [http://git-scm.com/docs/git-commit commit] the changes:<br />
<br />
$ git commit -a<br />
<br />
=== Other tools ===<br />
<br />
* {{App|vcsh|Allows separating differents modules (e.g., Emacs config vs. zsh config) into individual repositories which can be maintained separately, as opposed to keeping all dotfiles in a single repository. Works with git only.|https://github.com/RichiH/vcsh|{{AUR|vcsh}}}}<br />
* {{App|yadm|Manages files across systems using a single Git repository. Provides a way to use alternate files on a specific OS or host. Supplies a method of encrypting confidential data so it can safely be stored in your repository.|https://github.com/TheLocehiliosan/yadm|{{AUR|yadm}}}}<br />
* {{App|etckeeper|Intended to version-control system-wide configuration in /etc. Works by keeping track of permissions and modes which version-control software often ignores. Can use various SCM systems as a backend. Hooks can auto-commit changes to the repository before a system-upgrade; for pacman, these hooks currently have to be triggered manually.|http://joeyh.name/code/etckeeper/|{{Pkg|etckeeper}}}}<br />
* {{App|GNU Stow|Can be used to symlink dotfiles from a repository into the $HOME tree. See [http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html] for more information.|http://www.gnu.org/software/stow/|{{Pkg|stow}}}}<br />
<br />
=== Maintaining dotfiles across multiple machines ===<br />
<br />
{{Style|This and the section below need a rewrite}}<br />
<br />
One way of maintaining dotfiles across various machines across various hosts while still allowing for per-host customizations, is by maintaining a master-branch for all shared configuration, while each individual machine has a machine-specific branch checked out. Host-specific configuration can be committed to the machine-specific branch; as shared configuration is added to the master-branch, the per-machine branches are then rebased on top of the updated master.<br />
<br />
=== Confidential information ===<br />
<br />
Occasionally, software may keep plain-text passwords in configuration files, as opposed to hooking into a keyring. In these cases, git clean-filters may be handy to avoid accidentally commiting confidential information. E. g., the following .gitattributes file assigns a filter to the file “some-dotfile”:<br />
<br />
<pre><br />
# .gitattributes<br />
some-dotfile filter=remove-pass<br />
</pre><br />
<br />
Whenever the file “some-dotfile” is checked into git, git will invoke the filter “remove-pass” on the file before checking it in. The filter must be defined in .git/config, e. g.:<br />
<br />
<pre><br />
[filter "remove-pass"]<br />
clean = "sed -e 's/^password=.*/#password=TODO/'"<br />
</pre><br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://bitbucket.org/ambrevar/dotfiles Ambrevar]<br />
| zsh || awesome || emacs || rxvt-unicode || || cmus || htop/vicious || mutt ||<br />
|-<br />
! [https://github.com/bamos/dotfiles bamos]<br />
| zsh || i3/xmonad || vim/emacs || rxvt-unicode || tmux || mpv/cmus || conky/xmobar || mutt || ERC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || screen || || dzen || [https://github.com/pbrisbin/mutt-config mutt] || [https://github.com/pbrisbin/irssi-config irssi]<br />
|-<br />
! [https://github.com/cinelli/dotfiles cinelli]<br />
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat<br />
|-<br />
! [https://github.com/drkh5h/dotfiles drkhsh]<br />
| zsh || dwm || vim || rxvt-unicode || || || conky || mutt || weechat<br />
|-<br />
! [https://github.com/Earnestly/dotfiles Earnestly]<br />
| zsh || i3/orbment || vim/emacs || termite || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/ErikBjare/dotfiles ErikBjare]<br />
| zsh || xmonad/xfce4 || vim || terminator || tmux || || xfce4-panel || || weechat<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://github.com/insanum/dotfiles insanum]<br />
| bash || herbstluftwm || vim || evilvte || tmux || || dzen || mutt-kz ||<br />
|-<br />
! [https://github.com/izmntuk/archiso/tree/testing/configs/alter/airootfs/ izmntuk]<br />
| zsh || xfce4 || vim || rxvt-unicode/yaft || tmux || cmus || xfce4-panel || || irssi<br />
|-<br />
! [https://bitbucket.org/jasonwryan/shiv/src jasonwryan]<br />
| bash/zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irrsi<br />
|-<br />
! [https://github.com/jelly/Dotfiles jelly]<br />
| zsh || i3 || vim || termite || tmux || ncmpcpp || || mutt-kz-git || weechat<br />
|-<br />
! [https://github.com/meskarune/.dotfiles meskarune]<br />
| bash || herbstluftwm || vim || rxvt-unicode || screen || || conky || || weechat<br />
|-<br />
! [https://github.com/neersighted/dotfiles neersighted]<br />
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [https://github.com/vodik/dotfiles vodik]<br />
| zsh || xmonad || vim || termite-git || tmux || ncmpcpp || custom || mutt || weechat<br />
|-<br />
! [https://github.com/w0ng/dotfiles w0ng]<br />
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi<br />
|-<br />
! [https://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [https://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/thiagowfx/dotfiles thiagowfx]<br />
| bash/zsh || i3 || vim/emacs || rxvt-unicode || || ncmpcpp || i3blocks || ||<br />
|-<br />
! [https://github.com/zendeavor zendeavor]<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
! [https://github.com/bstaletic bstaletic]<br />
| [https://github.com/bstaletic/dotfiles/blob/master/.zshrc zsh] || [https://github.com/bstaletic/dotfiles/blob/master/dwm/config.h dwm] || [https://github.com/bstaletic/dotfiles/blob/master/.vimrc vim] || terminator || screen || [https://github.com/bstaletic/blob/master/.ncmpcpp/config ncmpcpp] || [https://github.com/bstaletic/dotfiles/blob/master/.conkyrc conky] || ||<br />
|}<br />
<br />
== See also ==<br />
<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://wiki.haskell.org/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org]{{dead link|2015|08|16}} - [http://techie.cat/all-contents-from-dotfiles-org/ Copy of contents]{{dead link|2015|08|16}}<br />
* [https://dotfiles.github.io/ dotfiles.github.io]</div>Drkhsh