https://wiki.archlinux.org/api.php?action=feedcontributions&user=OmeGa&feedformat=atomArchWiki - User contributions [en]2024-03-29T00:46:31ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=VirtualBox&diff=304230VirtualBox2014-03-13T05:09:19Z<p>OmeGa: Fix spelling mistakes</p>
<hr />
<div>[[Category:Emulators]]<br />
[[Category:Virtualization]]<br />
[[cs:VirtualBox]]<br />
[[de:VirtualBox]]<br />
[[el:VirtualBox]]<br />
[[es:VirtualBox]]<br />
[[fr:VirtualBox]]<br />
[[hu:VirtualBox]]<br />
[[it:VirtualBox]]<br />
[[ja:VirtualBox]]<br />
[[pt:VirtualBox]]<br />
[[ru:VirtualBox]]<br />
[[zh-CN:VirtualBox]]<br />
{{Related articles start}}<br />
{{Related|PhpVirtualBox}}<br />
{{Related|VirtualBox Arch Linux Guest On Physical Drive}}<br />
{{Related|Installing Arch Linux from VirtualBox}}<br />
{{Related|Moving an existing install into (or out of) a virtual machine}}<br />
{{Related articles end}}<br />
<br />
[https://www.virtualbox.org VirtualBox] is a [[Wikipedia:Hypervisor|hypervisor]] used to run operating systems in a special environment, called a virtual machine, on top of the existing operating system. VirtualBox is in constant development and new features are implemented continuously. It comes with a [[Qt]] GUI interface, as well as headless and [[Wikipedia:SDL|SDL]] command-line tools for managing and running virtual machines.<br />
<br />
In order to integrate functions of the host system to the guests, including shared folders and clipboard, video acceleration and a seamless window integration mode, ''guest additions'' are provided for some guest operating systems.<br />
<br />
{{Wikipedia|VirtualBox}}<br />
<br />
== Installation steps for Arch Linux hosts ==<br />
<br />
In order to launch VirtualBox virtual machines on your Arch Linux box, follow these installation steps.<br />
<br />
=== Core packages ===<br />
<br />
First, from the [[official repositories]], install the {{Pkg|virtualbox}} package which contains the GPL-licensed VirtualBox suite with the SDL and headless command-line tools included. The {{Pkg|virtualbox}} package comes with {{Pkg|virtualbox-host-modules}} as a required dependency. <br />
<br />
You can install the {{Pkg|qt4}} optional dependency in order to use the graphical interface which is based on [[Qt]]. This is not required if you intend to use VirtualBox in command-line only. [[#Use the right front-end|See below to learn the differences]].<br />
<br />
=== VirtualBox kernel modules ===<br />
<br />
Next, in order for VirtualBox to virtualize your guest installation, you will need to add [[kernel modules]] to your host kernel.<br />
<br />
As you have to know, the binary compatibility of kernel modules depends on the API of the kernel against which they have been compiled. The problem with the Linux kernel is that these interfaces might not be the same from one kernel version to another. In order to avoid compatibility problems and subtle bugs, each time the Linux kernel is upgraded, it is advised to recompile the kernel modules against the Linux kernel version that has just been installed. This is what Arch Linux packagers actually do with the VirtualBox kernel modules packages: each time a new Arch Linux kernel is released, the Virtualbox modules are upgraded accordingly.<br />
<br />
Therefore, if you are using a kernel from the [[official repositories]] or a custom one (self-compiled or installed from the [[AUR]]), the kernel module package you will need to install will thus vary.<br />
<br />
==== Hosts running an official kernel ====<br />
<br />
* If you are using the {{Pkg|linux}} kernel, make sure the {{pkg|virtualbox-host-modules}} package is still installed. The latter has been installed when you installed the {{Pkg|virtualbox}} package.<br />
* If you are using the LTS version of the kernel ({{pkg|linux-lts}}), you need to install the {{pkg|virtualbox-host-modules-lts}} package. {{Pkg|virtualbox-host-modules}} can now be removed if you want.<br />
<br />
==== Hosts running a custom kernel ====<br />
<br />
If you use or intend to use a self-compiled kernel from sources, you have to know that VirtualBox does not require any virtualization modules (e.g. virtuo, kvm,...). The VirtualBox kernel modules provide all the necessary for VirtualBox to work properly. You can thus disable in your kernel ''.config'' file these virtualization modules if you do not use other hypervisors like Xen, KVM or QEMU.<br />
<br />
The {{ic|virtualbox-host-modules}} package works fine with custom kernels of the same version of the Arch Linux stock kernel such as {{AUR|linux-ck}}. However, if you are using a custom kernel which is not of the same version of the Arch Linux stock one, you will have to install the {{Pkg|virtualbox-host-dkms}} package instead. The latter comes bundled with the source of the VirtualBox kernel modules that will be compiled to generate these modules for your kernel.<br />
<br />
Since the {{ic|virtualbox-host-modules}} comes with the official Arch Linux kernel ({{Pkg|linux}}) as a dependency, if you want to remove this default kernel you do not use, you will have to install {{Pkg|virtualbox-host-dkms}} as well. Then, you will be able to remove {{Pkg|virtualbox-host-modules}} then {{Pkg|linux}} (if no other packages require it).<br />
<br />
As the {{Pkg|virtualbox-host-dkms}} package requires compilation, make sure you have the kernel headers corresponding to your custom kernel version to prevent this error from happening {{ic|Your kernel headers for kernel ''your custom kernel version'' cannot be found at /usr/lib/modules/''your custom kernel version''/build or /usr/lib/modules/''your custom kernel version''/source}}.<br />
* If you use a self-compiled kernel and have used {{ic|make modules_install}} to install its modules, folders {{ic|/usr/lib/modules/''your custom kernel version''/build}} and {{ic|(...)/source}} will be symlinked to your kernel sources. These will act as the kernel headers you need. If you have not removed these kernel sources yet, you have nothing to do.<br />
* If you use a custom kernel from [[AUR]], make sure the package {{Pkg|linux-headers}} is installed.<br />
<br />
Once {{Pkg|virtualbox-host-dkms}} is installed, simply generate the kernel modules for your custom kernel by running the following command structure:<br />
# dkms install vboxhost/''virtualbox-host-source version'' -k ''your custom kernel version''/''your architecture''<br />
<br />
{{Tip|Use this all-in-one command instead, if you do not want to adapt the above command:<br />
{{bc|<nowiki># dkms install vboxhost/$(pacman -Q virtualbox|awk {'print $2'}|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')</nowiki>}}<br />
}}<br />
<br />
To automatically recompile the VirtualBox kernel modules when their sources get upgraded (i.e. when the {{Pkg|virtualbox-host-dkms}} package gets upgraded) and avoid to type again the above {{ic|dkms install}} command manually afterwards, enable the {{ic|dkms}} service with:<br />
# systemctl enable dkms<br />
<br />
{{Note|If you do not have the {{ic|dkms}} service enabled while the {{Pkg|virtualbox-host-dkms}} package is being updated, the VirtualBox modules will not be updated and you will have to type in manually the {{ic|dkms install}} command described above to compile the latest version of the Virtualbox kernel modules. If you do not want to type in manually this command, if the {{ic|dkms}} service is automatically loaded at startup, you just need to reboot and your VirtualBox modules will be recompiled silently.}}<br />
<br />
If you want to keep that {{ic|dkms}} deamon disabled, you can use an [[mkinitcpio|initramfs hook]] that will automatically trigger the {{ic|dkms install}} command described above at boot time. This requires to reboot to recompile the VirtualBox modules.<br />
To enable this hook, install the {{AUR|vboxhost-hook}} package from the [[Arch User Repository|AUR]] and add {{ic|vboxhost}} to your HOOKS array in {{ic|/etc/mkinitcpio.conf}}. Again, make sure the right linux headers are available for the new kernel otherwise the compilation will fail.<br />
<br />
{{Tip|Like the {{ic|dkms}} command, the {{ic|vboxhost}} hook will tell you if anything goes wrong during the recompilation of the VirtualBox modules.}}<br />
<br />
=== Load the VirtualBox kernel modules ===<br />
<br />
Among the [[kernel modules]] VirtualBox uses, there is a mandatory module named {{ic|vboxdrv}}, which must be loaded before any virtual machines can run. It can be automatically loaded when Arch Linux starts up, or it can be loaded manually when necessary.<br />
<br />
To load the module manually:<br />
# modprobe vboxdrv<br />
<br />
{{Note|In order to avoid {{ic|no such file or directory}} errors when using ''modprobe'', you may need to update the kernel dependency modules database ''modprobe'' is using with {{ic|depmod -a}}.}}<br />
<br />
To load the VirtualBox module at boot time, refer to [[Kernel_modules#Loading]] and create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with the line:<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxdrv}}<br />
<br />
To ensure full functionality of bridged networking, ensure that the {{ic|vboxnetadp}}, {{ic|vboxnetflt}} and {{ic|vboxpci}} [[Kernel modules|kernel modules]] are loaded as well and that the {{pkg|net-tools}} package is installed.<br />
<br />
{{Note|If the VirtualBox kernel modules were loaded in the kernel while you updated the modules, you need to reload them manually to use the new updated version.}}<br />
<br />
=== Add usernames to the vboxusers group ===<br />
<br />
To use the USB ports of your host machine in your virtual machines, add to the {{ic|vboxusers}} [[group]] the usernames that will be authorized to use this feature. The new group does not automatically apply to existing sessions; the user has to log out and log in again, or start a new environment with the {{ic|newgrp}} command or with {{ic|sudo -u $USER -s}}. To add the current user to the {{ic|vboxusers}} group, type:<br />
# gpasswd -a $USER vboxusers<br />
<br />
=== Guest additions disc ===<br />
<br />
It is also recommended to install the {{Pkg|virtualbox-guest-iso}} package on the host running VirtualBox. This package will act as a disc image that can be used to install the guest additions onto guest systems other than Arch Linux.<br />
<br />
=== Use the right front-end ===<br />
<br />
Now, you are ready to use VirtualBox. Congratulations!<br />
<br />
Multiple front-ends are available to you which two are available by default:<br />
* If you want to use VirtualBox in command-line only (only launch and change settings of existing virtual machines), you can use the {{ic|VBoxSDL}} command. VBoxSDL does only provide a simple window that contains only the ''pure'' virtual machine, without menus or other controls.<br />
* If you want to use VirtualBox in command-line without any GUI running (e.g. on a server) to create, launch and configure virtual machines, use the {{ic|VBoxHeadless}} which produces no visible output on the host at all, but instead only delivers VRDP data.<br />
<br />
If you installed the {{Pkg|qt4}} optional dependency, you also have a nice looking GUI interface with menus which is usable with the mouse.<br />
<br />
Finally, you can use [[PhpVirtualBox]] to administrate your virtual machines via a web interface.<br />
<br />
Refer to the [https://www.virtualbox.org/manual VirtualBox manual] to learn how to create virtual machines.<br />
<br />
{{Warning|If you store the virtual disk images on a [[Btrfs]] file system, you should consider disabling [[Btrfs#Copy-On-Write_.28CoW.29|Copy-on-Write]] for the directory before creating any images.}}<br />
<br />
== Installation steps for Arch Linux guests ==<br />
<br />
Follow these installation steps to install VirtualBox additions on your fresh Arch Linux guest installation.<br />
<br />
=== Install the Guest Additions ===<br />
<br />
On other GNU/Linux distribution, the Guest Additions can be installed in two different ways:<br />
* either via the regular installation process described in the Virtualbox manual (on the host, clicking "Install Guest Additions" from the Virtualbox menu, then on the guest, mounting the cdrom manually in {{ic|/mnt}}, then execute {{ic|/mnt/VBoxLinuxAdditions.run}});<br />
* or via a simple package you can install from the [[official repositories]].<br />
<br />
On Arch Linux guests, the official process does not work, you will get {{ic|Unable to determine your Linux distribution}} as an error message. You have thus to use the second way and install {{Pkg|virtualbox-guest-utils}} which provides {{Pkg|virtualbox-guest-modules}} as a required dependency.<br />
<br />
=== VirtualBox guest kernel modules ===<br />
<br />
==== Guests running an official kernel ====<br />
<br />
* If you are using the {{Pkg|linux}} kernel, make sure the {{pkg|virtualbox-guest-modules}} package is still installed. The latter has been installed when you installed the {{Pkg|virtualbox-guest-utils}} package.<br />
* If you are using the LTS version of the kernel ({{pkg|linux-lts}}), you need to install the {{pkg|virtualbox-guest-modules-lts}} package. {{Pkg|virtualbox-guest-modules}} can now be removed if you want.<br />
<br />
==== Guests running a custom kernel ====<br />
<br />
As this installation step is quite similar to the Vitualbox kernel modules section for the host described above, please refer to [[#VirtualBox kernel modules|that section]] for more information and replace all {{Pkg|virtualbox-guest-modules}}, {{Pkg|virtualbox-host-dkms}} and {{AUR|vboxhost-hook}} by {{Pkg|virtualbox-guest-modules}}, {{Pkg|virtualbox-guest-dkms}} and {{AUR|vboxguest-hook}} respectively.<br />
<br />
=== Load the Virtualbox kernel modules ===<br />
<br />
To load the modules manually, type:<br />
# modprobe -a vboxguest vboxsf vboxvideo<br />
<br />
To load the VirtualBox module at boot time, refer to [[Kernel_modules#Loading]] and create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with these lines:<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxguest<br />
vboxsf<br />
vboxvideo}}<br />
<br />
=== Launch the VirtualBox guest services ===<br />
<br />
After the rather big installation step dealing with VirtualBox kernel modules, now you need to start the guest services. The guest services are actually just a binary executable called {{ic|VBoxClient}} which will interact with your X Window System. {{ic|VBoxClient}} manages the following features:<br />
* the shared clipboard and the drag and drop between the host and the guest;<br />
* the seamless window mode;<br />
* the fact that the guest display is automatically resized according to the size of the guest window;<br />
* and finally checking the VirtualBox host version.<br />
<br />
All these features can be enabled indepently and manually with their dedicated flags.<br />
$ VBoxClient --clipboard --draganddrop --seamless --display --checkhostversion<br />
<br />
But VirtualBox provides a currently undocumented feature, a Bash script {{ic|VBoxClient-all}} which enables all these features automatically and checks if a X11 server is really running before enabling some of them.<br />
$ VBoxClient-all<br />
<br />
To start that script automatically when system starts run the following command as root (or sudo):<br />
$ systemctl enable vboxservice<br />
<br />
If you don't want to use systemd: (If you are unsure, use the method above):<br />
* if you are using a [[desktop environment]], you just need enable a checkbox or add the {{ic|/usr/sbin/VBoxClient-all}} to the autostart section in your DE settings (the DE will typically set a flag to a ''.desktop'' file in {{ic|~/.config/autostart}} - [[Autostart#Desktop_Application_Autostart|see the Autostart section for more details]] -);<br />
* if you do not have any [[desktop environment]], add the following line to the top of {{ic|~/.xinitrc}} (copy the file from {{ic|/etc/skel/.xinitrc}} if it does not exist) above any {{ic|exec}} options:<br />
{{hc|~/.xinitrc|<br />
/usr/bin/VBoxClient-all}}<br />
<br />
Now, you should have a working ArchLinux guest. Congratulations!<br />
<br />
== Export VirtualBox virtual machines to other hypervisors ==<br />
<br />
If you plan to use your virtual machine, created with VirtualBox, on another computer which has not necessarily VirtualBox installed, you might be interested in following the next steps.<br />
<br />
=== Remove additions ===<br />
<br />
If you have installed the VirtualBox additions to your VirtualBox virtual machine, please uninstall them first. Your guest, especially if it is using an OS from the Windows family, might behave weirdly, crash or even might not boot at all if you are still using the specific VirtualBox drivers in another hypervisor.<br />
<br />
{{Tip|If you intend to use a virtualization solution from Parallels Inc for your Mac, the product ''Parallels Transporter'' can be used to create a virtual machine from a Windows or GNU/Linux virtual machine (or even from a native installation). With such a product, you do not need to apply follow the next step and can stop reading here.}}<br />
<br />
=== Use the right virtual disk format ===<br />
<br />
==== Supported formats by VirtualBox ====<br />
<br />
VirtualBox comes with its own container for the virtual hard drives: the Virtual Disk Image (VDI) file format. Even if this format is used by default when you create a virtual machine with VirtualBox, you can specify another one. Indeed VirtualBox does flawlessly support other formats:<br />
<br />
* VMDK: this format has been initially developed by VMware for their products, but it is now an open format. If you intend to use any VMware product, you will need to use this format since it is the only one supported by VMware.<br />
<br />
* VHD: this is the format used by Microsoft in Windows Virtual PC and Hyper-V. If you intend to use any of these Microsoft products, you will have to choose this format.<br />
:{{Tip|Since Windows 7, this format can be mounted directly without any additional application.}} <br />
<br />
* Version 2 of the HDD format used by Parallels (Desktop for Mac).<br />
<br />
* QED and QCOW used by QEMU.<br />
<br />
The format you will need to choose depends on the hypervisor that will be used.<br />
<br />
==== Specific virtual disk format differences ====<br />
<br />
Before converting your virtual drive, please keep in mind these specific virtual disk format differences:<br />
<br />
* The VMDK does offer the ability to be split into several files of up to 2GB. This feature is specially useful if you want to store the virtual machine on machines which do not support very large files. Other formats do not provide such an equivalent feature.<br />
<br />
* Changing the logical capacity of an existing virtual drive with VirtualBox {{ic|VBoxManage}} command is only supported for VDI and VHD formats used in dynamic allocation mode to expand (not shrink) their capacity.<br />
<br />
==== Convert your virtual disk format ====<br />
<br />
VirtualBox only supports the virtual disk conversion between VDI, VMDK and VHD formats. Here is an example of conversion from a VDI to VMDK vitual drive.<br />
<br />
$ VBoxManage clonehd ''ArchLinux_VM.vdi'' ''ArchLinux_VM.vmdk'' --format ''VMDK''<br />
<br />
If you want to replace the virtual disk you defined during the virtual machine creation process by the one you have just converted, use the {{ic|[http://www.virtualbox.org/manual/ch08.html#vboxmanage-storagectl VBoxManage storagectl] command}}, or the GUI, or [[#Replace_the_virtual_disk_manually_from_the_.vbox_file|modify the ''.vbox'' configuration file]].<br />
<br />
=== Create the VM configuration for your hypervisor ===<br />
<br />
If your hypervisor (like VMware) does not support import of VirtualBox configuration files (''.vbox''), you will have to create a new virtual machine and specify its hardware configuration as close as possible as your initial VirtualBox virtual machine.<br />
<br />
{{Note|Pay a close attention to the installation mode (BIOS or UEFI) used to install the guest operating system. While an option is available on VirtualBox to choose between these 2 modes, on VMware, you will have to add the following line to your ''.vmx'' file.<br />
<br />
{{hc|ArchLinux_vm.vmx|2=<br />
firmware = "efi"<br />
}}<br />
}}<br />
<br />
Finally, ask your hypervisor to use the existing virtual disk you have converted and launch the virtual machine.<br />
{{Tip|If you are using VMware products and do not want to run through the whole GUI to find the right location to add your new virtual drive device, you can replace the location of the current ''.vmdk'' file by editing your ''.vmx'' configuration file manually.}}<br />
<br />
== Advanced configuration ==<br />
<br />
=== Using USB webcam / microphone ===<br />
<br />
{{Note|You will need to have VirtualBox extension pack installed before following the steps below. See [[#Extension pack]] for details.}}<br />
<br />
# Make sure the virtual machine is not running and your webcam / microphone is not being used.<br />
# Bring up the main VirtualBox window and go to settings for Arch machine. Go to USB section.<br />
# Make sure "Enable USB Controller" is selected. Also make sure that "Enable USB 2.0 (EHCI) Controller" is selected too.<br />
# Click the "Add filter from device" button (the cable with the '+' icon).<br />
# Select your USB webcam/microphone device from the list.<br />
# Now click OK and start your VM.<br />
<br />
=== Using Arch under Virtualbox EFI mode ===<br />
<br />
My experience with this configuration was pretty terrible, but it does work.<br />
<br />
''UPD. Using efibootmgr has the same effect as using VirtualBox boot menu (see the note below): settings [https://www.virtualbox.org/ticket/11177 disappear] after VM shutdown.'' First, {{ic|efibootmgr}} does *not* work. It will appear to work, but all changes it makes appear to be overwritten on reboot. After performing a standard UEFI/GPT installation, reboot and you should get dumped to the EFI shell. Type exit and you will get a menu. Select the Boot Management Manager, Boot Options, Add Boot Option. Use the file browser to find the grub efi file and select it. Add a label if you want. Afterwards, select Change Boot Order from the menu, use arrow keys to select your Arch option, and {{ic|+}} to move it up to the top. GRUB should boot by default now.<br />
<br />
Other options are: 1) move your loader to {{ic|\EFI\boot\bootx64.efi}}, 2) create {{ic|\startup.nsh}} script, which executes desirable loader, like this:<br />
<br />
{{hc|\startup.nsh|<br />
HD16a0a1:\EFI\refind\refindx64.efi}}<br />
<br />
Here I'm using consistent mapping name (HD16a0a1). It is probably a good idea, because they do survive configuration changes.<br />
<br />
{{Note|Another useful way to get back to the EFI menu after autobooting is working is to press the {{ic|c}} key inside GRUB and type {{ic|exit}}. Obviously, this will only work with {{ic|grub-efi}}, not {{ic|grub-bios.}}<br />
<br />
Regenerating the {{ic|grub.cfg}} file may also be required to fix broken UUIDs. Check with the {{ic|lsblk -f}} command that they match.<br><br />
Yet another useful way to get to VirtualBox boot menu is pressing {{ic|F12}} right after starting virtual machine. It comes in handy when using rEFInd + EFISTUB, for example.}}<br />
<br />
=== Synchronize guest date with host ===<br />
<br />
To keep the date and time synchronized, make sure you have {{Pkg|virtualbox-guest-utils}} installed in your host (see [[#Install the Guest Additions|above]]). To enable the service for subsequent boots, run<br />
# systemctl enable vboxservice<br />
<br />
To start immediately, run<br />
# systemctl start vboxservice<br />
<br />
You also need run this daemon in order to use the auto-mounting feature of shared folders that are mentioned above.<br />
<br />
=== Enable shared folders ===<br />
<br />
Shared folders are managed via the VirtualBox program on the host. They may be added, auto-mounted and made read-only from there.<br />
<br />
If automounting is enabled, and the {{ic|vboxservice}} is enabled, creating a shared folder from the VirtualBox program on the host will mount that folder in {{ic|/media/sf_''SHAREDFOLDERNAME''}} on the guest. To have that folder created on the Arch Guest, after the Guest Additions have been installed, you need to add your username to the {{ic|vboxsf}} group.<br />
<br />
# groupadd vboxsf<br />
# gpasswd -a $USER vboxsf<br />
<br />
{{Note|For '''automounting''' to work, you have to enable the '''vboxservice''' service.}}<br />
<br />
If you want a shared folder (e.g {{ic|/media/sf_Dropbox}}) to be symlinked to another folder in your home directory for easy access, you can type on the guest:<br />
<br />
$ ln -s /media/sf_Dropbox/* ~/dropbox<br />
<br />
The {{ic|VBoxLinuxAdditions.run}} script provided in the Guest Additions iso does this for you, however, Arch does not recommend using it.<br />
<br />
==== Manually mounting ====<br />
<br />
Look at the following for more info: [http://virtuatopia.com/index.php/VirtualBox_Shared_Folders]<br />
<br />
Syntax:<br />
mount -t vboxsf <shared-folder-name> <mount-point-on-guest-system><br />
<br />
If you get an error like:<br />
/sbin/mount.vboxsf: mounting failed with the error: No such device<br />
<br />
Try:<br />
modprobe vboxsf<br />
<br />
For additional info, see [https://bbs.archlinux.org/viewtopic.php?id=70780 this post].<br />
<br />
<br />
To prevent startup problems when you're using [[systemd]], you should add {{ic|1=comment=systemd.automount}} to your {{ic|/etc/fstab}}. This way, they are mounted only when you access those mount points and not during startup. Otherwise your system might become unusable after a kernel upgrade (if you install your guest additions manually).<br />
<br />
desktop /media/desktop vboxsf uid=user,gid=group,rw,dmode=700,fmode=600,comment=systemd.automount 0 0<br />
<br />
Don't waste your time to test the {{ic|nofail}} option. {{ic|mount.vboxsf}} is not able to handle this (2012-08-20).<br />
<br />
desktop /media/desktop vboxsf uid=user,gid=group,rw,dmode=700,fmode=600,nofail 0 0<br />
<br />
=== Replace the virtual disk manually from the ''.vbox'' file ===<br />
<br />
If you think that editing a simple ''XML'' file is more convenient than playing with the GUI or with {{ic|VBoxManage}} and you want to replace (or add) a virtual disk to your virtual machine, simply replace in the ''.vbox'' configuration file corresponding to your virtual machine the GUID, the file location and the format to your needs:<br />
<br />
{{hc|ArchLinux_vm.vbox|2=<br />
<HardDisk uuid="''{670157e5-8bd4-4f7b-8b96-9ee412a712b5}''" location="''ArchLinux_vm.vdi''" format="''VDI''" type="Normal"/><br />
}}<br />
<br />
then in the {{ic|<AttachedDevice>}} sub-tag of {{ic|<StorageController>}}, replace the GUID by the new one.<br />
<br />
{{hc|ArchLinux_vm.vbox|2=<br />
<AttachedDevice type="HardDisk" port="0" device="0"><br />
<Image uuid="''{670157e5-8bd4-4f7b-8b96-9ee412a712b5}''"/><br />
</AttachedDevice><br />
}}<br />
<br />
{{Note|If you do not know the GUID of the drive you want to add, but you have just used {{ic|VBoxManage}} for the conversion, this command will output the GUID just after the conversion. Using a random GUID does not work, as each [http://www.virtualbox.org/manual/ch05.html#cloningvdis UUID is stored inside each disk images].}}<br />
<br />
=== Starting virtual machines with a service ===<br />
<br />
Find hereafter the implementation details of a systemd service that will be used to consider a virtual machine as a service.<br />
<br />
{{hc|/etc/systemd/system/vboxvmservice@.service|<nowiki><br />
[Unit]<br />
Description=VBox Virtual Machine %i Service<br />
Requires=systemd-modules-load.service<br />
After=systemd-modules-load.service<br />
<br />
[Service]<br />
User=</nowiki>{{ic|'''<user>'''}}<nowiki><br />
Group=vboxusers<br />
ExecStart=/usr/bin/VBoxHeadless -s %i<br />
ExecStop=/usr/bin/VBoxManage controlvm %i savestate<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{Note|Replace {{ic|'''<user>'''}} with a user that is a member of the {{ic|vboxusers}} group. Make sure the user chosen is the same user that will create/import virtual machines, otherwise the user will not see the VM appliances.}}<br />
<br />
To enable the service that will launch the virtual machine at next boot, use:<br />
# systemctl enable vboxvmservice@'''your virtual machine name'''<br />
<br />
To start the service that will launch directly the virtual machine, use:<br />
# systemctl start vboxvmservice@'''your virtual machine name'''<br />
<br />
VirtualBox 4.2 introduces [http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/ a new way] for UNIX-like systems to have virtual machines started automatically, other than using a systemd service.<br />
<br />
=== Extension pack ===<br />
<br />
VirtualBox requires an extension pack in order to provide support for RDP, as well as USB 2.0 and PXE booting for Intel network cards, etc., available at this webpage: [https://www.virtualbox.org/wiki/Downloads VirtualBox Downloads]. This PUEL licensed extension pack is free for personal use.<br />
<br />
To install the Extension pack you download and save it to your hard drive and then open the VirtualBox main program. Click on preferences and on the left side click Extensions. On the right side, click the add package icon and then open the folder that has the extension and click to install it.<br />
<br />
Additionally you can install the Extension Pack from the command line using VBoxManage.<br />
<br />
VBoxManage extpack install <tarball> |<br />
uninstall [--force] <name> |<br />
cleanup<br />
As an alternative, you could also use {{AUR|virtualbox-ext-oracle}} from the [[AUR]].<br />
<br />
=== Accessing a guest server ===<br />
<br />
To access [[Wikipedia:Apache_HTTP_Server|Apache server]] on a Virtual Machine from the host machine '''only''', simply execute the following lines on the host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/HostPort" 8888<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/GuestPort" 80<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/pcnet/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on.<br />
<br />
To use a port lower than 1024 on the host machine, changes need to be made to the firewall on that host machine. This can also be set up to work with SSH or any other services by changing "Apache" to the corresponding service and ports. <br />
<br />
{{note|{{ic|pcnet}} refers to the network card of the VM. If you use an Intel card in your VM settings, change {{ic|pcnet}} to {{ic|e1000}}.}}<br />
<br />
=== Sharing keyboard and mouse ===<br />
<br />
*To capture the keyboard and mouse, click the mouse inside the virtual machine display.<br />
*To uncapture, press right {{ic|Ctrl}}.<br />
<br />
To get seamless mouse integration between host and guest, install the [[#Guest Additions]] inside the guest.<br />
<br />
=== Sharing files ===<br />
<br />
In the settings of the virtual machine go to shared folders tab and add the folders you want to share.<br />
<br />
*NOTE: You need to install Guest Additions in order to use this feature.<br />
In a Linux host, ''Devices &rarr; Install Guest Additions''<br />
Yes (when asked to download the CD image)<br />
Mount (when asked to register and mount)<br />
<br />
In a Linux host, create one or more folders for sharing files, then set the shared folders via the virtualbox menu (guest window).<br />
<br />
In a Windows guest, starting with VirtualBox 1.5.0, shared folders are browseable and are therefore visible in Windows Explorer. Open Windows Explorer and look for it under ''My Networking Places &rarr; Entire Network &rarr; VirtualBox Shared Folders''.<br />
<br />
Launch the Windows Explorer (run explorer command) to browse the network places -> expand with the (+) sign : entire network &rarr; VirtualBox shared folders &rarr; '''\\Vboxsvr''' &rarr; then you can now expand all your configured shared folders here, and set up shortcuts for Linux folders in the guest filesystem. You can alternatively use the "Add network place wizard", and browse to "VBoxsvr".<br />
<br />
Alternatively, on the Windows command line, you can also use the following:<br />
net use x: \\VBOXSVR\sharename<br />
<br />
While {{ic|VBOXSVR}} is a fixed name, replace {{ic|x:}} with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.<br />
<br />
In a Windows guest, to improve loading and saving files (e.g. MS Office) by VirtualBox Shared Folders edit ''c:\windows\system32\drivers\etc\hosts'' as below:<br />
127.0.0.1 localhost vboxsvr<br />
<br />
In a Linux guest, use the following command:<br />
# mount -t vboxsf [-o OPTIONS] sharename mountpoint<br />
(Notes: sharename is optional or same as selected in the VirtualBox-Dialog , mountpoint of the shared directory in the hosts filesystem)<br />
:Automatically mounting a shared folder is possible through the linux-guest {{ic|/etc/fstab}} file. You may also specify the uid=#,gid=# (where # is replaced by the actual numerical uid and gid) to mount the share with normal user permissions instead of root permissions. (this can be helpful to mount parts of your host {{ic|~/home}} for use in your Linux-guest. To do this add an entry in the following format to the linux-guest {{ic|/etc/fstab}}:<br />
<br />
sharename mountpoint vboxsf uid=#,gid=# 0 0<br />
<br />
Replace {{ic|sharename}} with the share name specified with VBoxManage, and mountpoint with the path where you want the share to be mounted (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet. Note that if you have told VirtualBox to "automatically mount" the shared folder, this step may not be necessary and your folder will be found somewhere under {{ic|/media}}.<br />
<br />
Beyond the standard options supplied by the mount command, the following are available:<br />
iocharset=CHARSET<br />
to set the character set used for I/O operations (utf8 by default) and<br />
convertcp=CHARSET<br />
to specify the character set used for the shared folder name (utf8 by default).<br />
<br />
=== D3D acceleration in Windows guests ===<br />
<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. These libraries are now part of Virtualbox guest additions software. <br />
<br />
After enabling OpenGL acceleration as described above, reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install Virtualbox guest additions, during install enable checkbox "Direct3D support". Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This was tested on Windows XP, 7 and 8.1. If method does not work on your Windows version please add data here.}}<br />
<br />
=== Virtual hard disks ===<br />
<br />
==== Cloning a Disk Image and Reassigning a UUID ====<br />
<br />
Assigns a new UUID to the given image file. This way, multiple copies of a container can be registered.<br />
<br />
$ VBoxManage internalcommands sethduuid /path/to/disk.vdi<br />
<br />
==== Compacting Linux disks ====<br />
<br />
Boot the Linux guest VM and remove all bloat (unwanted packages, temp files, etc.). When satisfied, wipe the freespace using dd or preferably dcfldd:<br />
<br />
$ dcfldd if=/dev/zero of=fillfile bs=4M<br />
<br />
When the fillfile hits the limit of the virtual hdd, the vast majority of user-space (non-reserved blocks) will be filled. Alternatively, run the command as root to get all of them. Example message: "8192 blocks (8192Mb) written.dcfldd:: No space left on device."<br />
<br />
Once this occurs, simply remove the fill file and powerdown the VM:<br />
<br />
$ rm -f fillfile && sudo shutdown -hF now<br />
<br />
{{Note| The -F switch will force a disk check upon a reboot which is advised following the compact operation.}}<br />
<br />
Now compact the disk:<br />
<br />
$ VBoxManage modifyhd /path/to/your.vdi --compact<br />
<br />
==== Compacting Windows disks ====<br />
<br />
See [http://www.mdl4.com/2010/04/virtualbox-compact-a-vdi-in-ubuntu this article].<br />
<br />
==== Increasing Windows disk size ====<br />
<br />
{{Warning|This has only been tested with Windows XP and Windows 7 guests.}}<br />
<br />
If you find that you are running out of space due to the small hard drive size you selected when created your VM, you can take the following steps:<br />
<br />
Create a new vdi in ~/.VirtualBox/HardDisks by running:<br />
# cd ~/.VirtualBox/HardDisks<br />
# VBoxManage createhd -filename new.vdi --size 10000<br />
<br />
where size is in mb, in this example 10000MB ~= 10GB, and new.vdi is name of new hard drive to be created.<br />
<br />
Next the old vdi needs to be cloned to the new vdi, this may take some time so wait while it occurs:<br />
# VBoxManage clonehd old.vdi new.vdi --existing<br />
<br />
Detach old harddrive and attach new hard drive, replace VMName with whatever you called your VM:<br />
# VBoxManage modifyvm VMName --hda none<br />
# VBoxManage modifyvm VMName --hda new.vdi<br />
<br />
Boot the VM, run Partition Wizard 5 to resize the partition on the fly, and reboot.<br />
<br />
Remove old vdi from VirtualBox and delete<br />
# VBoxManage closemedium disk old.vdi<br />
# rm old.vdi<br />
<br />
==== Disk image format conversion ====<br />
<br />
The {{ic|qemu-img}} program can be used to convert images from one format to another or to add compression or encryption to an image. {{ic|qemu-img}} is provided by the {{Pkg|qemu}} package.<br />
<br />
===== QEMU to VDI =====<br />
<br />
From [[QEMU]] 0.12.x on, {{ic|qemu-img}} is able to convert directly to VDI and back, if necessary:<br />
$ qemu-img convert -O vdi test.qcow2 test.vdi<br />
<br />
===== VMware to VDI =====<br />
<br />
You can <br />
$ VBoxManage clonehd source.vmdk target.vdi --format VDI<br />
although recent versions of VirtualBox are able to use (and also create) .vmdk images directly.<br />
<br />
=== Starting virtual machines with a key binding ===<br />
<br />
It can be useful to start the virtual machines directly rather than start the Virtual Box console. To do this, simply assign a keybinding in .xbindkeysrc to <br />
"VBoxManage startvm '''''vm-name'''''"<br />
'''''keycode'''''<br />
'''''keyname'''''<br />
If you have a space in the vm name, then enclose the vm-name in single apostrophes. For eg.<br />
"VBoxManage startvm 'Windows 7'"<br />
m:0x0 + c:163<br />
XF86Mail<br />
<br />
=== Detecting web-cams and other USB devices ===<br />
Make sure you filter any devices that are not a keyboard or a mouse so they do not start up at boot and this insures that Windows will detect the device at start-up.<br />
<br />
=== Sending CTRL+ALT+F1 ===<br />
If your guest operating system is a GNU/Linux distribution and you want to open a new TTY shell or exit X via typing {{ic|Ctrl}}+{{ic|Alt}}+{{ic|F1}}, you can easily send this command to the guest simply by hitting your ''Host Key'' (usually the right {{ic|Ctrl}} key + {{ic|F1}} or {{ic|F2}}, according to what you need to do.<br />
<br />
=== VirtualBox on a USB key ===<br />
When using VirtualBox on a USB key, for example to start an installed machine with an ISO image, you will manually have to create VDMKs from the existing drives. However, once the new VMDKs are saved and you move on to another machine, you may experience problems launching an appropriate machine again. To get rid of this issue, you can use the following script to launch VirtualBox. This script will clean up and unregister old VMDK files and it will create new, proper VMDKs for you:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
# Erase old VMDK entries<br />
rm ~/.VirtualBox/*.vmdk<br />
<br />
# Clean up VBox-Registry<br />
sed -i '/sd/d' ~/.VirtualBox/VirtualBox.xml<br />
<br />
# Remove old harddisks from existing machines<br />
find ~/.VirtualBox/Machines -name \*.xml | while read file; do<br />
line=`grep -e "type\=\"HardDisk\"" -n $file | cut -d ':' -f 1`<br />
if [ -n "$line" ]; then<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
fi<br />
sed -i "/rg/d" $file<br />
done<br />
<br />
# Delete prev-files created by VirtualBox<br />
find ~/.VirtualBox/Machines -name \*-prev -exec rm '{}' \;<br />
<br />
# Recreate VMDKs<br />
ls -l /dev/disk/by-uuid | cut -d ' ' -f 9,11 | while read ln; do<br />
if [ -n "$ln" ]; then<br />
uuid=`echo "$ln" | cut -d ' ' -f 1`<br />
device=`echo "$ln" | cut -d ' ' -f 2 | cut -d '/' -f 3 | cut -b 1-3`<br />
<br />
# determine whether drive is mounted already<br />
checkstr1=`mount | grep $uuid`<br />
checkstr2=`mount | grep $device`<br />
checkstr3=`ls ~/.VirtualBox/*.vmdk | grep $device`<br />
if [[ -z "$checkstr1" && -z "$checkstr2" && -z "$checkstr3" ]]; then<br />
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/$device.vmdk -rawdisk /dev/$device -register<br />
fi<br />
fi<br />
done<br />
<br />
# Start VirtualBox<br />
VirtualBox<br />
</nowiki>}}<br />
Note that your user has to be added to the "disk" group to create VMDKs out of existing drives.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Windows XP guest and old Nokia phones not working ===<br />
<br />
To get working Windows XP and Nokia phones with PC Suite mode, VirtualBox needs two simple steps:<br />
<br />
'''1.''' Add a rule to [[udev]] with {{ic|/etc/udev/rules.d/40-permissions.rules}}:<br />
LABEL="usb_serial_start"<br />
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \<br />
GROUP="usbfs", MODE="0660", GROUP="dialout"<br />
LABEL="usb_serial_end"<br />
<br />
'''2.''' Create the group {{ic|usbfs}} and add its user to it<br />
# groupadd usbfs<br />
# usermod -a -G usbfs $USER<br />
<br />
After logging out, connect a Nokia phone with PC Suite mode and start Windows XP to test the new rule.<br />
<br />
=== Fix ISO images problems ===<br />
While VirtualBox can mount ISO images without problem, there are some image formats which cannot reliably be converted to ISO. For instance, ccd2iso ignores .ccd and .sub files, which can give disk images with broken files. <br />
<br />
In this case, you will either have to use [[CDEmu]] for Linux inside VirtualBox or any other utility used to mount disk images.<br />
<br />
=== GUI does not match GTK Theme ===<br />
<br />
See [[Uniform Look for Qt and GTK Applications]] for information about theming Qt based applications like Virtualbox or [[Skype]].<br />
<br />
=== OpenBSD ===<br />
<br />
Some people with older computers can have trouble running an OpenBSD VM, manifesting as bunch of segmentation faults and total unusability. Starting VirtualBox with the -norawr0 argument may solve the problem. You can do it like this:<br />
$ VBoxSDL -norawr0 -vm NameOfYourOpenBSDVM<br />
<br />
=== VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) ===<br />
<br />
This can occur if a VM is exited ungracefully. The solution to unlock the VM is trivial:<br />
$ VBoxManage controlvm <your virtual machine name> poweroff<br />
<br />
=== USB subsystem is not working on the host or guest ===<br />
<br />
Sometimes, on old Linux hosts, the USB subsystem is not auto-detected resulting in an error {{ic|Could not load the Host USB Proxy service: VERR_NOT_FOUND}} or in a not visible USB drive on the host, [https://bbs.archlinux.org/viewtopic.php?id=121377 even when the user is in the '''vboxusers''' group]. This problem is due to the fact that VirtualBox switched from ''usbfs'' to ''sysfs'' in version 3.0.8. If the host doesn't understand this change, you can revert to the old behaviour by defining the following environment variable in any file that is sourced by your shell (e.g. your {{ic|~/.bashrc}} if you're using ''bash''):<br />
<br />
{{hc|~/.bashrc|VBOX_USB<nowiki>=</nowiki>usbfs}}<br />
<br />
Then make sure, the environment has been made aware of this change (reconnect, source the file manually, launch a new shell instance or reboot).<br />
<br />
Also make sure that your user is a member of the {{ic|storage}} group.<br />
<br />
=== Failed to create the host-only network interface ===<br />
<br />
To be able to create a ''Host-Only Network Adapter'' or a ''Bridged Network Adapter'', the kernel modules {{ic|vboxnetadp}} and {{ic|vboxnetflt}} need to be loaded, you also need to make sure the {{pkg|net-tools}} package is installed. You can load these kernel modules manually with:<br />
# modprobe -a vboxdrv vboxnetadp vboxnetflt<br />
<br />
To load these modules automatically at boot, refer to [[Kernel_modules#Loading]] and use a program name of {{ic|virtualbox}}.<br />
<br />
=== WinXP: Bit-depth cannot be greater than 16 ===<br />
<br />
If you are running at 16-bit color depth, then the icons may appear fuzzy/choppy. However, upon attempting to change the color depth to a higher level, the system may restrict you to a lower resolution or simply not enable you to change the depth at all. To fix this, run {{ic|regedit}} in Windows and add the following key to the Windows XP VM's registry:<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]<br />
"ColorDepth"=dword:00000004<br />
<br />
Then update the color depth in the "desktop properties" window. If nothing happens, force the screen to redraw through some method (i.e. {{ic|Host+f}} to redraw/enter full screen).<br />
<br />
=== Mounting .vdi images ===<br />
<br />
Mounting vdi images only works with fixed size (''static'') images; ''dynamic size'' images aren't easily mountable.<br />
<br />
First we need one information from your .vdi image:<br />
<br />
$ VBoxManage internalcommands dumphdinfo <your .vdi file location> | grep offData<br />
Header: offBlocks=4096 offData=69632<br />
<br />
Then, add to your {{ic|offData}} 32256. (e.g. 32256 + 69632 = 101888)<br />
<br />
Now you can mount your vdi image with the following command:<br />
<br />
# mount -t ext4 -o rw,noatime,noexec,loop,offset=101888 <your .vdi file location> /mnt/<br />
<br />
You can also use [https://github.com/pld-linux/VirtualBox/blob/master/mount.vdi mount.vdi] script that, which you can use as (install script itself to /sbin):<br />
<br />
# mount -t vdi -o fstype=ext4,rw,noatime,noexec <your .vdi file location> /mnt/<br />
<br />
<br />
=== Use serial port in guest OS ===<br />
<br />
Check you permission for the serial port:<br />
$ /bin/ls -l /dev/ttyS*<br />
crw-rw---- 1 root uucp 4, 64 Feb 3 09:12 /dev/ttyS0<br />
crw-rw---- 1 root uucp 4, 65 Feb 3 09:12 /dev/ttyS1<br />
crw-rw---- 1 root uucp 4, 66 Feb 3 09:12 /dev/ttyS2<br />
crw-rw---- 1 root uucp 4, 67 Feb 3 09:12 /dev/ttyS3<br />
<br />
Add your user to the {{ic|uucp}} group.<br />
# gpasswd -a $USER uucp <br />
and log out and log in again.<br />
<br />
=== Windows 8.x Error Code 0x000000C4===<br />
<br />
If you get this error code while booting, even if you choose OS Type Win 8, try to enable the {{ic|CMPXCHG16B}} CPU instruction:<br />
<br />
$ vboxmanage setextradata <your virtual machine name> VBoxInternal/CPUM/CMPXCHG16B 1<br />
<br />
=== Windows 8 VM fails to boot with error "ERR_DISK_FULL" ===<br />
<br />
Situation: Your Windows 8 VM refuses to start. VirtualBox throws an error stating the virtual disk is full. However, you are certain that the disk is not full. <br />
Bring up your VM's settings at ''Settings > Storage > Controller:SATA'' and select "Use Host I/O Cache".<br />
<br />
== External links ==<br />
<br />
* [https://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>OmeGahttps://wiki.archlinux.org/index.php?title=EncFS&diff=301066EncFS2014-02-24T06:41:28Z<p>OmeGa: </p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
{{Related articles start}}<br />
{{Related|Disk Encryption}}<br />
{{Related articles end}}<br />
'''EncFS''' is a userspace stackable cryptographic file-system similar to [[eCryptfs]], and aims to secure data with the minimum hassle. It uses [[FUSE]] to mount an encrypted directory onto another directory specified by the user. It does not use a loopback system like some other comparable systems such as [[TrueCrypt]] and [[dm-crypt]].<br />
<br />
EncFS is definitely the simplest software if you want to try disk encryption on Linux.<br />
<br />
This has a number of advantages and disadvantages compared to these systems. Firstly, it does not require any root privileges to implement; any user can create a repository of encrypted files. Secondly, one does not need to create a single file and create a file-system within that; it works on existing file-system without modifications.<br />
<br />
This does create a few disadvantages, though; because the encrypted files are not stored in their own file, someone who obtains access to the system can still see the underlying directory structure, the number of files, their sizes and when they were modified. They cannot see the contents, however.<br />
<br />
This particular method of securing data is obviously not perfect, but there are situations in which it is useful.<br />
<br />
For more details on how EncFS compares to other disk encryption solution, see [[Disk Encryption#Comparison table]].<br />
<br />
== Comparison to eCryptFS ==<br />
<br />
[[System_Encryption_with_eCryptfs|eCryptFS]] is implemented in kernelspace and therefore little bit harder to configure. You have to remember various encryption options (used cyphers, key type, etc...), in EncFS this is not the case, because EncFS is storing that information in its signature so you do not have to remember anything (except the passphrase). The authors of eCryptFS claim it is faster because there is no overhead caused by context switching (between kernel and userspace).<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|encfs}} package.<br />
<br />
== Usage ==<br />
<br />
To create a secured repository, type:<br />
$ encfs ~/.''name'' ~/''name''<br />
Note that absolute paths must be used. This will be followed by a prompt about whether you want to go with the default (paranoid options) or expert configuration. The latter allows specifying algorithms and other options. The former is a fairly secure default setup. After entering a key for the encryption, the encoded file-system will be created and mounted. The encoded files are stored, in this example, at {{ic|~/.''name''}}, and their unencrypted versions in {{ic|~/''name''}}.<br />
<br />
To unmount the file-system, type:<br />
$ fusermount -u ~/''name''<br />
<br />
To remount the file-system, issue the first command, and enter the key used to encode it. Once this has been entered, the file-system will be mounted again.<br />
<br />
== User friendly mounting ==<br />
<br />
=== Mount using Gnome Encfs Manager ===<br />
<br />
The Gnome Encfs Manager is an easy to use manager and mounter for encfs stashes featuring per-stash configuration, Gnome Keyring support, a tray menu inspired by Cryptkeeper but using the AppIndicator API and lots of unique features.<br />
<br />
The author has created a repo which is more up to date than the AUR package.<br />
Add it to /etc/pacman.conf<br />
<br />
[home_moritzmolch_gencfsm_Arch_Extra]<br />
SigLevel = Never<br />
Server = http://download.opensuse.org/repositories/home:/moritzmolch:/gencfsm/Arch_Extra/$arch<br />
<br />
sudo pacman -Sy gnome-encfs-manager<br />
<br />
=== Mount using gnome-encfs ===<br />
<br />
gnome-encfs integrates EncFS folders into the GNOME desktop by storing their passwords in the keyring and optionally mounting them at login using GNOME's autostart mechanism. See https://bitbucket.org/obensonne/gnome-encfs/.<br />
This method has the advantage that mounting and can automated and the password does not have to be the same as your user password.<br />
<br />
=== Mount using CryptKeeper trayicon ===<br />
<br />
Quite simple app, just install {{AUR|cryptkeeper}} from AUR and add it to your X session.<br />
<br />
=== Mount at login using pam_encfs ===<br />
<br />
Install {{AUR|pam_encfs}}. See also:<br />
* http://pam-encfs.googlecode.com/svn/trunk/README<br />
* http://pam-encfs.googlecode.com/svn/trunk/pam_encfs.conf<br />
* https://wiki.edubuntu.org/EncryptedHomeFolder<br />
* http://code.google.com/p/pam-encfs/<br />
<br />
==== Single password ====<br />
<br />
{{Warning|Note that if you will use same password (eg.: using try_first_pass or use_first_pass) for login and encfs (so encfs will mount during your login) then you should use [[SHA password hashes]] (Preferably SHA512 with some huge numer of rounds) and (which is most important) '''secure password''', because hash of your password is probably stored in unencrypted form in {{ic|/etc/shadow}} and it can be cracked in order to get your encfs password (because it's same as your regular unix login password).}}<br />
<br />
==== /etc/pam.d/ ====<br />
<br />
Note that when you are using ''try_first_pass'' parameter to ''pam_unix.so'' then you will have to set EncFS to use same password as you are using to login (or vice-versa) and you will be entering just single password. Without this parameter you will need to enter two passwords.<br />
<br />
===== login =====<br />
<br />
This section tells how to make encfs automount when you're logging in by virtual terminal.<br />
{{Note|If you only want to use it through GDM, you may pass this and go right to the [[EncFS#gdm|GDM section]] below.}}<br />
{{bc|<nowiki><br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
auth sufficient pam_encfs.so<br />
auth required pam_unix.so nullok try_first_pass<br />
#auth required pam_unix.so nullok<br />
auth required pam_tally.so onerr=succeed file=/var/log/faillog<br />
# use this to lockout accounts for 10 minutes after 3 failed attempts<br />
#auth required pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog<br />
account required pam_access.so<br />
account required pam_time.so<br />
account required pam_unix.so<br />
#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3<br />
#password required pam_unix.so md5 shadow use_authtok<br />
session required pam_unix.so<br />
session required pam_env.so<br />
session required pam_motd.so<br />
session required pam_limits.so<br />
session optional pam_mail.so dir=/var/spool/mail standard<br />
session optional pam_lastlog.so<br />
session optional pam_loginuid.so<br />
-session optional pam_ck_connector.so nox11<br />
#Automatic unmount (optional):<br />
#session required pam_encfs.so<br />
</nowiki>}}<br />
{{Warning|Note that automatic unmout will process even when there is another session. eg.: logout on VC can unmout encfs mounted by GDM session that is still active.}}<br />
<br />
===== gdm =====<br />
<br />
This section explains how to make encfs automount when you're logging in by GDM.<br />
{{Note|For debug purposes you may try automount on virtual console login first. [[EncFS#login|This article has a section about automount on virtual console login]].}}<br />
<br />
Edit the file {{ic|/etc/pam.d/gdm-password}}.<br />
<br />
Insert (do not overwrite) the following into the bottom of gdm-password:<br />
<br />
{{bc|<nowiki><br />
#%PAM-1.0<br />
auth requisite pam_nologin.so<br />
auth required pam_env.so<br />
auth sufficient pam_encfs.so<br />
auth required pam_unix.so try_first_pass<br />
auth optional pam_gnome_keyring.so<br />
account required pam_unix.so<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
session optional pam_gnome_keyring.so auto_start<br />
password required pam_unix.so<br />
session required pam_encfs.so<br />
</nowiki>}}<br />
<br />
Save and exit.<br />
<br />
===== Configuration =====<br />
<br />
Edit {{ic|/etc/security/pam_encfs.conf}} :<br />
<br />
Recommended: comment out the line<br />
<br />
encfs_default --idle=1<br />
<br />
This flag will unmount your encrypted folder after 1 minute of inactivity. If you are automounting this on login, you probably would like to keep this mounted for as long as you are logged in.<br />
<br />
At the bottom, comment any existing demo entries and add:<br />
{{bc|<br />
#USERNAME SOURCE TARGET PATH ENCFS Options FUSE Options<br />
foo /home/foo/EncryptedFolder /home/foo/DecryptedFolder -v allow_other<br />
}}<br />
<br />
Next, edit {{ic|/etc/fuse.conf}}:<br />
Uncomment:<br />
user_allow_other<br />
<br />
To test your config, open a new virtual terminal (e.g. {{ic|Ctrl+Alt+F4}}) and login. You should see pam successfuly mount your EncFS folder.<br />
<br />
=== Mount when USB drive with EncFS folders is inserted using fsniper ===<br />
<br />
Simple method to automount (asking for password) encfs when USB drive with EncFS one or more folders in root is inserted. We will use {{AUR|fsniper}} (filesystem watching daemon using inotify) and {{Pkg|git}} (for askpass binary).<br />
<br />
See more at https://github.com/Harvie/Programs/tree/master/bash/encfs/automount (latest version of files used in the [[#How to|How to]]).<br />
<br />
==== How to ====<br />
<br />
'''1.''' You need USB automount working for this - like thunar or nautilus does.<br \><br />
'''2.''' Make encrypted folder on your drive, eg.: {{ic|encfs /media/USB/somename /media/USB/somename.plain}} (and then unmount everything).<br \><br />
'''3.''' Create a {{ic|~/.config/fsniper/config}} file:<br />
{{bc|<nowiki><br />
watch {<br />
/etc/ {<br />
mtab {<br />
# %% is replaced with the filename of the new file<br />
handler = encfs-automount.sh %%;<br />
}<br />
}<br />
}<br />
</nowiki>}}<br />
'''4.''' install helper script:<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
# ~/.config/fsniper/scripts/encfs-automount.sh<br />
# Quick & dirty script for automounting EncFS USB drives<br />
# TODO:<br />
# - Unmounting!!!<br />
#<br />
ASKPASS="/usr/lib/git-core/git-gui--askpass"<br />
<br />
lock=/tmp/fsniper_encfs.lock<br />
lpid=$(cat "$lock" 2>/dev/null) &&<br />
ps "$lpid" | grep "$lpid" >/dev/null && {<br />
echo "Another instance of fsniper_encfs is running"<br />
exit;<br />
}<br />
echo $BASHPID > "$lock";<br />
sleep 2;<br />
<br />
echo<br />
echo ==== EncFS automount script for fsniper ====<br />
<br />
list_mounts() {<br />
cat /proc/mounts | cut -d ' ' -f 2<br />
}<br />
<br />
list_mounts | while read mount; do<br />
config="$mount"'/*/.encfs*';<br />
echo Looking for "$config"<br />
config="$(echo $config)"<br />
[ -r "$config" ] && {<br />
cyphertext="$(dirname "$config")";<br />
plaintext="$cyphertext".plain<br />
echo Found config: "$config";<br />
echo Trying to mount: "$cyphertext to $plaintext";<br />
list_mounts | grep "$plaintext" >/dev/null && {<br />
echo Already mounted: "$plaintext"<br />
} || {<br />
echo Will mount "$cyphertext to $plaintext"<br />
"$ASKPASS" "EncFS $cyphertext to $plaintext" | encfs --stdinpass "$cyphertext" "$plaintext"<br />
}<br />
}<br />
done<br />
echo<br />
<br />
rm "$lock" 2>/dev/null<br />
</nowiki>}}<br />
'''5.''' Make sure that /usr/lib/git-core/git-gui--askpass is working for you (that's why you need git package - but you can adjust the helper script).<br \><br />
'''6.''' Try {{ic|fsniper --log-to-stdout}} in terminal (askpass should appear when USB drive is inserted).<br \><br />
'''7.''' Add {{ic|fsniper --daemon}} to your session.<br \><br />
'''8.''' Do not forget to unmount encfs before removing drive.<br />
<br />
== See Also ==<br />
<br />
* [https://defuse.ca/audits/encfs.htm Security audit] of EncFS by Taylor Hornby (January 14, 2014).</div>OmeGahttps://wiki.archlinux.org/index.php?title=ECryptfs&diff=301065ECryptfs2014-02-24T06:40:25Z<p>OmeGa: Add link to a security audit of eCryptfs</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Security]]<br />
[[Category:File systems]]<br />
[[fr:Encryption avec eCryptfs]]<br />
[[it:System Encryption with eCryptfs]]<br />
[[ru:System Encryption with eCryptfs]]<br />
{{Related articles start}}<br />
{{Related|Disk Encryption}}<br />
{{Related articles end}}<br />
This article describes basic usage of [https://launchpad.net/ecryptfs eCryptfs]. It guides you through the process of creating a private and secure encrypted directory within your ''$HOME'' directory, where you can store all your sensitive files and private data.<br />
<br />
In implementation eCryptfs differs from dm-crypt, which provides a ''block device encryption layer'', while eCryptfs is an actual file-system &ndash; a [http://en.wikipedia.org/wiki/Cryptographic_filesystems stacked cryptographic file system] to be exact. For comparison of the two you can refer to [http://ecryptfs.sourceforge.net/ecryptfs-faq.html#compare this table ]. <br />
<br />
The summary is that it doesn't require special on-disk storage allocation effort, such as separate partitions, you can mount eCryptfs on top of any single directory to protect it. That includes e.g. your entire $HOME and network file systems (i.e. having encrypted NFS shares). All cryptographic metadata is stored in the headers of files, so encrypted data can be easily moved, stored for backup and recovered. There are other advantages, but there are also drawbacks, for instance eCryptfs is not suitable for encrypting complete partitions which also means you can't protect your swap space with it (instead you can combine it with dm-crypt).<br />
<br />
For more details on how eCryptfs compares to other disk encryption solutions, see [[Disk Encryption#Comparison table]]. <br />
<br />
== Basics ==<br />
<br />
See [[Disk_Encryption#Available_methods]] for a general introduction to stacked filesystem encryption, and how it compares to block device encryption.<br />
<br />
{{Expansion|<br> - Explain the basic mechanisms & terminology at the heart of eCryptfs ("mounting", "FEKEK", "wrapped passphrase", etc.) in simple terms|section=Major_restructuring/rewrite}}<br />
<br />
== Preparation ==<br />
<br />
Before starting to set up disk encryption, there are a few things to consider and to prepare in advance: [[Disk_Encryption#Preparation]]<br />
<br />
{{Expansion|<br> - discuss the 2 real-life set-ups for which eCryptfs is especially well suited: <u>encrypted data directory</u> and <u>encrypted home directory</u><br><br />
- discuss swap, and point to [[dm-crypt/Swap_Encryption]] for instructions [and make sure that article is written in a self-contained way that does not assume readers arrived from other dm-crypt articles!]|section=Major_restructuring/rewrite}}<br />
<br />
=== Deficiencies ===<br />
<br />
{{Accuracy|check if the warning about sparse files is still applicable}}<br />
<br />
eCryptfs does not handle [https://en.wikipedia.org/wiki/Sparse_file sparse files] well; this should be considered before encrypting large portions of the directory structure ($HOME, for example). For most intents and purposes this deficiency does not pose a problem. Using eCryptfs to encrypt sparse files, however, currently encrypts the entire allocated space of the sparse file, which, in the case of big files, can starve the system of resources. (This bug may be tracked [https://bugs.launchpad.net/ubuntu/+source/ecryptfs-utils/+bug/431975 on Launchpad]). One popular and inadvisable application of eCryptfs is to encrypt a BitTorrent download location; this often requires eCryptfs to handle sparse files of 10 GB or more and may lead to intense disk starvation. A simple workaround is to place sparse files in an unencrypted '''.Public''' directory (as opposed to the standard eCryptfs '''.Private''' directory, explained below).<br />
<br />
=== Login password ===<br />
<br />
{{Deletion|Already covered in [[Disk_Encryption#Preparation]], which is linked to above.}}<br />
<br />
{{note|1= With {{pkg|shadow}} 4.1.4.3-3 ''sha512'' is the default for new passwords (see [https://bugs.archlinux.org/task/13591#comment85993 bug 13591] and corresponding [https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/shadow&id=98001501a8306ef5a0df55d1cffc048851894940 commit]).}}<br />
<br />
If you are encrypting your whole home, with auto-mounting you should use a strong password and consider changing the hash algorithm for ''/etc/shadow'' from '''md5''' to stronger ones like '''sha512/bcrypt''' that helps to protect your password against rainbow-table attacks. See https://wiki.archlinux.org/index.php/SHA_password_hashes for more information.<br />
<br />
== Setup & Mounting ==<br />
<br />
eCryptfs is a part of Linux since version 2.6.19. But to work with it you will need the userspace tools provided by the package {{pkg|ecryptfs-utils}} available in the [[Official Repositories]].<br />
<br />
Once you have installed that package you can load the ecryptfs module and continue with the setup:<br />
# modprobe ecryptfs<br />
<br />
Before we say anything else it's advised that you check the eCryptfs documentation. It is distributed with a very good and complete set of manual pages.<br />
<br />
=== Using the Ubuntu tools ===<br />
<br />
Most of the user-friendly convenience tools installed by the ''ecryptfs-utils'' package assume a very specific eCryptfs setup, namely the one that is officially used by Ubuntu (where it can be selected as an option during distro installation). Unfortunately, these choices are not just default options but are actually hard-coded in the tools, so if this set-up does not suit your needs then you can't use the convenience tools and will have to follow the steps at [[#Manual_setup]] instead.<br />
<br />
The set-up used by these tools is as follows:<br />
{| style="border:solid 1px grey; margin-left:2em; margin-right:2em; margin-bottom:0.8em;"<br />
|<br />
* each user can have '''only one encrypted directory''' that is managed by these tools:<br />
** either full $HOME dir encryption...<br />
** or a single encrypted data directory ''(by default {{ic|~/Private/}}, but this can be customized)''.<br />
* the '''lower directory''' for each user is always {{ic|~/.Private/}}<br><small>''(in the case of full home dir encryption, this will be a symlink to the actual location at {{ic|/home/.ecryptfs/$USER/.Private/}})''</small><br />
* the '''encryption options''' used are:<br />
** ''cipher:'' AES<br />
** ''key length:'' 16 bytes (128 bits)<br />
** ''key management scheme:'' passphrase<br />
** ''plaintext passthrough:'' enabled<br />
* the '''configuration / control info''' for the encrypted directory is stored in a bunch of files at {{ic|~/.ecryptfs/}}:<br><small>''(in the case of full home dir encryption, this will be a symlink to the actual location at {{ic|/home/.ecryptfs/$USER/.ecryptfs/}})''</small><br />
** {{ic|Private.mnt}} ''[plain text file]'' - contains the path where the upper directory should be mounted (e.g. {{ic|/home/lucy}} or {{ic|/home/lucy/Private}})<br />
** {{ic|Private.sig}} ''[plain text file]'' - contains the signature used to identify the mount passphrase in the kernel keyring<br />
** {{ic|wrapped-passphrase}} ''[binary file]'' - the mount passphrase, encrypted with the login passphrase<br />
** {{ic|auto-mount}}, {{ic|auto-umount}} ''[empty files]'' - if they exist, the pam_ecryptfs.so module will (assuming it is loaded) automatically mount/unmount this encrypted directory when the user logs in/out<br />
|}<br />
<br />
==== Encrypting a data directory ====<br />
For a full $HOME directory encryption see [[#Encrypting a home directory]]<br />
<br />
To encrypt a single data directory as a user, run<br />
$ ecryptfs-setup-private<br />
and follow the instructions. It will automatically create the ~/.Private/ and ~/.ecryptfs/ directory structures as described in the box above. It will also ask for two passphrases:<br />
<br />
;''login passphrase'': This is the password you will have to enter each time you want to mount the encrypted directory. If you want auto-mounting on login to work, it has to be the same password you use to login to your user account; otherwise you can choose a different one.<br />
<br />
;''mount passphrase'': This is used to derive the actual file encryption master key. Thus you should not enter a custom one unless you know what you are doing - instead press Enter to let it auto-generate a random one, which will be much more secure. It will be encrypted using the login passphrase and stored in this encrypted form in {{ic|~/.ecryptfs/wrapped-passphrase}}, and automatically decrypted ("unwrapped") again in RAM when needed, so you never have to enter it manually. Make sure this file does not get lost, otherwise you can never access your encrypted folder again! You may want to run {{ic|ecryptfs-unwrap-passphrase}} to see the mount passphrase in unencrypted form, write it down on a piece of paper, and keep it in a safe (or similar), so you can use it to recover your encrypted data in case the ''wrapped-passphrase'' file is accidentally lost/corrupted or in case you forget the login passphrase.<br />
<br />
The mount point ("upper directory") for the encrypted folder will be at {{ic|~/Private}} by default, however you can manually change this right after the setup command has finished running, by doing:<br />
<br />
$ mv ~/Private /path/to/new/folder<br />
$ echo /path/to/new/folder > ~/.ecryptfs/Private.mnt<br />
<br />
To actually use your encrypted folder, you will have to mount it... See [[#Mounting]] below.<br />
<br />
===== Undo encryption =====<br />
To undo the single directory encryption run<br />
<br />
$ ecryptfs-setup-private --undo<br />
<br />
and follow the instructions<br />
<br />
==== Encrypting a home directory ====<br />
<br />
This will set up an encrypted $HOME directory for a user, and take care of migrating any existing files they have in their not yet encrypted home directory. Ensure that the user in question ''owns no processes'' and is ''logged out''. You also need to ensure that you have {{pkg|rsync}} installed. Once the prerequisites have been met run as root:<br />
<br />
# ecryptfs-migrate-home -u ''username''<br />
<br />
and follow the instructions. It is imperative that the user logs in ''before'' the next reboot, to complete the process.<br />
<br />
==== Mounting ====<br />
<br />
{{Expansion|<br>- explain how to mount on-demand, using ecryptfs-mount-private and ecryptfs-umount-private<br><br />
- explain how to mount from a live-CD, using ecryptfs-recover-private|section=Major_restructuring/rewrite}}<br />
<br />
==== Auto-mounting ====<br />
<br />
A better way is to use PAM directly, see 'PAM MODULE' in:<br />
/usr/share/doc/ecryptfs-utils/README<br />
<br />
1. Check if '''~/.ecryptfs/auto-mount''' and '''~/.ecryptfs/wrapped-passphrase''' (these are automatically created by '''ecryptfs-setup-private''') exist.<br />
<br />
2. Add ecryptfs to the pam-stack exactly as following to allow transparent unwrapping of the passphrase on login.<br />
<br />
Open '''/etc/pam.d/system-auth''' and add this ''after'' the line containing '''auth required pam_unix.so [...]''':<br />
auth required pam_ecryptfs.so unwrap<br />
, then add this ''above'' the line containing '''password required pam_unix.so [...]''':<br />
password optional pam_ecryptfs.so<br />
, and this ''after'' the line '''session required pam_unix.so''':<br />
session optional pam_ecryptfs.so<br />
<br />
3. Relogin (you need to type the user's password for obvious reason ;) and check output of '''mount''' which should now contain a mountpoint, e.g.:<br />
/home/$USER/.Private on /home/$USER/Private type ecryptfs (...)<br />
Your user's encrypted directory should be perfectly readable, e.g. $HOME/Private/<br />
<br />
Note that the latter will be automatically unmounted and made unavailable when the user log off.<br />
<br />
----<br />
<br />
{{Deletion|Does the following provide any useful information that isn't already contained in the top part of this section? Do we really need a full copy of all those PAM files here?}}<br />
<br />
To use the eCryptfs PAM module it self for mounting you should know it depends on some hard-coded Ubuntu defaults. Like using AES cipher with a 16 byte key. As described in this BBS post [https://bbs.archlinux.org/viewtopic.php?pid=727422#p727422] you have to do the following steps:<br />
<br />
1) For your understanding and preparation, read the guide mentioned above. [http://sysphere.org/~anrxc/j/articles/ecryptfs/index.html]<br />
<br />
2) Install [https://www.archlinux.org/packages/core/x86_64/keyutils/ keyutils] and [https://www.archlinux.org/packages/community/x86_64/ecryptfs-utils/ ecryptfs-utils] from the official Repos.<br />
<br />
'''[Do the following steps as root!]'''<br />
<br />
3) Make a "ecryptfs" Group:<br />
groupadd ecryptfs<br />
4) Add the user to it:<br />
usermod -aG ecryptfs user<br />
5) Load the ecryptfs module<br />
modprobe ecryptfs<br />
6) Change your /etc/pam.d/system-auth to look something like this (lines to add are bold):<br />
#%PAM-1.0<br />
<br />
auth required pam_env.so<br />
auth required pam_unix.so try_first_pass nullok<br />
'''auth required pam_ecryptfs.so unwrap'''<br />
auth optional pam_permit.so<br />
<br />
account required pam_unix.so<br />
account optional pam_permit.so<br />
account required pam_time.so<br />
<br />
'''password required pam_ecryptfs.so'''<br />
password required pam_unix.so try_first_pass nullok sha512 shadow<br />
password optional pam_permit.so<br />
<br />
'''session required pam_ecryptfs.so unwrap'''<br />
session required pam_limits.so<br />
session required pam_env.so<br />
session required pam_unix.so<br />
session optional pam_permit.so<br />
<br />
<br />
6a) When using [[GDM]] < 3.2 to log in, edit /etc/pam.d/gdm like this:<br />
#%PAM-1.0<br />
auth requisite pam_nologin.so<br />
auth required pam_env.so<br />
auth required pam_unix.so<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
auth optional pam_gnome_keyring.so<br />
account required pam_unix.so<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
session optional pam_gnome_keyring.so auto_start<br />
password required pam_unix.so<br />
'''password optional pam_ecryptfs.so'''<br />
<br />
6b) For [[GDM]] >= 3.2, make the following changes to /etc/pam.d/gdm-password (thanks to grawity for [https://bbs.archlinux.org/viewtopic.php?pid=998061#p998061 this]):<br />
#%PAM-1.0<br />
auth requisite pam_nologin.so<br />
auth required pam_env.so<br />
auth requisite pam_unix.so nullok<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
auth optional pam_gnome_keyring.so<br />
auth sufficient pam_succeed_if.so uid >= 1000 quiet<br />
auth required pam_deny.so<br />
account required pam_unix.so<br />
password required pam_unix.so<br />
'''password optional pam_ecryptfs.so'''<br />
session required pam_loginuid.so<br />
-session optional pam_systemd.so<br />
session optional pam_keyinit.so '''force''' revoke<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
6c) For [[KDM]], make the following changes to /etc/pam.d/kde:<br />
<br />
#%PAM-1.0<br />
auth required pam_unix.so<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
auth required pam_nologin.so<br />
account required pam_unix.so<br />
'''password optional pam_ecryptfs.so'''<br />
password required pam_unix.so<br />
session required pam_unix.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
session required pam_limits.so<br />
<br />
6d) For [[LXDM]], make the following changes to /etc/pam.d/lxdm:<br />
<br />
#%PAM-1.0<br />
auth requisite pam_nologin.so<br />
auth required pam_env.so<br />
auth required pam_unix.so<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
account required pam_unix.so<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
password required pam_unix.so<br />
'''password optional pam_ecryptfs.so'''<br />
<br />
6e) For [[LightDM]], make the following changes to /etc/pam.d/lightdm<br />
<br />
#%PAM-1.0<br />
auth required pam_nologin.so<br />
auth required pam_env.so<br />
auth required pam_unix.so<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
account required pam_unix.so<br />
'''password optional pam_ecryptfs.so'''<br />
password required pam_unix.so<br />
session required pam_unix.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
<br />
7) To be able to automatically mount your encrypted home directory on login using SSH, edit /etc/pam.d/sshd:<br />
#%PAM-1.0<br />
#auth required pam_securetty.so #Disable remote root<br />
auth required pam_unix.so<br />
'''auth optional pam_ecryptfs.so unwrap'''<br />
auth required pam_env.so<br />
account required pam_nologin.so<br />
account required pam_unix.so<br />
account required pam_time.so<br />
password required pam_unix.so<br />
password optional pam_ecryptfs.so<br />
'''session optional pam_ecryptfs.so unwrap'''<br />
session required pam_unix_session.so<br />
session required pam_limits.so<br />
session optional pam_ck_connector.so nox11<br />
<br />
9) Log in and check if everything worked correctly.<br />
<br />
This is a working solution and ecryptfs is exactly used as in Ubuntu (10.04/10.10) - and is easy to set up. <br />
Besides this, it has the advantage of auto-unmount at log-out, which shell profile files (ie. ~/.bash_logout) could have trouble doing, because there could still be open file-descriptors by the shell at the time of umount. To encrypt swap see: [[System_Encryption_with_LUKS#Encrypting_the_Swap_partition]] (some of the tools provided by ecryptfs, such as ecryptfs-setup-swap, only work in ubuntu).<br />
<br />
=== Using ecryptfs-simple ===<br />
<br />
Use [http://xyne.archlinux.ca/projects/ecryptfs-simple/ ecryptfs-simple] if you just want to use eCryptfs to mount arbitrary directories the way you can with EncFS. ecryptfs-simple does not require root privileges or entries in fstab, nor is it limited to hard-coded directories such as ~/.Private. The package is available in the [https://aur.archlinux.org/packages.php?ID=59612 AUR] and in [http://xyne.archlinux.ca/repos/ Xyne's repos].<br />
<br />
As the name implies, usage is simple:<br />
# simple mounting<br />
ecryptfs-simple /path/to/foo /path/to/bar<br />
<br />
# automatic mounting: prompts for options on the first mount of a directory then reloads them next time<br />
ecryptfs-simple -a /path/to/foo /path/to/bar<br />
<br />
# unmounting by source directory<br />
ecryptfs-simple -u /path/to/foo<br />
<br />
# unmounting by mountpoint<br />
ecryptfs-simple -u /path/to/bar<br />
<br />
=== Manual setup ===<br />
<br />
{{Expansion|<br> - fully explain how to set up an encrypted '''data directory''' or '''home directory''' using mount.ecryptfs and ecryptfs-wrap-passphrase<br><br />
- this section should be more generic & comprehensive than it is now, and possibly be split into additional subsections|section=Major_restructuring/rewrite}}<br />
<br />
The ecryptfs-utils package is distributed with a few helper scripts which will help you with key management and similar tasks. Some were written to automate this whole process of setting up encrypted directories (''ecryptfs-setup-private'') or help you combine eCryptfs with dm-crypt to protect swap space (''ecryptfs-setup-swap''). Despite those scripts we will go trough the process manually so you get a better understanding of what is really being done.<br />
<br />
First create your private directories, in this example we will call them exactly that: Private<br />
$ su -<br />
# mkdir -m 700 /home/username/.Private<br />
# mkdir -m 500 /home/username/Private<br />
# chown username:username /home/username/{.Private,Private}<br />
<br />
Let's summarize<br />
* Actual encrypted data will be stored in ~/.Private directory (so-called ''lower'' directory)<br />
* While mounted, decrypted data will be available in ~/Private directory (so-called ''upper'' directory)<br />
** While not mounted nothing can be written to this directory<br />
** While mounted it has the same permissions as the lower directory<br />
<br />
eCryptfs can now be mounted on top of ~/Private.<br />
# mount -t ecryptfs /home/username/.Private /home/username/Private<br />
<br />
You will need to answer a few questions and provide a passphrase which should be used to mount this directory in the future. However you can also have different keys encrypting different data (more about this below). For convenience we will limit this guide to only one key and passphrase. Let's see an example:<br />
Key type: passphrase<br />
Passphrase: ThisIsAVeryWeakPassphrase<br />
Cipher: aes<br />
Key byte: 16<br />
Plaintext passtrough: no<br />
Filename encryption: no<br />
Add signature to cache: yes <br />
<br />
Let's summarize<br />
* The passphrase is your '''mount passphrase''' which will be salted, hashed and loaded into the kernel keyring.<br />
** In eCryptfs terms, this salted, hashed passphrase is your "file encryption key, encryption key", or '''fekek'''.<br />
* eCryptfs supports a few different ciphers (AES, blowfish, twofish...). You can read about them on Wikipedia.<br />
* Plaintext passtrough enables you to store and work with '''un-encrypted''' files stored in the lower directory.<br />
* Filename encryption is available since Linux 2.6.29<br />
** In eCryptfs terms the key used to protect filenames is known as "filename encryption key", or '''fnek'''.<br />
* The signature of the key(s) will be stored in {{ic|/root/.ecryptfs/sig-cache.txt}}.<br />
<br />
Since our later goal is to be able to mount without root privileges, we will now move the eCryptfs configuration directory to your own home and transfer the ownership to you:<br />
# mv /root/.ecryptfs /home/username<br />
# chown username:username /home/username/.ecryptfs<br />
<br />
Your setup is now complete and directory is mounted. You can place any file in the '''~/Private''' directory and it will get encrypted in '''~/.Private'''.<br />
<br />
Now copy a few files to your new private directory, and then un-mount it. If you inspect the files you will see that they are unreadable &ndash; encrypted. That was cool you say, but how do I get them back... and that brings us to:<br />
<br />
----<br />
<br />
Above is detailed the simplest way to setup the mount point, but '''ecryptfs-setup-private''' runs through some extra steps.<br />
<br />
* The above '''mount passphrase''' is derived from the passphrase you type in. This is not considered very [http://ecryptfs.sourceforge.net/ecryptfs-faq.html#pubkey-about secure], so the setup script grabs some characters from {{ic|/dev/random}} for safety:<br />
<br />
od -x -N $bytes --width=$bytes /dev/urandom | head -n 1 | sed "s/^0000000//" | sed "s/\s*//g"<br />
<br />
* '''ecryptfs-setup-private''' also takes the resulting mount passphrase and wraps it with your login passphrase (pasword) and stores this in '''~/.ecryptfs/wrapped-passphrase'''. You can replicate this with: <br />
<br />
$ ecryptfs-wrap-passphrase ~/.ecryptfs/wrapped-passphrase <br />
Passphrase to wrap: <br />
Wrapping passphrase:<br />
<br />
==== Mounting ====<br />
<br />
{{Expansion|<br> - fully explain how to mount on-demand, using ecryptfs-add-passphrase and mount.ecryptfs<br><br />
- this section should be more generic & comprehensive than it is now|section=Major_restructuring/rewrite}}<br />
<br />
Whenever you need your files available you can repeat the above mount procedure, using the same passphrase and options if you want to access your previously encrypted files or using a different passphrase (and possibly options) if for some reason you want to have different keys protecting different data (imagine having a publicly shared directory where different data is encrypted by different users, and their keys).<br />
<br />
In any case going trough those questions every time could be a bit tedious.<br />
<br />
One solution would be to create an entry in the '''{{ic|/etc/fstab}}''' file for this mount point:<br />
<br />
/home/user/.Private /home/user/Private ecryptfs [... user ... ecryptfs_sig=XY,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs 0 0<br />
<br />
* You will notice that we defined the '''user''' option, it enables you to mount the directory as a user (if it does not works as a normal user, you may need to setuid mount.ecryptfs by running as root: ''chmod +s /sbin/mount.ecryptfs'')<br />
* Notice the '''ecryptfs_sig''' option, replace ''XY'' with your own key signature (as seen in the '''mtab''' line earlier and in {{ic|sig-cache.txt}})<br />
* If you enabled filename encryption then pass an additional mount option: '''ecryptfs_fnek_sig'''=''XY'', where ''XY'' is the same signature you provide with the '''ecryptfs_sig''' option.<br />
* Last option '''ecrypfs_unlink_sigs''' ensures that your keyring is cleared every time the directory is un-mounted<br />
<br />
Since your key was deleted from the kernel keyring when you un-mounted, in order to mount you need to insert it into the keyring again. You can use the '''ecryptfs-add-passphrase''' utility or the '''ecryptfs-manager''' to do it:<br />
<br />
When the key is inserted you can mount the directory: <br />
$ ecryptfs-add-passphrase<br />
Passphrase: ThisIsAVeryWeakPassphrase<br />
<br />
$ mount -i /home/username/Private<br />
<br />
You will notice that we used the '''{{Ic|-i}}''' option this time. It disables invoking the mount helper. Speaking of which, using {{Ic|-i}} by default mounts with: '''nosuid, noexec''' and '''nodev'''. If you want to have at least executable files in your private directory you can add the '''exec''' option to the fstab line.<br />
<br />
This would be a good place to mention the '''keyctl''' utility from the (earlier installed) ''keyutils'' package. It can be used for any advanced key management tasks. Following examples show how to list your keyring contents and how to clear them:<br />
$ keyctl list @u<br />
$ keyctl clear @u<br />
<br />
{{Note|However, one should remember that /etc/fstab is for system-wide partitions only and should not be used for user-specific mounts}}<br />
<br />
==== Auto-mounting ====<br />
<br />
{{Expansion|<br>- this section should be more generic & comprehensive than it is now<br><br />
- make sure it properly fits in with the article structure|section=Major_restructuring/rewrite}}<br />
<br />
The above "''eCryptfs and $HOME''" article uses a shell init file to mount the home directory. The same can be done using [[pam_mount]] with the added benefit that home is un-mounted when all sessions are logged out. Add the following lines to {{ic|/etc/security/pam_mount.conf.xml}}:<br />
<br />
<luserconf name=".pam_mount.conf.xml" /><br />
<mntoptions require="" /> <!-- Default required mount options are ; this clears them --><br />
<lclmount>mount -i %(VOLUME) "%(before=\"-o\" OPTIONS)"</lclmount> <!-- --><br />
<br />
Please prefer writing manually these lines instead of simply copy/pasting them (especially the lclmount line), otherwise you might get some corrupted characters.<br />
Explanation:<br />
* the first line indicates where the user-based configuration file is located (here {{ic|~/.pam_mount.conf.xml}}) ;<br />
* the second line overwrites the default required mount options which are unnecessary ("nosuid,nodev") ;<br />
* the last line indicates which mount command to run (eCryptfs needs the {{Ic|-i}} switch).<br />
<br />
Then set the volume definition, preferably to {{ic|~/.pam_mount.conf.xml}}:<br />
<pam_mount><br />
<volume noroot="1" fstype="ecryptfs" path="/home/.ecryptfs/user/.Private/" mountpoint="/home/user/"/><br />
</pam_mount><br />
<br />
"noroot" is needed because the encryption key will be added to the user's keyring<br />
<br />
Finally, edit {{ic|/etc/pam.d/login}} as described in [[pam_mount]]'s article.<br />
<br />
===== Optional step =====<br />
<br />
To avoid wasting time needlessly unwrapping the passphrase you can create a script that will check ''pmvarrun'' to see the number of open sessions:<br />
#!/bin/sh<br />
#<br />
# /usr/local/bin/doecryptfs<br />
<br />
exit $(/usr/sbin/pmvarrun -u$PAM_USER -o0)<br />
<br />
With the following line added before the eCryptfs unwrap module in your PAM stack:<br />
auth [success=ignore default=1] pam_exec.so quiet /usr/local/bin/doecryptfs<br />
auth required pam_ecryptfs.so unwrap<br />
The article suggests adding these to {{ic|/etc/pam.d/login}}, but the changes will need to be added to all other places you login, such as {{ic|/etc/pam.d/kde}}.<br />
<br />
== Usage ==<br />
<br />
{{Expansion|<br> - point to the above "Setup & Mounting" section for how to mount and unmount [this section here will cover all other (i.e. setup-independent) usage info]<br><br />
- explain how to interact with encrypted files using ecryptfs-stat, ecryptfs-find, ecryptfs-rewrite-file<br><br />
- discuss symlinking into the encrypted container<br><br />
- discuss placing non-encrypted files or folders in the encrypted container ("pass-through")<br><br />
- discuss backup strategies<br />
|section=Major_restructuring/rewrite}}<br />
<br />
Besides using your private directory as storage for sensitive files, and private data, you can also use it to protect application data. Take ''Firefox'' for an example, not only does it have an internal password manager but the browsing history and cache can also be sensitive. Protecting it is easy:<br />
$ mv ~/.mozilla ~/Private/mozilla<br />
$ ln -s ~/Private/mozilla ~/.mozilla<br />
<br />
=== Removal ===<br />
<br />
If you want to move a file out of the private directory just move it to it's new destination while ~/Private is mounted. Also note that there are no special steps involved if you want to remove your private directory. Make sure it is un-mounted and delete ~/.Private, along with all the files.<br />
<br />
=== Backup ===<br />
<br />
Setup explained here separates the directory with encrypted data from the mount point, so the encrypted data is available for backup at any time. With an overlay mount (i.e. ''~/Secret'' mounted over ''~/Secret'') the lower, encrypted, data is harder to get to. Today when cronjobs and other automation software do automatic backups the risk of leaking your sensitive data is higher.<br />
<br />
We explained earlier that all cryptographic metadata is stored in the headers of files. You can easily do backups, or incremental backups, of your '''~/.Private''' directory, treating it like any other directory.<br />
<br />
== See Also ==<br />
<br />
* [https://defuse.ca/audits/ecryptfs.htm Security audit] of eCryptfs by Taylor Hornby (January 22, 2014).<br />
<br />
<br />
{{Deletion|Regardless of what some blog author thinks, this wiki should strive to treat the topic of disk encryption with eCryptfs comprehensively (within reasonable limits of course). If there are multiple good options at any particular step, then multiple options should be listed. Once this wiki page will have achieved that goal, the following should be deleted (or replaced by a plain "See Also" link list.)|section=Major_restructuring/rewrite}}<br />
<br />
This wiki article covers only the basic setup of a private encrypted directory. There is however another article about eCryptfs on Arch Linux, which covers encryption of your entire $HOME and encrypting swap space without breaking hibernation (suspend to disk).<br />
<br />
That article includes many more steps (i.e. using PAM modules and automatic mounting) and the author was opposed to replicating it here, because there is just no single "right" way to do it. The author proposes some solutions and discusses the security implications, but they are his solutions and as such might not be the best nor are they endorsed by the eCryptfs project in any way.<br />
<br />
Article: [http://sysphere.org/~anrxc/j/articles/ecryptfs/index.html eCryptfs and $HOME] by Adrian C. (anrxc).<br />
<br />
Consider that ''Chromium OS'', as released by Google, is using eCryptfs to protect devices that are, and will be, powered by it. Some implementation details are available and they make excellent reading. You can read them [http://www.chromium.org/chromium-os/chromiumos-design-docs/protecting-cached-user-data here], they could help a lot as you're coming up with your own strategy.</div>OmeGahttps://wiki.archlinux.org/index.php?title=EncFS&diff=301064EncFS2014-02-24T06:35:07Z<p>OmeGa: Add link to a security audit of EncFS by Taylor Hornby</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
{{Related articles start}}<br />
{{Related|Disk Encryption}}<br />
{{Related articles end}}<br />
'''EncFS''' is a userspace stackable cryptographic file-system similar to [[eCryptfs]], and aims to secure data with the minimum hassle. It uses [[FUSE]] to mount an encrypted directory onto another directory specified by the user. It does not use a loopback system like some other comparable systems such as [[TrueCrypt]] and [[dm-crypt]].<br />
<br />
EncFS is definitely the simplest software if you want to try disk encryption on Linux.<br />
<br />
This has a number of advantages and disadvantages compared to these systems. Firstly, it does not require any root privileges to implement; any user can create a repository of encrypted files. Secondly, one does not need to create a single file and create a file-system within that; it works on existing file-system without modifications.<br />
<br />
This does create a few disadvantages, though; because the encrypted files are not stored in their own file, someone who obtains access to the system can still see the underlying directory structure, the number of files, their sizes and when they were modified. They cannot see the contents, however.<br />
<br />
This particular method of securing data is obviously not perfect, but there are situations in which it is useful.<br />
<br />
For more details on how EncFS compares to other disk encryption solution, see [[Disk Encryption#Comparison table]].<br />
<br />
== Comparison to eCryptFS ==<br />
<br />
[[System_Encryption_with_eCryptfs|eCryptFS]] is implemented in kernelspace and therefore little bit harder to configure. You have to remember various encryption options (used cyphers, key type, etc...), in EncFS this is not the case, because EncFS is storing that information in its signature so you do not have to remember anything (except the passphrase). The authors of eCryptFS claim it is faster because there is no overhead caused by context switching (between kernel and userspace).<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{Pkg|encfs}} package.<br />
<br />
== Usage ==<br />
<br />
To create a secured repository, type:<br />
$ encfs ~/.''name'' ~/''name''<br />
Note that absolute paths must be used. This will be followed by a prompt about whether you want to go with the default (paranoid options) or expert configuration. The latter allows specifying algorithms and other options. The former is a fairly secure default setup. After entering a key for the encryption, the encoded file-system will be created and mounted. The encoded files are stored, in this example, at {{ic|~/.''name''}}, and their unencrypted versions in {{ic|~/''name''}}.<br />
<br />
To unmount the file-system, type:<br />
$ fusermount -u ~/''name''<br />
<br />
To remount the file-system, issue the first command, and enter the key used to encode it. Once this has been entered, the file-system will be mounted again.<br />
<br />
== User friendly mounting ==<br />
<br />
=== Mount using Gnome Encfs Manager ===<br />
<br />
The Gnome Encfs Manager is an easy to use manager and mounter for encfs stashes featuring per-stash configuration, Gnome Keyring support, a tray menu inspired by Cryptkeeper but using the AppIndicator API and lots of unique features.<br />
<br />
The author has created a repo which is more up to date than the AUR package.<br />
Add it to /etc/pacman.conf<br />
<br />
[home_moritzmolch_gencfsm_Arch_Extra]<br />
SigLevel = Never<br />
Server = http://download.opensuse.org/repositories/home:/moritzmolch:/gencfsm/Arch_Extra/$arch<br />
<br />
sudo pacman -Sy gnome-encfs-manager<br />
<br />
=== Mount using gnome-encfs ===<br />
<br />
gnome-encfs integrates EncFS folders into the GNOME desktop by storing their passwords in the keyring and optionally mounting them at login using GNOME's autostart mechanism. See https://bitbucket.org/obensonne/gnome-encfs/.<br />
This method has the advantage that mounting and can automated and the password does not have to be the same as your user password.<br />
<br />
=== Mount using CryptKeeper trayicon ===<br />
<br />
Quite simple app, just install {{AUR|cryptkeeper}} from AUR and add it to your X session.<br />
<br />
=== Mount at login using pam_encfs ===<br />
<br />
Install {{AUR|pam_encfs}}. See also:<br />
* http://pam-encfs.googlecode.com/svn/trunk/README<br />
* http://pam-encfs.googlecode.com/svn/trunk/pam_encfs.conf<br />
* https://wiki.edubuntu.org/EncryptedHomeFolder<br />
* http://code.google.com/p/pam-encfs/<br />
<br />
==== Single password ====<br />
<br />
{{Warning|Note that if you will use same password (eg.: using try_first_pass or use_first_pass) for login and encfs (so encfs will mount during your login) then you should use [[SHA password hashes]] (Preferably SHA512 with some huge numer of rounds) and (which is most important) '''secure password''', because hash of your password is probably stored in unencrypted form in {{ic|/etc/shadow}} and it can be cracked in order to get your encfs password (because it's same as your regular unix login password).}}<br />
<br />
==== /etc/pam.d/ ====<br />
<br />
Note that when you are using ''try_first_pass'' parameter to ''pam_unix.so'' then you will have to set EncFS to use same password as you are using to login (or vice-versa) and you will be entering just single password. Without this parameter you will need to enter two passwords.<br />
<br />
===== login =====<br />
<br />
This section tells how to make encfs automount when you're logging in by virtual terminal.<br />
{{Note|If you only want to use it through GDM, you may pass this and go right to the [[EncFS#gdm|GDM section]] below.}}<br />
{{bc|<nowiki><br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
auth sufficient pam_encfs.so<br />
auth required pam_unix.so nullok try_first_pass<br />
#auth required pam_unix.so nullok<br />
auth required pam_tally.so onerr=succeed file=/var/log/faillog<br />
# use this to lockout accounts for 10 minutes after 3 failed attempts<br />
#auth required pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog<br />
account required pam_access.so<br />
account required pam_time.so<br />
account required pam_unix.so<br />
#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3<br />
#password required pam_unix.so md5 shadow use_authtok<br />
session required pam_unix.so<br />
session required pam_env.so<br />
session required pam_motd.so<br />
session required pam_limits.so<br />
session optional pam_mail.so dir=/var/spool/mail standard<br />
session optional pam_lastlog.so<br />
session optional pam_loginuid.so<br />
-session optional pam_ck_connector.so nox11<br />
#Automatic unmount (optional):<br />
#session required pam_encfs.so<br />
</nowiki>}}<br />
{{Warning|Note that automatic unmout will process even when there is another session. eg.: logout on VC can unmout encfs mounted by GDM session that is still active.}}<br />
<br />
===== gdm =====<br />
<br />
This section explains how to make encfs automount when you're logging in by GDM.<br />
{{Note|For debug purposes you may try automount on virtual console login first. [[EncFS#login|This article has a section about automount on virtual console login]].}}<br />
<br />
Edit the file {{ic|/etc/pam.d/gdm-password}}.<br />
<br />
Insert (do not overwrite) the following into the bottom of gdm-password:<br />
<br />
{{bc|<nowiki><br />
#%PAM-1.0<br />
auth requisite pam_nologin.so<br />
auth required pam_env.so<br />
auth sufficient pam_encfs.so<br />
auth required pam_unix.so try_first_pass<br />
auth optional pam_gnome_keyring.so<br />
account required pam_unix.so<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
session optional pam_gnome_keyring.so auto_start<br />
password required pam_unix.so<br />
session required pam_encfs.so<br />
</nowiki>}}<br />
<br />
Save and exit.<br />
<br />
===== Configuration =====<br />
<br />
Edit {{ic|/etc/security/pam_encfs.conf}} :<br />
<br />
Recommended: comment out the line<br />
<br />
encfs_default --idle=1<br />
<br />
This flag will unmount your encrypted folder after 1 minute of inactivity. If you are automounting this on login, you probably would like to keep this mounted for as long as you are logged in.<br />
<br />
At the bottom, comment any existing demo entries and add:<br />
{{bc|<br />
#USERNAME SOURCE TARGET PATH ENCFS Options FUSE Options<br />
foo /home/foo/EncryptedFolder /home/foo/DecryptedFolder -v allow_other<br />
}}<br />
<br />
Next, edit {{ic|/etc/fuse.conf}}:<br />
Uncomment:<br />
user_allow_other<br />
<br />
To test your config, open a new virtual terminal (e.g. {{ic|Ctrl+Alt+F4}}) and login. You should see pam successfuly mount your EncFS folder.<br />
<br />
=== Mount when USB drive with EncFS folders is inserted using fsniper ===<br />
<br />
Simple method to automount (asking for password) encfs when USB drive with EncFS one or more folders in root is inserted. We will use {{AUR|fsniper}} (filesystem watching daemon using inotify) and {{Pkg|git}} (for askpass binary).<br />
<br />
See more at https://github.com/Harvie/Programs/tree/master/bash/encfs/automount (latest version of files used in the [[#How to|How to]]).<br />
<br />
==== How to ====<br />
<br />
'''1.''' You need USB automount working for this - like thunar or nautilus does.<br \><br />
'''2.''' Make encrypted folder on your drive, eg.: {{ic|encfs /media/USB/somename /media/USB/somename.plain}} (and then unmount everything).<br \><br />
'''3.''' Create a {{ic|~/.config/fsniper/config}} file:<br />
{{bc|<nowiki><br />
watch {<br />
/etc/ {<br />
mtab {<br />
# %% is replaced with the filename of the new file<br />
handler = encfs-automount.sh %%;<br />
}<br />
}<br />
}<br />
</nowiki>}}<br />
'''4.''' install helper script:<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
# ~/.config/fsniper/scripts/encfs-automount.sh<br />
# Quick & dirty script for automounting EncFS USB drives<br />
# TODO:<br />
# - Unmounting!!!<br />
#<br />
ASKPASS="/usr/lib/git-core/git-gui--askpass"<br />
<br />
lock=/tmp/fsniper_encfs.lock<br />
lpid=$(cat "$lock" 2>/dev/null) &&<br />
ps "$lpid" | grep "$lpid" >/dev/null && {<br />
echo "Another instance of fsniper_encfs is running"<br />
exit;<br />
}<br />
echo $BASHPID > "$lock";<br />
sleep 2;<br />
<br />
echo<br />
echo ==== EncFS automount script for fsniper ====<br />
<br />
list_mounts() {<br />
cat /proc/mounts | cut -d ' ' -f 2<br />
}<br />
<br />
list_mounts | while read mount; do<br />
config="$mount"'/*/.encfs*';<br />
echo Looking for "$config"<br />
config="$(echo $config)"<br />
[ -r "$config" ] && {<br />
cyphertext="$(dirname "$config")";<br />
plaintext="$cyphertext".plain<br />
echo Found config: "$config";<br />
echo Trying to mount: "$cyphertext to $plaintext";<br />
list_mounts | grep "$plaintext" >/dev/null && {<br />
echo Already mounted: "$plaintext"<br />
} || {<br />
echo Will mount "$cyphertext to $plaintext"<br />
"$ASKPASS" "EncFS $cyphertext to $plaintext" | encfs --stdinpass "$cyphertext" "$plaintext"<br />
}<br />
}<br />
done<br />
echo<br />
<br />
rm "$lock" 2>/dev/null<br />
</nowiki>}}<br />
'''5.''' Make sure that /usr/lib/git-core/git-gui--askpass is working for you (that's why you need git package - but you can adjust the helper script).<br \><br />
'''6.''' Try {{ic|fsniper --log-to-stdout}} in terminal (askpass should appear when USB drive is inserted).<br \><br />
'''7.''' Add {{ic|fsniper --daemon}} to your session.<br \><br />
'''8.''' Do not forget to unmount encfs before removing drive.<br />
<br />
== See Also ==<br />
<br />
[https://defuse.ca/audits/encfs.htm Security audit] of EncFS by Taylor Hornby (January 14, 2014).</div>OmeGahttps://wiki.archlinux.org/index.php?title=Improve_pacman_performance_(Espa%C3%B1ol)&diff=247678Improve pacman performance (Español)2013-02-17T11:19:08Z<p>OmeGa: </p>
<hr />
<div>[[Category:Package management (Español)]]<br />
[[de:Pacman beschleunigen]]<br />
[[en:Improve Pacman Performance]]<br />
[[fr:Ameliorer Pacman]]<br />
[[it:Improve Pacman Performance]]<br />
[[pl:Optymalizacja Pacmana]]<br />
[[ru:Improve Pacman Performance]]<br />
[[tr:Pacman_verimini_arttırmak]]<br />
[[zh-CN:Improve Pacman Performance]]<br />
[[zh-TW:Improve Pacman Performance]]<br />
== Mejorar la velocidad de acceso a la base de datos ==<br />
<br />
Pacman almacena toda la información relativa a los paquetes en una colección de archivos pequeños, uno por cada paquete. Mejorar la velocidad de acceso a la base de datos, reduce el tiempo necesario para completar las operaciones para las que aquellas se utilizan, por ejemplo, buscar paquetes y resolver las dependencias de los mismos. El método más seguro y rápido es ejecutar la siguiente orden, como root:<br />
<br />
# pacman-optimize<br />
<br />
De este modo, el sistema intentará reagrupar todos los archivos pequeños con la información de los paquetes en un ubicación (física) del disco duro, evitando que la cabeza del disco duro tenga que moverse en exceso cuando tenga que acceder a todos los paquetes. Este método es seguro, pero no es infalible. Su eficacia dependerá de factores como el sistema de archivos utilizado, del uso que se haga del disco y de la fragmentación del espacio vacío. Otra opción más agresiva sería quitar primero, de la caché, los paquetes desinstalados y eliminar los repositorios no utilizados, antes de optimizar la bases de datos:<br />
<br />
# pacman -Sc && pacman-optimize<br />
<br />
== Mejorar la velocidad de las descargas ==<br />
<br />
{{Nota|Si las velocidades de descarga son mínimas, asegúrese de que está utilizando uno de los [[mirrors]], y no ftp.archlinux.org, cuyo ancho de banda está [https://www.archlinux.org/news/302/ reducido desde marzo de 2007].}}<br />
<br />
La velocidad con que pacman descarga los paquetes se puede mejorar mediante el uso de una aplicación diferente para descargarlos, en lugar del descargador de archivos compilados de pacman.<br />
<br />
En todos los casos, asegúrese de tener instalada la última versión de pacman antes de realizar cualquier modificación.<br />
<br />
# pacman -Syu<br />
<br />
=== Usar wget ===<br />
<br />
Esta opción es muy útil si necesita configuraciones más avanzadas para el proxy respecto a las capacidades incorporadas en pacman.<br />
<br />
Para usar {{ic|wget}}, primero instálelo con {{ic|pacman -S wget}} y, luego, modifique el archivo {{ic|/etc/ pacman.conf}}, para agregar la siguiente línea a la sección {{ic|[options]}}:<br />
<br />
XferCommand = /usr/bin/wget -c --passive-ftp -c %u<br />
<br />
En lugar de poner los parámetros de {{ic|wget}} en el archivo {{ic|/etc/pacman.conf}}, puede modificar el archivo de configuración de {{ic|wget}} directamente (el archivo que afecta a todo el sistema es {{ic|/etc/wgetrc}}, mientras que los archivos que afectan únicamente a los usuarios están contenidos en {{ic|$HOME/.wgetrc}}).<br />
<br />
=== Usar aria2 ===<br />
<br />
[[aria2]] es una utilidad ligera de descarga con apoyo para descargas fragmentadas y reanudables desde HTTP/HTTPS y FTP. [http://aria2.sourceforge.net/ aria2] permite conexiones HTTP/HTTPS y FTP mútiples y simultáneas a un mirror de Arch, que debería traducirse en un aumento en la velocidad de descarga de los archivos y la posibilidad de recuperación de los paquetes.<br />
<br />
{{Nota|El uso de aria2c en el parámetro XferCommand de pacman '''no''' da como resultado descargas paralelas de varios paquetes. Pacman invoca la orden XferCommand con respecto a un único paquete a la vez y espera a que se complete antes de invocar el siguiente. Para descargar varios paquetes al mismo tiempo, véase cómo usar [[Improve_Pacman_Performance#Usar powerpill-light|powerpill-light]] en la siguiente sección.}}<br />
<br />
==== Instalación ====<br />
<br />
Descargue e instale {{Pkg|aria2}} y sus dependencias:<br />
<br />
# pacman -S aria2<br />
<br />
==== Configuración ====<br />
<br />
Modifique el archivo {{ic|/etc/pacman.conf}} agregando la siguiente línea a la sección {{ic|[options]}}:<br />
<br />
{{bc|1=XferCommand = /usr/bin/aria2c --allow-overwrite=true -c --file-allocation=none --log-level=error -m2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=60 -t5 -d / -o %o %u}}<br />
<br />
==== Detalles de las opciones ====<br />
<br />
; {{Ic|/usr/bin/aria2c}}: La ruta completa al ejecutable aria2.<br />
; {{Ic|1=--allow-overwrite=true}}: Reinicia la descarga si el archivo de control correspondiente no existe. (Por defecto: false).<br />
; {{Ic|-c, --continue}}: Continua la descarga de un archivo descargado parcialmente, si el archivo de control correspondiente existe.<br />
; {{Ic|1=--file-allocation=none}}: No preasigna al archivo un espacio en el disco antes de que comience la descarga. (Por defecto: prealloc) <b><sup>1</sup></b><br />
; {{Ic|1=--log-level=error}}: Establece el nivel de salida del registro solamente en caso de error. (Por defecto: debug).<br />
; {{Ic|1=-m2, --max-tries=2}}: Hace 2 intentos como máximo por mirror para descargar el archivo(s) especificado. (Por defecto: 5).<br />
; {{Ic|1=--max-connection-per-server=2}}: Establece un máximo de 2 conexiones para cada mirror por archivo. (Por defecto: 1).<br />
; {{Ic|1=--max-file-not-found=5}}: Fuerza la descarga al ser considerada como fallida si no se recibe un solo byte después de 5 intentos. (Por defecto: 0).<br />
; {{Ic|1=--min-split-size=5M}}: Divide el archivo si el tamaño es mayor que 2; 5 MB = 10 MB. (Por defecto: 20M).<br />
; {{Ic|--no-conf}}: Desactiva la carga si es que existe un archivo {{ic|aria2.conf}}. (Por defecto: {{ic|~/.aria2/aria2.conf}})<br />
; {{Ic|1=--remote-time=true}}: Aplica marcas de tiempo de los archivos remotos a los archivo locales. (Por omisión: false).<br />
; {{Ic|1=--summary-interval=60}}: Muestra la salida del resumen del progreso de descarga cada 60 segundos. (Por defecto: 60) <b><sup>2</sup></b><br />
; {{Ic|1=-t5, --timeout=5}}: Permite definir un tiempo de espera de 5 segundos por mirror después de establecer la conexión. (Por defecto: 60).<br />
; {{Ic|-d, --dir}}: El directorio para guardar el archivo(s) descargado como se especifica en [[pacman (Español)|pacman]].<br />
; {{Ic|-o, --output}}: Salida del nombre del archivo(s) descargado.<br />
; {{Ic|%o}}: Variable que representa el nombre del archivo(s) local, según lo especificado por pacman.<br />
; {{Ic|%u}}: Variable que representa la dirección URL de descarga, según lo especificado por pacman.<br />
<br />
==== Notas adicionales ====<br />
<br />
; <sup>1</sup> {{Ic|1=--file-allocation=falloc}}: Se recomienda para los sistemas de archivos más recientes, como ext4 (con soporte a las extensiones habilitadas), btrfs o xfs, ya que asigna la ubicación de archivos grandes (GB) casi al instante. No utilice falloc, para la preubicación, con sistemas de archivos antiguos como ext3, que consumen aproximadamente la misma cantidad de tiempo que la que consumiría la asignación estándar, bloqueando entre tanto el proceso de aria2 para realizar la descarga.<br />
<br />
; <sup>2</sup> {{Ic|1=--summary-interval=0}}: Suprime la salida del resumen del proceso de descarga y puede mejorar el rendimiento general. Los registros seguirán siendo escritos, de acuerdo con el valor especificado en la opción {{Ic|log-level}}.<br />
<br />
; <sup>3</sup> {{Ic|1=<nowiki>XferCommand = /usr/bin/printf 'Downloading ' && echo %u | awk -F/ '{printf $NF}' && printf '...' && /usr/bin/aria2c -q --allow-overwrite=true -c --file-allocation=none --log-level=error -m2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=0 -t5 -d / -o %o %u && echo ' Complete!'</nowiki>}}: El uso de la orden XferCommand proporciona una salida menos útil, pero mucho más fácil de leer.<br />
<br />
=== Usar powerpill-light ===<br />
[http://xyne.archlinux.ca/projects/pacman2aria2/ pacman2aria2] proporcina un script llamado «powerpill-light», que era un recurso provisional creado tras el desuso de powerpill original escrito en Perl. Ahora que [[Powerpill|Powerpill]] se ha vuelto a publicar, powerpill-light está desatendido.<br />
<br />
=== Script para el mirror pacget (aria2) ===<br />
<br />
Este script mejora notablemente la velocidad de descarga para los usuarios de banda ancha. Utilice los servidores en {{ic|/etc/pacman.d/mirrorlist}} como mirrors en aria2. Lo que hace aria2 es descargar desde múltiples servidores al mismo tiempo, lo que le da un gran impulso a la velocidad de descarga.<br />
<br />
{{Nota|Es necesario insertar «exec» antes de /usr/bin/pacget en XferCommand, de modo que al terminar pacget o aria2 (proceso utilizado por pacget), pacman también termine. Esto evitará inconvenientes, porque Pacman no insistirá en la descarga de un archivo cuando se le ordene interrumpirla.}}<br />
<br />
{{Advertencia|Se pueden experimentar algunos problemas si los mirrors utilizados no están sincronizados o simplemente no están al día. Solo tiene que usar el script [[Reflector (Español)|Reflector]] para generar una lista de mirrors actualizados y ''rápidos''. Además, ftp.archlinux.org viene resulta con dos IPs. Es posible que desee elegir solo una de ellas y forzar al sistema a utilizar ftp.archlinux.org y la dirección IP elegida mediante {{ic|/etc/hosts}}.}}<br />
<br />
{{hc|/usr/bin/pacget|<nowiki><br />
#!/bin/bash<br />
<br />
msg() {<br />
echo ""<br />
echo -e " \033[1;34m->\033[1;0m \033[1;1m${1}\033[1;0m" >&2<br />
}<br />
<br />
error() {<br />
echo -e "\033[1;31m==> ERROR:\033[1;0m \033[1;1m$1\033[1;0m" >&2<br />
}<br />
<br />
CONF=/etc/pacget.conf<br />
STATS=/etc/pacget.stats<br />
ARIA2=$(which aria2c 2> /dev/null)<br />
<br />
# ----- do some checks first -----<br />
if [ ! -x "$ARIA2" ]; then<br />
error "aria2c was not found or isn't executable."<br />
exit 1<br />
fi<br />
<br />
if [ $# -ne 2 ]; then<br />
error "Incorrect number of arguments"<br />
exit 1<br />
fi<br />
<br />
filename=$(basename $1)<br />
server=${1%/$filename}<br />
arch=$(grep ^Architecture /etc/pacman.conf | cut -d '=' -f2 | sed 's/ //g')<br />
if [[ $arch = "auto" ]]; then<br />
arch=$(uname -m)<br />
fi<br />
# Determine qué repositorio se está utilizando<br />
repo=$(awk -F'/' '$(NF-2)~/^(community|core|extra|testing|comunity-testing|multilib)$/{print $(NF-2)}' <<< $server)<br />
[ -z $repo ] && repo="custom"<br />
<br />
# Para los archivos db, o cuando se utiliza un repositorio personalizado (que muy probablemente no tiene ningún mirror),<br />
# Use solo la URL que le ha facilitado pacman, de lo contrario, extraiga la lista de servidores (desde el archivo «include» del repositorio) para la descarga desde<br />
url=$1<br />
if ! [[ $filename = *.db || $repo = "custom" ]]; then<br />
mirrorlist=$(awk -F' *= *' '$0~"^\\["r"\\]",/Include *= */{l=$2} END{print l}' r=$repo /etc/pacman.conf)<br />
if [ -n mirrorlist ]; then<br />
num_conn=$(grep ^split $CONF | cut -d'=' -f2)<br />
url=$(sed -r '/^Server *= */!d; s/Server *= *//; s/\$repo'"/$repo/"'; s/\$arch'"/$arch/; s/$/\/$filename/" $mirrorlist | head -n $(($num_conn *2)) )<br />
fi<br />
fi<br />
<br />
msg "Downloading $filename"<br />
cd /var/cache/pacman/pkg/<br />
<br />
touch $STATS<br />
<br />
$ARIA2 --conf-path=$CONF --max-tries=1 --max-file-not-found=5 \<br />
--uri-selector=adaptive --server-stat-if=$STATS --server-stat-of=$STATS \<br />
--allow-overwrite=true --remote-time=true --log-level=error --summary-interval=0 \<br />
$url --out=${filename}.pacget && [ ! -f ${filename}.pacget.aria2 ] && mv ${filename}.pacget $2 && chmod 644 $2<br />
<br />
exit $?<br />
</nowiki>}}<br />
<br />
{{hc|/etc/pacget.conf|<nowiki><br />
# El archivo de registro<br />
log=/var/log/pacget.log<br />
# El número de servidores para la descarga<br />
split=5<br />
# Tamaño mínimo del archivo a partir del cual justifica su división, es decir descarga simultánea (default 20M)<br />
min-split-size=1M<br />
# Velocidad máxima de descarga (0 = sin restricciones)<br />
max-download-limit=0<br />
# Velocidad mínima de descarga (0 = no importa)<br />
lowest-speed-limit=0<br />
# Período de tiempo de espera del servidor<br />
timeout=5<br />
# «none» (ninguno) o «falloc» (preubicación)<br />
file-allocation=none<br />
</nowiki>}}<br />
<br />
Guarde este script como /usr/bin/pacget.<br />
# chmod 755 /usr/bin/pacget<br />
La orden anterior hace que el script sea ejecutable.<br />
<br />
En la sección [options], del archivo /etc/pacman.conf, añadda lo siguiente:<br />
XferCommand = exec /usr/bin/pacget %u %o<br />
<br />
{{Nota|Si utiliza ftp.archlinux.org como el primer servidor listado en los archivos ''«include»'' (/etc/pacman.d/*), pueden ocurrir algunos problemas cuando los otros mirror que utiliza no se hayan sincronizado. Para hacer un mejor uso de este script, elija un mirror (que sincronice de manera oportuna) que sea el más apropiado para su caso, y coloquelo en la parte superior de la lista de servidores. Esto es para evitar descargar de ftp.archlinux.org, y hacerlo solo para cuando los otros mirrors no han sido sincronizados todavía. El script rankmirrors puede ser útil en este caso.}}<br />
<br />
=== Utilizar otras aplicaciones ===<br />
<br />
Existen otras aplicaciones para realizar las descargas, que se pueden utilizar con Pacman. Vienen presentadas a continuación, con sus correspondientes ajustes en XferCommand:<br />
<br />
* {{ic|snarf}}: {{ic|1=XferCommand = /usr/bin/snarf -N %u}}<br />
* {{ic|lftp}}: {{ic|1=XferCommand = /usr/bin/lftp -c pget %u}}<br />
* {{ic|axel}}: {{ic|1=XferCommand = /usr/bin/axel -n 2 -v -a -o %o %u}}<br />
<br />
== Elegir el mirror más rápido==<br />
Pacman utiliza los mirrors en el orden que aparecen contenidos en {{ic|/etc/pacman.d/mirrorlist}} para la descarga de los paquetes. El primer mirror de la lista puede no ser el más rápido.<br />
<br />
{{Nota|Esto no se aplica a [[Improve_Pacman_Performance#Using_powerpill-light | powerpill-light]], que se conecta a varios servidores al mismo tiempo para aumentar la velocidad de descarga total. La velocidad de las conexiones individuales se vuelve menos relevante, y powerpill-light puede ser configurado para requerir velocidades mínimas por conexión.}}<br />
<br />
=== Elegir un mirror local ===<br />
La forma más sencilla, es editar el archivo mirrorlist para colocar un mirror local en la parte superior de la lista. Entonces pacman utilizará este mirror preferentemente.<br />
<br />
Como alternativa, el archivo pacman.conf se puede editar para colocar un mirror antes de la línea ''«sourcing»'' del archivo mirrorlist, es decir, donde dice ''add your preferred servers here'' («agregar los servidores preferidos aquí»). Es aconsejable utilizar el mismo servidor para todos los repositorios.<br />
<br />
=== Usar rankmirrors ===<br />
<br />
Se puede utilizar [[Mirrors#List_by_speed|rankmirrors]] para ordenar los mirrors listados en pacman, en base a la velocidad de conexión.<br />
<br />
=== Usar Reflector ===<br />
<br />
También puede usar [[Reflector (Español)|Reflector]] para recuperar una lista personalizada de mirrors según la velocidad de descarga.<br />
<br />
=== Después de cambiar los mirrors ===<br />
<br />
Después de cambiar un mirror, es una buena idea actualizar la base de datos de pacman. El uso de dos ''«y»'' fuerza a refrescar una copia de la lista maestra de paquetes desde el servidor, aunque estime que están al día.<br />
<br />
# pacman -Syy<br />
<br />
== Compartir paquetes a través de una red LAN ==<br />
<br />
Si se dispone de más de una máquina con Arch Linux conectadas a una red local, se pueden compartir paquetes para disminuir los tiempos de descarga. Tenga presente que no se pueden compartir paquetes entre diferentes arquitecturas (es decir, i686 y x86_64) o generarán problemas.<br />
<br />
Véase [[Pacman_Tips#Network_shared_pacman_cache]].</div>OmeGahttps://wiki.archlinux.org/index.php?title=Beginners%27_Guide/Installation_(Espa%C3%B1ol)&diff=247677Beginners' Guide/Installation (Español)2013-02-17T11:11:41Z<p>OmeGa: /* Seleccionar un mirror */</p>
<hr />
<div><noinclude><br />
[[Category:About Arch (Español)]]<br />
[[Category:Getting and installing Arch (Español)]]<br />
[[da:Beginners' Guide/Installation]]<br />
[[en:Beginners' Guide/Installation]]<br />
[[hr:Beginners' Guide/Installation]]<br />
[[hu:Beginners' Guide/Installation]]<br />
[[it:Beginners' Guide/Installation]]<br />
[[ja:Beginners' Guide/Installation]]<br />
[[ko:Beginners' Guide/Installation]]<br />
[[nl:Beginners' Guide/Installatie]]<br />
[[pl:Beginners' Guide/Installation]]<br />
[[pt:Beginners' Guide/Installation]]<br />
[[ro:Ghidul începătorilor/Instalare]]<br />
[[ru:Beginners' Guide/Installation]]<br />
[[sr:Beginners' Guide/Installation]]<br />
[[zh-CN:Beginners' Guide/Installation]]<br />
{{Sugerencia|Esta es una parte del artículo multi-pagina «Guía para Principiantes». Si prefiere, puede leer el artículo completo '''[[Beginners' Guide_(Español)|aquí]]'''.}}<br />
</noinclude><br />
==Instalación==<br />
Ahora visualizará un prompt en una shell e iniciará sesión automáticamente como usuario root.<br />
<br />
===Cambiar la distribución del teclado===<br />
{{Sugerencia|Este paso es opcional para la mayoría de los usuarios. Solo es útil si tiene la intención de escribir en su propio idioma en uno de los archivos de configuración, si va a utilizar signos diacríticos para la contraseña wifi, o si desea recibir mensajes del sistema (por ejemplo, los posibles errores) en su propio idioma.}}<br />
<br />
Por defecto, la distribución del teclado viene configurada para {{ic|us}}. Si se tiene un teclado cuya distribución es distinta de [[Wikipedia:File:KB_United_States-NoAltGr.svg|US]] (por ejemplo [[wikipedia:es:Distribución_del_teclado|español o hispanoamericano]]), es posible cambiar la distribución para adecuarla a la suya, ejecutando el siguiente comando:<br />
<br />
# loadkeys ''layout''<br />
<br />
...donde ''layout'' hace referencia a la distribución del teclado, como {{ic|es}}, {{ic|uk}} o {{ic|be-latin1}}. Consulte [[KEYMAP (Español)|esto]] para un listado completo. <br />
<br />
El tipo de caracteres debe ser cambiado, porque la mayoría de lenguas usan más signos respecto a las 26 letras del [[Wikipedia:es:Alfabeto inglés|alfabeto inglés]]. De lo contrario, algunos caracteres extraños pueden aparecer como cuadrados blancos u otros símbolos. Tenga en cuenta que se distingue entre mayúsculas y minúsculas, por lo que escriba ''exactamente'' como lo ve:<br />
<br />
# setfont Lat2-Terminus16<br />
<br />
Por defecto, el idioma está establecido en inglés (EE.UU.). Si desea cambiar el idioma para el proceso de instalación ''(español, en este ejemplo)'', quite el signo {{ic|#}} delante del [http://www.greendesktiny.com/support/knowledgebase_detail.php?ref=EUH-483 locale] que desee ubicado en el archivo {{ic|/etc/locale.gen}}, junto con el inglés (EE.UU.). Por favor, elija la entrada {{ic|UTF-8}}.<br />
<br />
Presione {{Keypress|Ctrl+X}} para salir, y cuando se le pida guardar los cambios, pulse {{Keypress|Y}} y luego {{Keypress|Intro}} para utilizar el mismo nombre de archivo.<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
es_ES.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
# export LANG=es_ES.UTF-8<br />
<br />
Recuerde que {{Keypress|LAlt+LShift}} alterna la activación y desactivación de la distribución del teclado.<br />
<br />
===Establecer una conexión a Internet===<br />
<br />
{{Advertencia|udev ya no asigna nombres de interfaz de red siguiendo el esquema de nombres wlanX y ethX. Si viene de una distribución diferente o está reinstalando Arch y no repara en el formato del nombre de la nueva interfaz, por favor, no suponga que la interfaz inalámbrica se llama wlan0, o que la interfaz de cable se llama eth0. Se puede utilizar la utilidad «ip» para descubrir los nombres de las interfaces.}}<br />
<br />
Desde la liberación de systemd-197 en adelante, udev asigna ahora nombres a las interfaces de red de una manera predecible y estables, que se apartan del esquema anterior de nomenclatura incremental (wlan0, wlan1, etc.) Esto garantiza que los nombres de las interfaces permanezcan iguales en los reinicios, lo que resuelve el problema de la falta de previsibilidad de la asignación de los nombres de las interfaces de red. Para obtener más información acerca de por qué esto era necesario, lea http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames.<br />
<br />
El demonio de red {{ic|dhcpcd}} se inicia automáticamente en el arranque e intenta establecer una conexión cableada, si está disponible. Pruebe a ejecutar el ping de un sitio web para ver si se ha realizado correctamente. Y aprovechando que Google siempre está en activo...<br />
{{hc|# ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms}}<br />
<br />
Si se obtiene el error {{ic|ping: unknown host}}, será necesario configurar la red manualmente, como se indica a continuación.<br />
<br />
En su defecto, si se ha configurado correctamente, puede continuar en [[#Preparar_el_disco_duro|Preparar el disco duro]].<br />
<br />
==== Conexión por cable ====<br />
Siga este procedimiento si necesita configurar una conexión por cable a través de una dirección IP estática.<br />
<br />
En primer lugar, identifique el nombre de la interfaz ethernet.<br />
<br />
{{hc|# ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT <br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000<br />
link/ether 00:11:25:31:69:20 brd ff:ff:ff:ff:ff:ff<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000<br />
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
En este caso, la interfaz ethernet es enp2s0f0. Si no está seguro, la interfaz ethernet es probable que comience con la letra «e», y es improbable que sea «lo» o comience por la letra «w». También puede utilizar iwconfig para ver qué interfaces no son inalámbricas:<br />
<br />
{{hc|# iwconfig|2=<br />
enp2s0f0 no wireless extensions.<br />
wlp3s0 IEEE 802.11bgn ESSID:"NETGEAR97" <br />
Mode:Managed Frequency:2.427 GHz Access Point: 2C:B0:5D:9C:72:BF <br />
Bit Rate=65 Mb/s Tx-Power=16 dBm <br />
Retry long limit:7 RTS thr:off Fragment thr:off<br />
Power Management:on<br />
Link Quality=61/70 Signal level=-49 dBm <br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:430 Missed beacon:0<br />
lo no wireless extensions.}}<br />
<br />
En este ejemplo, ni enp2s0f0 ni el dispositivo loopback tienen extensiones inalámbricas, por tanto, enp2s0f0 es la interfaz ethernet.<br />
<br />
También es necesario conocer los siguientes valores:<br />
<br />
* La dirección IP estática.<br />
* Máscara de subred.<br />
* La dirección IP de la puerta de enlace (gateway).<br />
* Dirección IP del servidor (DNS).<br />
* Nombre del dominio (a menos que esté en una LAN local, en cuyo caso se puede marcar up).<br />
<br />
Active la interfaz Ethernet conectada (es decir,{{ic|enp2s0f0}}):<br />
<br />
# ip link set enp2s0f0 up<br />
<br />
Agregue la dirección:<br />
<br />
# ip addr add <dirección ip>/<máscarasubred> dev <interfaz><br />
<br />
Por ejemplo:<br />
<br />
# ip addr add 192.168.1.2/24 dev enp2s0f0<br />
<br />
Para obtener más opciones, ejecute {{ic|man ip}}.<br />
<br />
Añada del mismo modo su gateway, sustituyendo <dirección ip> por la dirección IP de su gateway:<br />
<br />
# ip route add default via <dirección ip><br />
<br />
Por ejemplo:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
Edite el archivo {{ic|resolv.conf}}, incluyendo el nombre de su dirección IP del servidor (DNS) y el nombre de su dominio local:<br />
<br />
{{hc|# nano /etc/resolv.conf|<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com}}<br />
<br />
{{Nota|Actualmente, es posible añadir un máximo de 3 líneas para el {{ic|nameserver}}.}}<br />
<br />
Ahora se debe tener una conexión de red funcional. En caso contrario, compruebe con detalle la página [[Configuring Network (Español)|Configuring Network]].<br />
<br />
==== Conexión por wifi ====<br />
Siga este procedimiento si necesita conectividad inalámbrica (WiFi) durante el proceso de instalación.<br />
<br />
Si viene desde otra distribución, o si esta es la primera vez que instala Arch Linux después del abandono del antiguo esquema de nomenclatura de las interfaces de red, es posible que se sorprenda al saber que la primera interfaz ya no se llama «wlan0». De hecho, ninguna de las interfaces usarán a partir de ahora automáticamente el prefijo «wlan». Que no cunda el pánico, simplemente debe teclear {{ic|iwconfig}} para descubrir el nombre de su interfaz inalámbrica.<br />
<br />
Los servicios y controladores inalámbricos están ahora disponibles en el entorno live creado por el soporte de instalación. Un buen conocimiento de su hardware inalámbrico tendrá una importancia clave para la configuración correcta. <br />
Tenga en cuenta que el siguiente procedimiento rápido, ''ejecutado en este punto de la instalación'', inicializa el hardware inalámbrico a los solos efectos de su uso en el entorno live de la instalación. Estos pasos (o cualquier otra forma de gestión inalámbrica) '''deberán repetirse desde el nuevo sistema instalado después de arrancar el mismo'''.<br />
<br />
También tenga en cuenta que estos pasos son opcionales, si la conectividad inalámbrica no es necesaria en este momento de la instalación, óbviela, ya que la funcionalidad inalámbrica siempre puede establecerse más adelante.<br />
<br />
{{Nota|Seguiremos el siguiente ejemplo donde {{ic|wlp3s0}} será la interfaz de red y {{ic|linksys}} será el nombre ESSID. Recuerde cambiar estos valores de acuerdo a su configuración.}}<br />
<br />
El procedimiento básico será:<br />
* Identificar la interfaz inalámbrica:<br />
{{bc|<nowiki># lspci | grep -i net</nowiki>}}<br />
O, si se utiliza un adaptador USB:<br />
{{bc|<nowiki># lsusb </nowiki>}}<br />
* Asegúrese de que udev ha cargado el controlador y que el controlador ha creado una interfaz wireless usable por el kernel con {{ic|iwconfig}}:<br />
<br />
{{Nota|Si no ve una salida similar a la de abajo, entonces el controlador inalámbrico no se ha cargado. En ese caso, debe cargar el controlador manualmente. Por favor, consulte la página [[Wireless Setup (Español)|Wireless Setup]] para obtener información más detallada.}}<br />
<br />
{{hc|# iwconfig|2=<br />
enp2s0f0 no wireless extensions.<br />
wlp3s0 IEEE 802.11bgn ESSID:"NETGEAR97" <br />
Mode:Managed Frequency:2.427 GHz Access Point: 2C:B0:5D:9C:72:BF <br />
Bit Rate=65 Mb/s Tx-Power=16 dBm <br />
Retry long limit:7 RTS thr:off Fragment thr:off<br />
Power Management:on<br />
Link Quality=61/70 Signal level=-49 dBm <br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:430 Missed beacon:0<br />
lo no wireless extensions.}}<br />
<br />
En este ejemplo, {{ic|wlp3s0}} es la interfaz inalámbrica disponible.<br />
<br />
* Abra la interfaz con:<br />
{{bc|# ip link set wlp3s0 up}}<br />
<br />
Un pequeño porcentaje de chipsets inalámbricos también requieren firmware, además del controlador correspondiente. Si el chipset inalámbrico requiere firmware, son susceptibles de recibir este mensaje de error cuando intenten abrir el dispositivo de red:<br />
<br />
{{hc|# ip link set wlp3s0 up|SIOCSIFFLAGS: No such file or directory}}<br />
<br />
Si no está seguro, invoque {{ic|dmesg}} para consultar el registro del kernel y ver si el chipset inalámbrico hace una solicitud de firmware.<br />
<br />
He aquí un ejemplo de salida de un chipset Intel que requiere y ha solicitado un firmware al kernel en el arranque:<br />
<br />
{{hc|<nowiki>$ dmesg | grep firmware</nowiki>|firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
Si no hay salida, se puede concluir que el chipset inalámbrico del sistema no requiere firmware.<br />
<br />
{{Advertencia|Los paquetes de firmware de los chipset para el wireless (para las tarjetas que lo requieran) están pre-instalados en {{ic|/usr/lib/firmware}} del entorno live (en el CD o soporte USB) '''¡por lo que dichos paquetes deben ser explícitamente instalado en su sistema actual para proporcionar funcionalidad inalámbrica después de reiniciar la instalación del sistema!''' La instalación de los paquetes se describe más adelante en esta guía. ¡Asegúrese de instalar, tanto su módulo inalámbrico como el firmware, antes de reiniciar! Véase [[Wireless Setup (Español)|Wireless Setup]] si no está seguro acerca de la exigencia de instalación del firmware correspondiente para su chipset particular.}}<br />
<br />
Seguidamente, utilice wifi-menu proporcionado por el paquete {{pkg|netcfg}} para conectarse a una red:<br />
<br />
# wifi-menu wlp3s0<br />
<br />
{{Advertencia|De momento, wifi-menu de netcfg, cuando se ejecuta sin argumentos, buscará «wlan0». Ejecute wifi-menu colocando el nombre de su interfaz como argumento para usarlo.}}<br />
<br />
Ahora se debe tener una conexión de red funcional. En caso contrario, repase detalladamente la página [[Wireless_Setup_(Español)|Wireless Setup]].<br />
<br />
==== xDSL (PPPoE), modem analógico o ISDN ====<br />
Si se dispone de un router en modalidad bridge, ejecute:<br />
<br />
# pppoe-setup<br />
<br />
* Escriba el nombre de usuario proporcionado por su ISP.<br />
* Pulse {{keypress|Intro}} para "eth0"<br />
* Pulse {{keypress|Intro}} para "no" , de modo que se mantenga de forma permanente.<br />
* Seleccione {{ic|server}} (ya que este suele ser el caso).<br />
* Pulse {{keypress|1}} para un firewall.<br />
* Escriba la contraseña proporcionada por su ISP.<br />
* Pulse {{keypress|Y}} para terminar.<br />
<br />
Para utilizar esta configuración y conectarse al proveedor de servicios de Internet (ISP), ejecute:<br />
<br />
# pppoe-start<br />
<br />
Podría ser también necesario configurar su archivo {{ic|resolv.conf}}:<br />
<br />
# echo nameserver 8.8.8.8 > /etc/resolv.conf<br />
<br />
Si se dispone de un modem (dial-up), o de una conexión ISDN, consulte la pagina [[Direct Modem Connection]].<br />
<br />
==== Redes detrás de un servidor proxy ====<br />
Si está detrás de un servidor proxy, es necesario exportar las variables del entorno {{ic|http_proxy}} y {{ic|ftp_proxy}}. '''[[Proxy|Lea esto]]''' para más información.<br />
<br />
===Preparar el disco duro===<br />
{{Advertencia|El particionado de discos duros puede destruir los datos. Considérese '''seriamente''' advertido e, igualmente, se le sugiere que haga copias de seguridad de los datos sensibles antes de continuar.}}<br />
<br />
A los principiantes se les anima a utilizar un programa de particionado gráfico. [http://gparted.sourceforge.net/download.php GParted] es un buen ejemplo, y es [http://gparted.sourceforge.net/livecd.php proporcionado como un «live» CD]. Estas herramientas también son incluidas en los CD live de muchas distribuciones Linux como [[Wikipedia:es:Ubuntu|Ubuntu]] y [[Wikipedia:es:Linux Mint|Linux Mint]]. Una unidad debe ser, antes de nada, [[partitioning (Español)|particionada]] y, posteriormente, las particiones deben ser formateadas con un [[File Systems (Español)|sistema de archivos]] antes de reiniciar. <br />
<br />
Es posible crear un archivo de intercambio en cualquier momento después de la instalación, así que no hay necesidad de decidir ahora sobre el tamaño de swap. Véase [[Swap (Español)|Swap]] para obtener más detalles por si desea crear una partición swap en esta fase (pero tenga en cuenta que es mucho más fácil cambiar el tamaño de un archivo que el de una partición).<br />
<br />
Si ya se han realizado estos procesos, proceda a [[#Montar las particiones|Montar las particiones]].<br />
<br />
En caso contrario, lea el siguiente ejemplo.<br />
<br />
==== Ejemplo ====<br />
El soporte de instalación de Arch Linux incluye las siguientes herramientas de particionado:{{ic|fdisk}}, {{ic|gdisk}}, {{ic|cfdisk}}, {{ic|cgdisk}}, {{ic|parted}}.<br />
<br />
{{Box BLUE|Notas relativas al arranque de [[Unified Extensible Firmware Interface (Español)|UEFI]]:|<br />
* Si se dispone de una placa base UEFI, tendrá que crear una partición extra para ubicar [[Unified_Extensible_Firmware_Interface_(Español)#Crear_una_.C2.ABUEFI_System_Partition.C2.BB_en_Linux|UEFI System partition]].<br />
* Es recomendable usar siempre GPT para arrancar UEFI, ya que algunos firmwares UEFI no permiten arrancar UEFI-MBR.}}<br />
<br />
{{Box BLUE|Notas relativas a la partición [[GUID Partition Table (Español)|GPT]]:|<br />
* Si no tiene un arranque dual con Windows, entonces es recomendable utilizar GPT en vez de MBR. Lea [[GUID Partition Table (Español)|GPT]] para conocer un listado de sus ventajas.<br />
* Si tiene una placa base BIOS (o si se tiene intención de iniciar el ordenador en modalidad de compatibilidad BIOS) y desea configurar GRUB en un disco con particionado GPT, tendrá que crear una partición de inicio de la BIOS, «[[GRUB2 (Español)#Instrucciones específicas para GPT|BIOS Boot Partition]]», de 2 MiB. Syslinux no la necesita.<br />
* Algunos sistemas BIOS pueden tener problemas con GPT. Consulte http://mjg59.dreamwidth.org/8035.html y http://rodsbooks.com/gdisk/bios.html para mayor información y posibles soluciones.}}<br />
<br />
{{Nota|Si se va a instalar sobre una memoria USB flash, véase [[Installing Arch Linux on a USB key (Español)|Installing Arch Linux on a USB key]].}}<br />
<br />
El sistema de ejemplo contendrá una partición root de 15 GB y una partición [[Partitioning#/home|home]] para el espacio restante. Elija entre [[Master Boot Record (Español)|MBR]] o [[GUID Partition Table (Español)|GPT]]. ¡No elija los dos!<br />
<br />
Se debe enfatizar que el particionado es una elección personal y que este ejemplo es solo para fines ilustrativos. Véase [[Partitioning (Español)|Partitioning]]. <br />
<br />
{| class="wikitable"<br />
|-<br />
| rowspan="2" | '''MBR'''<br />
| rowspan="2"| {{ic|cfdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Seleccione New (o presione {{Keypress|N}}) – presione {{Keypress|Intro}} para seleccionar Primary – escriba el tamaño en «15360» – presione {{Keypress|Intro}} para seguir – presione {{Keypress|Intro}} para hacerla Bootable.<br />
|-<br />
| <br />
'''Home:'''<br />
<br />
* Pulse la flecha hacia abajo para desplazarse a la zona de espacio libre.<br />
* Seleccione New (o presione {{Keypress|N}}) – presione {{Keypress|Intro}} para elegir Primary – presione {{Keypress|Intro}} para utilizar el resto de la unidad (o puede introducir el tamaño deseado).<br />
|-<br />
| rowspan="2" | '''GPT'''<br />
| rowspan="2"| {{ic|cgdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Seleccione New (o presione {{Keypress|N}}) – {{Keypress|Intro}} para establecer el primer sector (2048) – escriba «15360M» – {{Keypress|Intro}} para introducir el código hexadecimal predeterminado (8300) – {{Keypress|Intro}} para dejar el nombre de la partición en blanco.<br />
|-<br />
| '''Home:'''<br />
<br />
* Pulse la flecha hacia abajo un par de veces para ir a la zona de espacio libre.<br />
* Seleccione ''New'' (o presione {{Keypress|N}}) – {{Keypress|Intro}} para establecer el primer sector – {{Keypress|Intro}} para utilizar el resto de la unidad (o puede introducir el tamaño deseado , por ejemplo «30G»)) – {{Keypress|Intro}} para introducir el código hexadecimal predeterminado (8300) – por último, {{Keypress|Intro}} para dejar el nombre de la partición en blanco.<br />
|}<br />
<br />
Si elige MBR, así es como se debería ver:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-----------------------------------------------------------------------<br />
sda1 Boot Primary Linux 15360<br />
sda2 Primary Linux 133000*<br />
<br />
Si elige GPT, así es como se debería ver:<br />
<br />
Part. # Size Partition Type Partition Name<br />
----------------------------------------------------------------<br />
1007.0 KiB free space<br />
1 15.0 GiB Linux filesystem<br />
2 123.45 GiB Linux filesystem<br />
<br />
Verifique y asegúrese de que está satisfecho con los tamaños de las particiones, así como con el diseño de la tabla de particiones antes de continuar.<br />
<br />
Si desea volver a empezar, solo tiene que seleccionar Quit (o presonar {{Keypress|Q}}) para salir sin guardar los cambios y reiniciar cfdisk (o cgdisk).<br />
<br />
Si está conforme, seleccione Write (o presione {{Keypress|Shift+W}}) para finalizar y escribir la tabla de particiones en el disco. Escriba «yes» y seleccione Quit (o presione {{Keypress|Q}}) para salir sin hacer más cambios.<br />
<br />
La simple partición no es suficiente; las particiones también necesitan un [[File Systems (Español)|sistema de archivos]]. Para formatear las particiones con un sistema de archivos ext4:<br />
<br />
{{Advertencia|Compruebe bien que realmente son {{ic|/dev/sda1}} y {{ic|/dev/sda2}} las particiones que desea formatear.}}<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda2<br />
<br />
Si ha hecho una partición dedicada a swap (código 82) no se olvide de darle formato con:<br />
<br />
# mkswap /dev/sda''X''<br />
# swapon /dev/sda''X''<br />
<br />
===Montar las particiones===<br />
Cada partición se identifica con un sufijo numérico. Por ejemplo, {{ic|sda1}} especifica la primera partición del primer disco, mientras que {{ic|sda}} indica el disco entero.<br />
<br />
Para ver el esquema actual de particiones:<br />
<br />
# lsblk /dev/sda<br />
<br />
{{Nota|No instale más de una partición en el mismo directorio. Y preste atención, porque el orden de montaje es importante.}}<br />
<br />
En primer lugar, monte la partición root en {{ic|/mnt}}. Siguiendo el ejemplo de arriba (la suya puede ser diferente), sería:<br />
<br />
# mount /dev/sda1 /mnt<br />
<br />
A continuación, monte la partición {{ic|/home}} y cualquier otra partición separada ({{ic|/boot}}, {{ic|/var}}, etc.), si se tuviera:<br />
<br />
# mkdir /mnt/home<br />
# mount /dev/sda2 /mnt/home<br />
<br />
En caso de tener una placa base UEFI, monte la partición UEFI:<br />
<br />
# mkdir /mnt/boot/efi<br />
# mount /dev/sda''X'' /mnt/boot/efi<br />
<br />
===Seleccionar un mirror===<br />
Antes de continuar, es posible que desee modificar el archivo {{ic|mirrorlist}} y colocar el mirror preferido encima de los demás. Una copia de este archivo se instalará en su nuevo sistema por {{ic|pacstrap}} de modo que conviene hacerlo bien.<br />
<br />
{{hc|# nano /etc/pacman.d/mirrorlist|<br />
##<br />
## Arch Linux repository mirrorlist<br />
## Sorted by mirror score from mirror status page<br />
## Generated on 2012-MM-DD<br />
##<br />
<br />
<nowiki>Server = http://mirror.example.xyz/archlinux/$repo/os/$arch</nowiki><br />
...}}<br />
<br />
* Con {{Keypress|Alt+6}} copia una línea {{ic|Server}}.<br />
* Con {{Keypress|RePág}} se desplaza hacia arriba.<br />
* Con {{Keypress|Ctrl+U}} copia la línea al inicio de la lista.<br />
* Con {{Keypress|Ctrl+X}} se sale, y cuando le pida que guarde los cambios, presione {{Keypress|Y}} e {{Keypress|Intro}} para utilizar el mismo nombre de archivo.<br />
<br />
Si lo desea, puede hacer que el mirror seleccionado sea el ''único'' disposible y eliminar todos los demás (utilizando {{Keypress|Ctrl+K}}), pero, por lo general, es una buena práctica tener varios, para el caso de que el primero se desconecte.<br />
<br />
{{Sugerencia|<br />
* Utilice [https://www.archlinux.org/mirrorlist/ Mirrorlist Generator] para obtener una lista actualizada de su país. Los mirrors HTTP son más rápidos que los FTP, a causa de algo denominado [[Wikipedia:Keepalive|keepalive]]. Con FTP, pacman tiene que enviar una señal cada vez que se descarga un paquete, lo que causa una breve pausa. Para conocer otras formas de generar una lista de mirrors, consulte [[Mirrors_(Español)#Clasificar_y_seleccionar_los_mirrors|clasificar mirrors]] y [[Reflector (Español)|Reflector]].<br />
* [https://archlinux.org/mirrors/status/ Arch Linux MirrorStatus] informa de varios aspectos sobre los mirrors, como los problemas de red con mirrors, problemas de recolección de datos, últimos mirrors bien sincronizados, etc.}}<br />
<br />
{{Nota|<br />
* Siempre que en el futuro se cambie su lista de mirrors, recuerde forzar a pacman a actualizar todas las listas de paquetes con {{ic|pacman-Syy}}. Esto se considera una buena práctica y evita posibles problemas. Véase [[Mirrors (Español)|Mirrors]] para más información.<br />
* Si está utilizando un medio de instalación antiguo, su mirrorlist podría estar desfasado, lo que podría dar lugar a problemas al actualizar Arch Linux (véase {{Bug|22510}}). Por lo tanto, se aconseja obtener una versión actualizada de los mirrors tal como se describe a continuación.<br />
* Algunos temas han sido reportados en los [https://bbs.archlinux.org/ forums de Arch Linux] en relación con los problemas de red que impiden a pacman la actualización/sincronización de los repositorios (véase [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] y [https://bbs.archlinux.org/viewtopic.php?id&#61;65728]). Al instalar Arch Linux de forma nativa, estos problemas se han resuelto sustituyendo la variable predifinida para la descarga de los paquetes de pacman con otra alternativa (véase [[Improve Pacman Performance (Español)|Improve Pacman Performance]] para más detalles). Cuando se instala Arch Linux como un sistema operativo invitado en [[VirtualBox]], esta cuestión también ha sido abordada por el uso de la «interfaz del Host» en lugar de «NAT» en las propiedades de la máquina virtual.}}<br />
<br />
===Instalar el sistema base===<br />
El sistema base se instalará usando el script [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap]. <br />
<br />
La opción {{ic|-i}} puede ser omitida si se desea instalar todos los paquetes del grupo ''base'' y ''base-devel'' sin pedir confirmación.<br />
<br />
# pacstrap -i /mnt base base-devel<br />
<br />
{{Nota|Si pacman no puede verificar los paquetes, compruebe la hora del sistema con {{ic|cal}}. Si la fecha del sistema no es válida (por ejemplo, se muestra el año 2010), las claves de firma se considerarán caducadas (o no válidas), el control de la firma sobre los paquetes fallará y la instalación será interrumpida. Asegúrese de corregir la hora del sistema, ya sea de forma manual o con el cliente {{Pkg|ntp}}, y vuelva a intentarlo, ejecutando la orden pacstrap. Consulte la página [[Time]] para obtener más información sobre la corrección de la hora del sistema.}}<br />
{{Nota|Si pacman se queja de firmas no válidas durante la fase pacstrap (''«error: failed to commit transaction (invalid or corrupted package)»'') ejecute la orden siguiente.}}<br />
# pacman-key --init && pacman-key --populate archlinux <br />
<br />
* {{Grp|base}}: Contiene los paquetes de software de los repositorios [core] que proporcionan el entorno de la base mínima.<br />
* {{Grp|base-devel}}: Contiene paquetes y herramientas adicionales de [core] como {{ic|make}} y {{ic|automake}}. La mayoría de los usuarios principiantes deben optar por instalarlos, ya que probablemente serán necesarios para ampliar su sistema nuevo. El grupo ''base-devel'' es necesario para instalar software desde [[Arch User Repository (Español)|AUR]].<br />
<br />
Esto le dará un sistema básico de Arch. Otros paquetes se pueden instalar más tarde usando [[pacman (Español)|pacman]].<br />
<br />
=== Generar el archivo fstab ===<br />
Genere un archivo [[fstab (Español)|fstab]] con la siguiente orden. Serán utilizadas las UUID porque tienen ciertas ventajas (consulte [[Fstab_(Español)#Identificaci.C3.B3n_de_los_sistemas_de_archivos|identificar el sistema de archivos]]). Si en su lugar, usted prefiere usar las etiquetas (''«labels»''), sustituya la opción {{ic|-U}} por {{ic|-L}}.<br />
<br />
{{Nota|Si encuentra errores de funcionamiento en el proceso de instalación después de ejecutar genfstab, '''no''' podrá volver a ejecutar genfstab de nuevo, simplemente edite el archivo fstab.}}<br />
<br />
# genfstab -U -p /mnt | sed 's/rw,relatime,data=ordered/defaults,relatime/' >> /mnt/etc/fstab<br />
# nano /mnt/etc/fstab<br />
<br />
{{Nota|Si la imagen de instalación descargada es posterior a enero de 2013, basta con que ejecute la orden siguiente en lugar de la anterior:<br />
<br />
# genfstab -U -p /mnt >> /mnt/etc/fstab<br />
# nano /mnt/etc/fstab<br />
}}<br />
<br />
{{Advertencia|{{ic|genfstab}} no es infalible, es por ello que se aconseja que compruebe el archivo fstab una vez generado. Si se ha creado una inicial partición del sistema EFI, entonces genfstab habrá añadido opciones incorrectamente a la partición del sistema EFI. En efecto, dichas opciones *evitan* que el ordenador arranque desde ese dispositivo. Use su editor de texto favorito y elimine todas las opciones para la partición EFI, salvo {{ic|noatime}}. Para las otras particiones que usa, asegúrese de reemplazar {{ic|1="codepage=cp437"}} por {{ic|1="codepage=437"}} o, de lo contrario, cuando reinicie después, cualquier montaje con esta opción arrojará error y detendrá systemd, y colocará al sistema en modo de recuperación. Esto debería ser corregido por linux 3.8}}<br />
<br />
Algunas consideraciones:<br />
<br />
* Solo la partición root ({{ic|/}}) necesita {{ic|1}} para el último campo. Todo lo demás debe tener {{ic|2}} o {{ic|0}} (consulte [[Fstab_(Español)#Definiciones_de_los_campos|definiciones de los campos de fstab]]).<br />
<br />
=== Efectuar Chroot y configurar el sistema base=== <br />
A continuación, necesita entrar mediante [[chroot]] en su recién instalado sistema:<br />
<br />
# arch-chroot /mnt<br />
<br />
{{Nota|Utilice la orden {{ic|arch-chroot /mnt /bin/bash}} para efectuar chroot en una shell de bash.}}<br />
<br />
En esta fase de la instalación, deberá configurar los archivos de configuración principales de su sistema base de Arch Linux. Estos se pueden crear si no existen, o, si existen, editarlos si desea cambiar los valores predeterminados.<br />
<br />
Seguir de cerca y comprender estos pasos es de vital importancia para garantizar un sistema bien configurado.<br />
<br />
==== Configurar el idioma ====<br />
Los locales (configuración del idioma) son utilizados por '''glibc''' y otros programas locale-aware o bibliotecas para procesamiento de texto, para mostrar correctamente los valores monetarios regionales, la hora y los formatos de fecha, singularidades alfabéticas y otras normas específicas de configuración regional.<br />
<br />
Hay dos archivos que necesitan editarse: {{ic|locale.gen}} y {{ic|locale.conf}}.<br />
<br />
* El archivo {{ic|locale.gen}} está vacio por defecto (es decir, todas las entradas comentadas y, por lo tanto, inactivas) y usted necesita eliminar el signo almohadilla {{ic|#}} que figura delante de la línea(s) que desee activar. Puede descomentar más de una línea, a parte del inglés (US), siempre y cuando las líneas seleccionadas contengan la codificación {{ic|UTF-8}}:<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
es_ES.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
<br />
Este proceso se ejecutará en cada actualización de '''glibc''', regenerando todos los locales incluidos en {{ic|/etc/locale.gen}}.<br />
<br />
* El archivo {{ic|locale.conf}} no existe por defecto. Ajustando solo el valor {{ic|LANG}} debería ser suficiente. Actuará como valor predeterminado para todas las otras variables.<br />
<br />
# echo LANG=en_US.UTF-8 > /etc/locale.conf<br />
# export LANG=en_US.UTF-8<br />
<br />
{{Nota|Si establece un lenguaje distinto del inglés en el inicio de la instalación, las órdenes de arriba quedarían así para el idioma español:<br />
# echo LANG<nowiki>=</nowiki>es_ES.UTF-8 > /etc/locale.conf<br />
# export LANG<nowiki>=</nowiki>es_ES.UTF-8<br />
}}<br />
<br />
Para utilizar otra variable {{ic|LC_*}}, ejecute primero {{ic|locale}} para ver las opciones disponibles. Un ejemplo avanzado se puede encontrar [[Locale (Español)#Configuración del locale de todo el sistema|aquí]].<br />
<br />
{{Advertencia|El uso de la variable {{ic|LC_ALL}} está desaconsejado ya que anula todas las demás.}}<br />
<br />
==== Distribución del teclado y tipo de letra de la consola ====<br />
Si se ha establecido una distribución del teclado [[#Cambiar la distribución del teclado|al principio]] del proceso de instalación, cárguelo ahora también, por que el entorno ha cambiado. Por ejemplo:<br />
<br />
# loadkeys ''es''<br />
# setfont Lat2-Terminus16<br />
<br />
Para que estén disponibles estas modificaciones de forma permanente al reiniciar el sistema, edite el archivo {{ic|vconsole.conf}}:<br />
<br />
{{hc|# nano /etc/vconsole.conf|2=<br />
KEYMAP=es<br />
FONT=Lat2-Terminus16}}<br />
<br />
* {{ic|KEYMAP}} – Tenga en cuenta que esta opción solo es válida para las TTY, no para todos los gestores de ventanas o Xorg.<br />
<br />
* {{ic|FONT}} – Las fuentes de letras disponibles alternativas para la consola residen en {{ic|/usr/share/kbd/consolefonts/}}. El valor por defecto (en blanco) es seguro, pero algunos caracteres extraños pueden aparecer como cuadrados blancos u otros símbolos. Se recomienda que lo cambie a {{ic|Lat2-Terminus16}}, porque de acuerdo con {{ic|/usr/share/kbd/consolefonts/README.Lat2-Terminus16}}, se pretende apoyar «cerca de 110 grupos de idiomas».<br />
<br />
* {{ic|FONT_MAP}} (opcional) – Define la distribución del teclado para la consola a cargar en el arranque. Lea {{ic|man setfont}}. Quitarlo o dejarlo en blanco es seguro.<br />
<br />
Consulte [[Fonts#Console_fonts|Fuentes de Consola]] y {{ic|man vconsole.conf}} para más información.<br />
<br />
==== Zona horaria ====<br />
Las zonas horarias disponibles (zonas y subzonas) se pueden encontrar en el directorio {{ic|/usr/share/zoneinfo/<Zona>/<SubZona>}}.<br />
<br />
Para poder visualizar las <Zonas> disponibles, compruebe la carpeta {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Del mismo modo, puede comprobar el contenido de las carpetas relativas a una <SubZona>:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Cree un enlace simbólico de {{ic|/etc/localtime}} al archivo de su zona {{ic|/usr/share/zoneinfo/<Zona>/<SubZona>}} usando este comando:<br />
<br />
# ln -s /usr/share/zoneinfo/<Zona>/<SubZona> /etc/localtime<br />
<br />
'''Ejemplo:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Madrid /etc/localtime<br />
<br />
==== Reloj del hardware ====<br />
Ajuste el modo del reloj del hardware de manera uniforme entre sus sistemas operativos. De lo contrario, puede sobrescribirse el reloj del hardware y provocar desfases horarios.<br />
<br />
Puede generar {{ic|/etc/adjtime}} automáticamente mediante uno de los siguientes comandos:<br />
<br />
* '''UTC''' (recomendado)<br />
<br />
: {{Nota|Usar [[Wikipedia:es:Tiempo_universal_coordinado|UTC]] para el reloj del hardware no significa que el software mostrará la hora en UTC.}}<br />
<br />
: {{bc|# hwclock --systohc --utc}}<br />
Para sincronizar el horario «UTC» a través de Internet, véase [[Network Time Protocol daemon (Español)|NTPd]].<br />
* '''localtime''' (desaconsejado; usado por defecto en Windows)<br />
<br />
: {{Advertencia|El uso de ''localtime'' puede conducir a varios errores conocidos e irreparables. Sin embargo, no hay planes de momento para retirar el apoyo a ''localtime''.}}<br />
<br />
: {{bc|# hwclock --systohc --localtime}}<br />
<br />
Si usted tiene (o planeado tener) una configuración de arranque dual con Windows:<br />
<br />
* Recomendado: Ajuste Arch Linux y Windows para usar UTC. Es necesaria una solución rápida del [[Time_(Español)#UTC_en_Windows|registro de Windows]]. Además, asegúrese de evitar que Windows sincronice la hora con Internet, ya que hará que use de nuevo ''localtime'' para el reloj del hardware.<br />
<br />
* No recomendado: Configure ''localtime'' para Arch Linux y deshabilite los servicios relacionados con el horario, como [[Network Time Protocol daemon (Español)|NTPd]]. Esto permite que Windows se encargue de las correcciones del reloj del hardware y tendrá que acordarse de arrancar Windows, almenos, dos veces al año (en primavera y otoño) cuando [[Wikipedia:es:Horario_de_verano|DST]] elabora la hora legal. Por tanto, por favor, no pregunte en los foros por problemas de horario, si tiene una hora adelantada o atrasada, cuando se pasa mucho tiempo sin iniciar windows.<br />
<br />
==== Módulos del Kernel ====<br />
{{Sugerencia|Este es solo un ejemplo, no es necesario configurarlo. Todos los módulos necesarios se cargan automáticamente por udev, por lo que rara vez tendrá que añadir algo aquí. Solo hay que añadir los módulos que se saben ausentes.}}<br />
<br />
Para cargar los módulos del kernel durante el arranque, coloque el archivo con la extensión {{ic|*.conf}} en la carpeta {{ic|/etc/modules-load.d/}}, con un nombre de archivo que haga referencia al programa que se usa.<br />
<br />
{{hc|# nano /etc/modules-load.d/virtio-net.conf|<br />
# Carga 'virtio-net.ko' al arranque.<br />
<br />
virtio-net}}<br />
<br />
Si hay más módulos a cargar listados en un archivo {{ic|*.conf}}, los nombres de los módulos deben venir separados por saltos de líneas. Un buen ejemplo es [[VirtualBox#Arch_Linux_guests|VirtualBox Guest Additions]].<br />
<br />
Las líneas vacías y las líneas que empiezan por {{ic|#}} o {{ic|;}} se ignoran.<br />
<br />
==== Nombre del equipo====<br />
Añada el [[wikipedia:es:Nombre_de_equipo|hostname]] (''«nombre del equipo»'') según su preferencia (por ejemplo, ''arch''). <br />
<br />
# echo ''elnombredemiequipo'' > /etc/hostname<br />
<br />
{{Nota|Ya no es necesario modificar el archivo {{ic|/etc/hosts}}. El paquete {{Pkg|nss-myhostname}} proporciona la resolución de los nombres de host y se instala en todos los sistemas de forma predeterminada.}}<br />
<br />
=== Configurar la red ===<br />
Es necesario configurar la red de nuevo, pero esta vez para su entorno recién instalado. El procedimiento y los requisitos son muy similares a la descrita [[#Establecer una conexión de red|arriba]], excepto que ahora la configuración se va a hacer permanente y se va a ejecutar automáticamente en cada arranque.<br />
<br />
{{Nota|Para obtener más información sobre configuración de red, visite [[Configuring Network (Español)|Configuring Network]] y [[Wireless Setup (Español)|Wireless Setup]].}}<br />
<br />
==== Red cableada ====<br />
<br />
; IP Dinámica<br />
<br />
Si solo utiliza una única conexión por cable de red, no es necesario un servicio de gestión de red y puede simplemente habilitar el servicio {{ic|dhcpcd}}. <br />
Donde <interfaz> es la interfaz cableada:<br />
<br />
# systemctl enable dhcpcd@<interfaz>.service<br />
<br />
Como alternativa, puede usar el servicio {{ic|net-auto-wired}} de {{Pkg|netcfg}}, que gestiona correctamente conexiones dinámicas a nuevas redes.<br />
<br />
Instale {{Pkg|ifplugd}}, requerido por {{ic|net-auto-wired}}:<br />
<br />
# pacman -S ifplugd<br />
<br />
Configure el perfil y active el servicio dhcp {{ic|net-auto-wired}}:<br />
<br />
# cd /etc/network.d<br />
# ln -s examples/ethernet-dhcp .<br />
# systemctl enable net-auto-wired.service<br />
<br />
; IP Estática<br />
<br />
Instale el paquete {{Pkg|ifplugd}}, que es necesario para el servicio {{ic|net-auto-wired}}:<br />
<br />
# pacman -S ifplugd<br />
<br />
Copie el perfil de muestra del archivo {{ic|/etc/network.d/examples}} a {{ic|/etc/network.d}}:<br />
<br />
# cd /etc/network.d<br />
# cp examples/ethernet-static .<br />
<br />
Edite el perfil para adaptarlo a su caso:<br />
<br />
# nano ethernet-static<br />
<br />
Edite {{ic|/etc/conf.d/netcfg}} y modifique el nombre de la interfaz de red, ya que, lo más probable, es que no sea eth0. Puede encontrar más información sobre las nomenclaturas de las interfaces de red en la advertencia anterior.<br />
<br />
{{ic|<nowiki>WIRED_INTERFACE="<interfaz>"</nowiki>}}<br />
<br />
Active el servicio {{ic|net-auto-wired}}:<br />
<br />
# systemctl enable net-auto-wired.service<br />
<br />
==== Redes inalámbricas ====<br />
Se tendrán que instalar otros programas para configurar y gestionar perfiles de red inalámbrica, como [[netcfg (Español)|netcfg]].<br />
<br />
[[NetworkManager (Español)|NetworkManager]] y [[Wicd (Español)|Wicd]] son otras alternativas populares.<br />
<br />
* Instale los paquetes requeridos:<br />
<br />
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog<br />
<br />
Si su adaptador inalámbrico requiere un firmware (como se describe en el apartado [[#Wireless|Establecer una conexión de red]] y también [[Wireless Setup (Español)#Controladores y Firmware|aquí]]), instale el paquete que contiene el firmware. Por ejemplo:<br />
<br />
# pacman -S zd1211-firmware<br />
<br />
* Conéctese a la red con {{ic|wifi-menu}} (opcionalmente compruebe el nombre de interfaz con {{ic|ip link}}, pero, por lo general, es {{ic|wlan0}}), lo que generará un archivo con un perfil en {{ic|/etc/network.d}} que contiene el nombre del SSID. También hay plantillas disponibles en {{ic|/etc/network.d/examples/}} para su configuración manual.<br />
<br />
# wifi-menu <interfaz><br />
<br />
{{Advertencia|Si está usando wifi-menú, la anterior operación se debe hacer *después* del reinicio, cuando ya haya salido del entorno chroot. El proceso generado por esta orden entrará en conflicto con el ejecutado fuera del entorno chroot. Como alternativa, se podría configurar un perfil de red manualmente utilizando las plantillas antes mencionadas, a fin de que no tenga que preocuparse de usar wifi-menú en absoluto.}}<br />
<br />
* Active el servicio {{ic|net-auto-wireless}}, que se conectará a redes conocidas y controlará correctamente la itinerancia y desconexiones:<br />
<br />
# systemctl enable net-auto-wireless.service<br />
<br />
{{Nota|[[Netcfg (Español)|Netcfg]] también proporciona {{ic|net-auto-wired}}, que puede ser utilizado conjuntamente con {{ic|net-auto-wireless}}.}}<br />
<br />
* Asegúrese de que la interfaz inalámbrica correcta (normalmente {{ic|wlan0}}) se encuentra ajustada en {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|# nano /etc/conf.d/netcfg|2=<br />
WIRELESS_INTERFACE="wlp3s0"}}<br />
<br />
También es posible definir una lista de perfiles de red que deben ser conectadas de forma automática, utilizando la variable {{ic|AUTO_PROFILES}} en {{ic|/etc/conf.d/netcfg}}. Si la variable {{ic|AUTO_PROFILES}} no está establecida, todas las redes inalámbricas conocidas serán probadas.<br />
<br />
==== xDSL (PPPoE),modem analógico o ISDN ====<br />
Para activar una conexión a un modem xDSL, modem analógico (dial-up) y ISDN, consulte [[Direct Modem Connection]].<br />
<br />
=== Configurar pacman ===<br />
Pacman es el '''pac'''kage '''man'''ager (gestor de paquetes) de Arch Linux . Es muy recomendable conocerlo y aprender a usarlo. Lea {{ic|man pacman}}, consulte el artículo sobre [[pacman (Español)|pacman]], o consulte el artículo [[Pacman Rosetta (Español)|Pacman Rosetta]] para una comparación con otros gestores de paquetes populares.<br />
<br />
Para las selección de los repositorios y opciones sobre pacman, edite {{ic|pacman.conf}}:<br />
<br />
# nano /etc/pacman.conf<br />
<br />
La mayoría de los usuarios querrán usar {{ic|[core]}}, {{ic|[extra]}} y {{ic|[community]}}.<br />
<br />
Si ha instalado Arch Linux x86_64, se recomienda que habilite también el repositorio {{ic|[multilib]}} (para ser capaz de ejecutar aplicaciones de 32 bit y de 64 bit):<br />
<br />
{{Nota|Al elegir repositorios, asegúrese de descomentar tanto las líneas de cabecera del {{ic|[''nombre_del_repositorio'']}}, como las líneas {{ic|Include}}. ¡De lo contrario, resultará que el repositorio seleccionado se omite!. Este es un error muy común.}}<br />
<br />
[multilib]<br />
SigLevel = PackageRequired<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
A continuación, tendrá que actualizar la lista de paquetes ejecutando la orden {{ic|pacman}} con el parámetro {{ic|-Sy}}. De no hacerlo, generará el error «warning: database file for 'multilib' does not exist» en el siguiente uso de pacman. <br />
<br />
Véase [[Official Repositories (Español)|Repositorios Oficiales]] para obtener más información, incluyendo detalles sobre el propósito de cada repositorio.<br />
<br />
Para el software no disponible directamente a través de pacman, véase [[Arch User Repository (Español)|Arch User Repository]].<br />
<br />
=== Crear un entorno inicial ramdisk ===<br />
{{Sugerencia| La mayoría de los usuarios pueden omitir este paso y utilizar los valores predeterminados en {{ic|mkinitcpio.conf}}. La imagen initramfs (en la carpeta {{ic|/boot}}) ya se ha generado sobre la base de este archivo cuando el paquete {{pkg|linux}} (el kernel de Linux) fue instalado al principio con {{ic|pacstrap}}.}}<br />
<br />
Aquí es necesario establecer el adecuado [[Mkinitcpio (Español)#HOOKS|hooks]], si root está en una unidad USB, si se utiliza RAID, LVM, o si {{ic|/usr}} está en una partición separada.<br />
<br />
Edite {{ic|/etc/mkinitcpio.conf}} en base a las propias necesidades y regenere la imagen initramfs con:<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Nota|Las instalaciones de Arch en VPS sobre QEMU (por ejemplo, cuando se utiliza virt-manager) pueden necesitar añadir los módulos virtio al archivo mkinitcpio.conf para poder arrancar.<br />
<br />
{{hc|# nano /etc/mkinitcpio.conf|<br />
MODULES&#61;"virtio virtio_blk virtio_pci virtio_net"}}<br />
<br />
}}<br />
<br />
=== Establecer la contraseña de root y crear una cuenta de usuario normal ===<br />
<br />
Establezca la contraseña de root con:<br />
<br />
# passwd<br />
<br />
{{Advertencia|Linux es un sistema operativo multi-usuario. No se deben realizar tareas cotidianas usando la cuenta de root. Se considera una mala práctica y puede ser extremadamente peligrosa. La cuenta de root solo debe utilizarse para tareas de mantenimiento.}}<br />
<br />
A continuación, agregue una cuenta de usuario normal. Puede utilizar un método interactivo, mediante la ejecución de la orden {{ic|adduser}}. Sin embargo, la forma descrita a continuación no es interactiva. El usuario ''archie'' es a modo de ejemplo.<br />
<br />
# useradd -m -g users -G wheel -s /bin/bash ''archie''<br />
# passwd ''archie''<br />
<br />
Si desea volver a empezar, use la orden {{ic|userdel}}. La opción {{ic|-r}} eliminará el directorio home del usuario y su contenido, así como la configuración del usuario (los llamados archivos "punto" (''«dot»'')).<br />
<br />
# userdel -r ''archie''<br />
<br />
Para más información, léase el artículo [[Users and Groups (Español)|Usuarios y grupos]].<br />
<br />
=== Instalar y configurar un gestor de arranque ===<br />
==== Para placas base BIOS ====<br />
Para los sistemas BIOS, hay tres gestores de arranque - Syslinux, GRUB y [[LILO]]. Elija el gestor de arranque según su conveniencia. A continuación solo se explican la instalación y configuración de Syslinux y GRUB.<br />
<br />
* Syslinux se limita (actualmente) a cargar solo los archivos de la partición en la que se instaló. Su archivo de configuración se considera que es más fácil de entender. Un ejemplo de configuración se puede encontrar [https://bbs.archlinux.org/viewtopic.php?pid=1109328#p1109328 aquí].<br />
<br />
* GRUB es más rico en características y admite escenarios más complejos. Su archivo(s) de configuración se asemeja más a un lenguaje de script, que puede ser difícil de modificar manualmente para los principiantes. Se recomienda su generación automática.<br />
{{Nota|Algunos sistemas BIOS pueden tener problemas con GPT. Consulte http://mjg59.dreamwidth.org/8035.html y http://rodsbooks.com/gdisk/bios.html para mayor información y posibles soluciones.}}<br />
===== Syslinux =====<br />
Instale el paquete {{Pkg|syslinux}} y, posteriormente, use el script {{ic|syslinux-install_update}} para ''instalar'' automáticamente los archivos ({{ic|-i}}), marcar la partición ''activa'' estableciendola con el flag de boot ({{ic|-a}}), e instalarla en el código de arranque ''MBR'' ({{ic|-m}}):<br />
<br />
{{Note|Si ha particionado el disco como GPT, instale el paquete {{Pkg|gptfdisk}}, mediante la orden ({{ic|pacman -S gptfdisk}}), porque contiene {{ic|sgdisk}}, que se utiliza para establecer el flag específico GPT para el inicio.}}<br />
<br />
# pacman -S syslinux<br />
# syslinux-install_update -i -a -m<br />
<br />
Configure {{ic|syslinux.cfg}} para que apunte a la partición root. Este paso es vital. Si apunta a la partición equivocada, Arch Linux no arrancará. Cambie {{ic|/dev/sda3}} de modo que coincida con su partición root ''(si ha particionado el disco como lo hicimos en el [[#Preparar el disco duro|ejemplo]], la partición root es sda1)''. Haga lo mismo para la entrada fallback.<br />
<br />
{{hc|# nano /boot/syslinux/syslinux.cfg|2=<br />
...<br />
LABEL arch<br />
...<br />
APPEND root=/dev/sda3 ro<br />
...}}<br />
<br />
Para más información sobre la configuración y el uso de Syslinux, véase [[Syslinux (Español)|Syslinux]].<br />
<br />
===== GRUB =====<br />
<br />
Instale el paquete {{Pkg|grub-bios}} y ejecute la orden {{ic|grub-install}}:<br />
<br />
{{Nota|Cambie {{ic|/dev/sda}}, si es el caso, para reflejar la unidad donde ha instalado Arch. No le agregue un número a la partición (no use {{ic|sda''X''}}).}}<br />
<br />
{{Nota|Para discos particionados en GPT en las placas base de BIOS, GRUB necesita una «[[GRUB (Español)#Instrucciones específicas para GPT|BIOS Boot Partition]]» de 2 MiB.}}<br />
<br />
# pacman -S grub-bios<br />
# grub-install --target=i386-pc --recheck /dev/sda<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Aunque es posible utilizar un archivo {{ic|grub.cfg}} creado manualmente, se recomienda a los principiantes que lo generen automáticamente con la orden de abajo:<br />
<br />
{{Sugerencia|Para buscar automáticamente otros sistemas operativos presentes en el equipo, instale {{pkg|os-prober}} (mediante la orden {{ic|pacman -S os-prober}}) antes de ejecutar la siguiente.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Para más información sobre uso y configuración de GRUB, consulte [[GRUB (Español)|GRUB]].<br />
<br />
==== Para placas base UEFI ====<br />
Para arrancar UEFI, el disco debe ser particionado en GPT, y una partición del sistema UEFI (512 MiB o superior, FAT32 y del tipo {{ic|EF00}}) debe estar presente y montada en {{ic|/boot/efi}}. Si se ha seguido esta guía desde el principio, ya ha hecho todo esto.<br />
<br />
Si bien hay otros [[UEFI_Bootloaders|bootloaders UEFI]] disponibles, se recomienda utilizar EFISTUB. A continuación se presentan las instrucciones para configurar EFISTUB y GRUB.<br />
<br />
{{Nota|Syslinux no es compatible aún con UEFI.}}<br />
<br />
===== EFISTUB =====<br />
El kernel de Linux puede actuar como su propio gestor de arranque usando EFISTUB. Este es el método de arranque UEFI recomendado por los desarrolladores y más simple en comparación con {{ic|grub-efi-x86_64}}. Los siguientes pasos crean un rEFInd (un fork de rEFIt) para proporcionar un menú EFISTUB para el kernel, así como para el arranque de otros bootleader UEFI. También puede usar [[UEFI_Bootloaders#Using_gummiboot|gummiboot]] (no probado) en lugar de rEFInd. Tanto rEFInd y gummiboot pueden detectar Windows bootloader UEFI en caso de arranque dual.<br />
<br />
1. Arranque en el modo UEFI y cargue el módulo del kernel {{ic|efivars}} antes de efectuar chroot:<br />
<br />
# modprobe efivars # antes de efectuar chroot<br />
<br />
2. Monte la partición UEFISYS en {{ic|/mnt/boot/efi}}, efectúe chroot y [[UEFI_Bootloaders#Setting_up_EFISTUB|copie los archivos del kernel y de initramfs]] como se describe a continuación.<br />
<br />
* Cree el directorio {{ic|/boot/efi/EFI/arch/}}.<br />
<br />
* Copie {{ic|/boot/vmlinuz-linux}} en {{ic|/boot/efi/EFI/arch/vmlinuz-arch.efi}}. El archivo con al extensión {{ic|.efi}} es muy importante, ya que algunos firmwares UEFI no funcionarán sin un archivo con esa extensión. '''Importante:''' recuerde que el archivo se llama vmlinu'''z''', no vmlinu'''x'''.<br />
<br />
* Copie {{ic|/boot/initramfs-linux.img}} en {{ic|/boot/efi/EFI/arch/initramfs-arch.img}}.<br />
<br />
* Copie {{ic|/boot/initramfs-linux-fallback.img}} en {{ic|/boot/efi/EFI/arch/initramfs-arch-fallback.img}}.<br />
<br />
Cada vez que el kernel y los archivos initramfs se actualicen en {{ic|/boot}}, necesitan también ser actualizados en {{ic|/boot/efi/EFI/arch}}. Esto puede automatizarse bien [[UEFI Bootloaders#Sync EFISTUB Kernel in UEFISYS partition using Systemd|utilizando systemd]] o bien [[UEFI Bootloaders#Sync EFISTUB Kernel in UEFISYS partition using Incron|utilizando incron]] (para configuraciones que no utilizan systemd).<br />
<br />
3. En esta guía se configura una GUI del gestor de arranque llamada rEFInd. Gestores de arranque alternativos se pueden encontrar en la página [[UEFI Bootloaders#Booting EFISTUB]].<br />
Para el gestor de arranque rEFInd recomendado instale los siguientes paquetes:<br />
<br />
# pacman -S refind-efi efibootmgr<br />
<br />
4. Instale rEFInd en la partición UEFISYS (como se describe en [[UEFI Bootloaders#Using rEFInd]]):<br />
<br />
# mkdir -p /boot/efi/EFI/refind<br />
# cp /usr/lib/refind/refindx64.efi /boot/efi/EFI/refind/refindx64.efi<br />
# cp /usr/lib/refind/config/refind.conf /boot/efi/EFI/refind/refind.conf<br />
# cp -r /usr/share/refind/icons /boot/efi/EFI/refind/icons<br />
<br />
5. Cree el archivo {{ic|refind_linux.conf}} con los parámetros del kernel para ser utilizados por rEFInd: <br />
<br />
{{hc|# nano /boot/efi/EFI/arch/refind_linux.conf|2=<br />
"Boot to X" "root=/dev/sdaX ro rootfstype=ext4 systemd.unit=graphical.target"<br />
"Boot to console" "root=/dev/sdaX ro rootfstype=ext4 systemd.unit=multi-user.target"}}<br />
<br />
{{Nota|{{ic|refind_linux.conf}} se copia en la carpeta {{ic|/boot/efi/EFI/arch/}} donde los archivos initramfs y el kernel han sido copiados siguiendo el paso 2.}}<br />
{{Nota| En {{ic|refind_linux.conf}}, sdaX se refiere a su sistema de archivos raíz, no la partición de arranque (''«boot»''), si los ha creado por separado. }}<br />
<br />
6. Añada rEFInd al menú de inicio de UEFI usando [[Unified_Extensible_Firmware_Interface_(Español)#efibootmgr|efibootmgr]]. <br />
<br />
{{Advertencia|Utilizar {{ic|efibootmgr}} en un Mac de Apple puede corromper el firmware y necesitar reflashear la ROM de la placa base. Para sistemas MAC, use {{AUR|mactel-boot}}, o «bless» directamente desde Mac OS X.}}<br />
<br />
# efibootmgr -c -g -d /dev/sdX -p Y -w -L "rEFInd" -l '\EFI\refind\refindx64.efi'<br />
<br />
{{Nota|En la orden anterior, X e Y indican la unidad y la partición de la partición UEFISYS. Por ejemplo, en {{ic|/dev/sdc5}}, X es «c»; Y es «5».}}<br />
<br />
7. (Opcional) A modo de respaldo, en el caso de que la entrada creada de {{ic|efibootmgr}} no funcione, copie {{ic|refindx64.efi}} a {{ic|/boot/efi/EFI/boot/bootx64.efi}} como sigue:<br />
<br />
# cp -r /boot/efi/EFI/refind/* /boot/efi/EFI/boot/<br />
# mv /boot/efi/EFI/boot/refindx64.efi /boot/efi/EFI/boot/bootx64.efi<br />
<br />
===== GRUB =====<br />
{{Nota|En caso de tener un sistema de 32-bit EFI, como un Mac anterior al 2008, instale {{ic|grub-efi-i386}} en su lugar, y use {{ic|1=--target=i386-efi}}.}}<br />
<br />
# pacman -S grub-efi-x86_64 efibootmgr<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
La siguiente orden crea una entrada de menú de GRUB en el menú de arranque de UEFI. Sin embargo, a partir de la versión 2.00 de {{Pkg|grub-efi-x86_64}}, {{ic|grub-install}} intentará crear una entrada de menú, por lo que ejecutar {{ic|efibootmgr}} puede no ser necesario. Véase [[Unified_Extensible_Firmware_Interface_(Español)#efibootmgr|efibootmgr de UEFI]] para más información.<br />
<br />
# efibootmgr -c -g -d /dev/sdX -p Y -w -L "Arch Linux (GRUB)" -l '\\EFI\\arch_grub\\grubx64.efi'<br />
<br />
Aunque se puede crear manualmente el archivo {{ic|grub.cfg}} se recomienda, a los principiantes, generar uno automáticamente:<br />
<br />
{{Sugerencia|Para buscar automáticamente otros sistemas operativos presentes en el equipo, instale {{Pkg|os-prober}} (mediante {{ic|pacman -S os-prober}}) antes de ejecutar la orden siguiente.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Para más información sobre configuración y uso de GRUB, consulte [[GRUB (Español)|GRUB]].<br />
<br />
=== Desmontar las particiones y reiniciar ===<br />
Salga del entorno chroot:<br />
<br />
# exit<br />
<br />
Dado que las particiones se montan en {{ic|/mnt}}, se utiliza el siguiente comando para desmontar:<br />
<br />
# umount /mnt/{boot,home,}<br />
<br />
Reinicie el equipo:<br />
<br />
# reboot<br />
<br />
{{Sugerencia|Asegúrese de retirar el disco de instalación, de lo contrario, se iniciará de nuevo el soporte de instalación.}}<noinclude><br />
{{Beginners' Guide navigation (Español)}}</noinclude></div>OmeGahttps://wiki.archlinux.org/index.php?title=Mirrors_(Espa%C3%B1ol)&diff=247676Mirrors (Español)2013-02-17T11:09:40Z<p>OmeGa: </p>
<hr />
<div>[[Category:About Arch (Español)]]<br />
[[Category:Package management (Español)]]<br />
[[en:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[zh-CN:Mirrors]]<br />
{{Article summary start|Sumario}}<br />
{{Article summary text|Este artículo trata sobre la actualización y gestión de los paquetes con los mirrors}}<br />
{{Article summary heading|Relacionado}}<br />
{{Article summary wiki|Mirroring}}<br />
{{Article summary wiki|pacman (Español)}}<br />
{{Article summary wiki|Reflector (Español)}}<br />
{{Article summary end}}<br />
Esta guía esta orientada a ayudarle a seleccionar y configurar los mejores mirrors para su equipo, y mostrarle un listado de los mirrors actuales disponibles.<br />
<br />
== Habilitar un mirror especifico ==<br />
<br />
Para habilitar los mirrors, edite el archivo {{ic|/etc/pacman.d/mirrorlist}} y localice la región geográfica más cercana a su ubicación. Descomente los mirrors que desee utilizar.<br />
<br />
{{Nota|El ancho de banda disponible en archlinux.org [https://www.archlinux.org/news/302/ está limitado a 50KB/s]}} <br />
<br />
Ejemplo:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
Véanse las herramientas [[#Mirror status]] y [[#List by speed]] para obtener ayuda sobre cómo escoger los mejores mirrors.<br />
<br />
{{Tip|Descomente sus 5 mirrors preferidos y ubíquelos al inicio de la lista de mirrors. De esa forma tendrán prioridad dentro de la lista de mirrors. También hace mas fácil la inclusión de actualizaciones de la lista del mirrorlist.}}<br />
<br />
También es posible especificar mirrors directamente en el archivo {{ic|/etc/pacman.conf}}. Para el repositorio ''[core]'' la configuración predifinida es:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
Para utilizar el mirror ''HostEurope'' como el mirror predeterminado, hay que agregar su dirección antes de la linea {{ic|Include}}:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/i686</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
Ahora pacman tratara de conectarse primero a este mirror. El mismo procedimiento es válido para ''[testing]'', ''[extra]'' y ''[community]''.<br />
<br />
{{Nota|Si los mirrors fueron especificados manualmente en el archivo {{ic|pacman.conf}}, recuerde también utilizar el mismo mirror para todos los repositorios. De otra forma, puede que paquetes que son incompatibles entre sí sean instalados, como linux desde ''[core]'' y un modulo viejo del kernel desde ''[extra]''.}}<br />
<br />
==Mirror status==<br />
Puede verificar el estatus de los Mirrors y su nivel de actualización visitando http://www.archlinux.de/?page=MirrorStatus o https://www.archlinux.org/mirrors/status/.<br />
<br />
Puede generar una lista de mirrors nueva y actualizada desde [https://www.archlinux.org/mirrorlist/ aquí], y automatizar el proceso con un [[#Script to automate use of Pacman Mirrorlist Generator|script]], o puede instalar [[Reflector (Español)|Reflector]], una herramienta que puede generar mirrors utilizando la lista de Mirrorcheck; también se puede verificar el nivel de actualización de los mirrors de la siguiente forma:<br />
#elija un server y navegue por «extra/os/»;<br />
#acceda a https://www.archlinux.org/ en otro navegador o pestaña del navegador; y,<br />
#compare la última fecha de modificación del directorio {{ic|i686}} del mirror con la fecha del mirror en la página principal de ArchLinux, en el área de ''Package Repositories'' a la derecha.<br />
<br />
==Clasificar y seleccionar los mirrors==<br />
Si no utiliza Reflector, que tiene la habilidad de clasificar los mirrors por ambos criterios: por velocidad de descarga y por última fecha de actualización, siga esta demostración de cómo clasificar los mirrors manualmente.<br />
<br />
===Listado por velocidad===<br />
Puede sacar provecho de utilizar el mirror local mas rápido, y esto puede ser determinado por el script de bash, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Utilice la orden {{ic|cd}}para moverse al directorio {{ic|/etc/pacman.d}}:<br />
# cd /etc/pacman.d<br />
<br />
Respalde el existente {{ic|/etc/pacman.d/mirrorlist}}:<br />
# cp mirrorlist mirrorlist.backup<br />
Edite el archivo {{ic|mirrorlist.backup}} y descomente los mirrors que van a ser probados con rankmirrrors:<br />
# nano mirrorlist.backup<br />
Opcionalmente, puede utilizar la siguiente línea {{ic|sed}} para descomentar (y probar) todos los mirrors:<br />
# sed '/^#\S/ s|#||' -i mirrorlist.backup<br />
Finalmente, clasifique los mirrors. El parámetro {{ic|-n 6}} significa que dejará habilitados solo los 6 mirrors con mejor respuesta: <br />
# rankmirrors -n 6 mirrorlist.backup > mirrorlist<br />
<br />
'''Fuerce a pacman para actualizar la lista de paquetes'''.<br />
Después de crear/editar el archivo {{ic|/etc/pacman.d/mirrorlist}}, (manualmente o utilizando {{ic|rankmirrors}}) ejecute la siguiente orden:<br />
# pacman -Syy<br />
<br />
{{Sugerencia|Pasar dos flags {{ic|--refresh}} o {{ic|-y}} fuerzan a pacman a refrescar todas las listas de paquetes incluso si se considera que ya están actualizados. Ejecutar {{ic|pacman -Syy}} ''cada vez que cambie un mirror'' es una buena práctica para evitar posibles problemas.}}<br />
<br />
===Listado combinado por velocidad y estatus===<br />
<br />
No es una buena idea utilizar solo los mirrrors solo por el más rápido, dado a que posiblemente el mirror mas rápido para su zona puede estar desactualizado. La forma predilecta es [[#Listado por velocidad]], luego ordenar esos mirrors por [[#Mirror status]]. <br />
<br />
Simplemente visite uno o los dos links de [[#Mirror status]] y ordénelos primero por los que están más actualizados. Luego, mueva los más actualizados al principio del archivo de configuración {{ic|/etc/pacman.d/mirrorlist}} y los mirrors que estén muy desactualizados simplemente no los utilize; repita el proceso hasta que elimine los mirrors mas desactualizados. Continue este proceso hasta que queden solo 6 mirrors que estén ordenados por velocidad de descarga y por nivel de actualización, dejando fuera los mirrors desactualizados o lentos.<br />
<br />
Si se presentan problemas con los mirrors, se deben repetir los pasos de más arriba. O repetirlos, incluso, cada tanto, aunque no se estén experimentando problemas con los mirrors, para mantener un archivo {{ic|/etc/pacman.d/mirrorlist}} actualizado.<br />
<br />
===Script de shell para automatizar el uso de Pacman Mirrorlist Generator===<br />
<br />
Puede usar el siguiente script de shell para actualizar los propios mirrors en base a las clasificaciones ya mencionadas. Si no vive en los Estados Unidos, puede cambiar la variable del país ({{ic|country}}).<br />
<br />
{{hc|updatemirrors.sh|<nowiki><br />
#!/bin/sh<br />
<br />
[ "$UID" != 0 ] && su=sudo<br />
<br />
country='US'<br />
url="https://www.archlinux.org/mirrorlist/?country=$country&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on"<br />
<br />
tmpfile=$(mktemp --suffix=-mirrorlist)<br />
<br />
# Get latest mirror list and save to tmpfile<br />
wget -qO- "$url" | sed 's/^#Server/Server/g' > "$tmpfile"<br />
<br />
# Backup and replace current mirrorlist file (if new file is non-zero)<br />
if [ -s "$tmpfile" ]<br />
then<br />
{ echo " Backing up the original mirrorlist..."<br />
$su mv -i /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig; } &&<br />
{ echo " Rotating the new list into place..."<br />
$su mv -i "$tmpfile" /etc/pacman.d/mirrorlist; }<br />
else<br />
echo " Unable to update, could not download list."<br />
fi<br />
<br />
# allow global read access (required for non-root yaourt execution)<br />
chmod +r /etc/pacman.d/mirrorlist</nowiki>}}<br />
<br />
{{Nota|Va a tener que copiar este texto, crear con su contenido un archivo, y ejecutar {{ic|chmod +x}} sobre dicho archivo. Si no ha efectuado el acceso como root, el script invocará la orden {{ic|sudo}} cuando necesite rotar el nuevo archivo {{ic|mirrorlist}} en su lugar.}}<br />
<br />
=== Usar Reflector ===<br />
Como alternativa, es posible utilizar [[Reflector (Español)|Reflector]] para recuperar los últimos mirrorlist de la página [https://www.archlinux.org/mirrors/status/ MirrorStatus], filtrar los mirror más actualizados, ordenarlos en base a la velocidad y sobreescribir el archivo {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
== Mirrors oficiales==<br />
La lista oficial de mirrors de pacman se puede obtener del paquete {{Pkg|pacman-mirrorlist}}. Para obtener una lista de mirrors aun más actualizada puede consultar la pagina de [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator en la página principal.<br />
En el muy improbable escenario de que no tenga un mirrorlist configurado o {{ic|pacman-mirrorlist}} no este instalado, escriba:<br />
{{bc|# wget -O /etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/}}<br />
<br />
Asegúrese de descomentar los mirrors preferidos como se mencionó más arriba y luego ejecute:<br />
<br />
# pacman -Syy<br />
# pacman -S --force pacman-mirrorlist<br />
<br />
Si desea que su mirror sea incluido en la lista oficial, puede hacer una solicitud. Mientras tanto, puede agregarlo a la lista de [[#Mirrors no oficiales]] al final de esta página.<br />
<br />
Si obtiene un error diciendo que la variable {{ic|$arch}} es utilizada pero no definida, agregue lo siguiente al archivo de configuración {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
{{Nota|También puede agregar las variables {{Ic|auto}} y {{Ic|i686}} para {{ic|Architecture}}.}}<br />
<br />
===IPv6-ready mirrors===<br />
<br />
[https://www.archlinux.org/mirrorlist/?country=all&protocol=http&ip_version=6 Pacman mirror list generator] puede ser usado para generar una lista de mirrors IPv6.<br />
<br />
== Mirrors no oficiales ==<br />
Estos mirrors ''no'' están listados en el archivo de configuración {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
===Global===<br />
*http://prdownloads.sourceforge.net/archlinux/ - ''No contiene ISO recientes, utilícelo solo para obtener ISO viejos.''<br />
<br />
===TOR Network===<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
<br />
===Singapur===<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
===Bulgaria===<br />
*http://mirror.telepoint.bg/archlinux/ <br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
===Vietnam===<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
===China===<br />
'''CHINA TELECOM'''<br />
*http://mirror.lupaworld.com/archlinux/<br />
<br />
'''CHINA UNICOM'''<br />
*http://mirrors.sohu.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Universidad Shanghai Jiaotong''<br />
*ftp://ftp.sjtu.edu.cn/archlinux/<br />
*http://mirrors.ustc.edu.cn/archlinux/ - ''Universidad de Ciencia y Tecnología de China''<br />
*ftp://mirrors.ustc.edu.cn/archlinux/<br />
*http://mirrors.tuna.tsinghua.edu.cn/archlinux/ - ''Universidad de Tsinghua''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(solo ipv4)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(solo ipv6)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Universidad de Lanzhou''<br />
<br />
===Francia===<br />
*http://delta.archlinux.fr/ - ''Apoyo al paquete Delta. Es necesario el paquete xdelta3 disponible desde [extra].''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
===Alemania===<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
<br />
===Indonesia===<br />
*http://mirror.kavalinux.com/archlinux/ - ''Solo para Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
===Kazakhstan===<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
===Lituania===<br />
*http://edacval.homelinux.org/mirrors/archlinux/ - ''Solo para LT, sin ISO''<br />
<br />
===Malasia===<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO y Core''<br />
<br />
===Nueva Zelanda===<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''Solo NZ''<br />
===Polonia===<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
===Rusia===<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, sin iso, con repositorios del proyecto <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> y del repositorio [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32''']''<br />
<br />
===Sudáfrica===<br />
*http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ - ''Universidad de Stellenbosch''<br />
*ftp://ftp.sun.ac.za/pub/mirrors/archlinux/<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''Universidad de Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''Universidad de Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
===Estados Unidos===<br />
* http://archlinux.linuxfreedom.com - ''Contiene numerosas imágenes ISO pero no la última ISO de fecha 2011.08.19''<br />
* http://mirror.pointysoftware.net/archlinux/<br />
<br />
==Solución de problemas==<br />
<br />
===Mirrors fuera de sincronización: paquetes corruptos/archivo no encontrado===<br />
<br />
Los problemas con mirrors fuera de sincronización fueron ya apuntados en [https://www.archlinux.org/news/482 este post], por lo que, probablemente, ya fue solucionado para la mayoría de los usuarios, pero en el caso de que este evento se presente de nuevo, trate de verificar si los paquetes se encuentran en el repositorio [testing].<br />
<br />
Después de sincronizar con {{ic|pacman -Sy}}, utilize esta orden:<br />
# pacman -Ud $(pacman -Sup | tail -n +2 | sed -e 's,/\(core\|extra\)/,/testing/,' \<br />
-e 's,/\(community\)/,/\1-testing/,')<br />
<br />
Hacer esto ayudara en cualquier ocasión, cuando los paquetes en un mirror no hayan sido sincronizados en [core/extra], y residan ahora en [testing]. Es perfectamente seguro instalar desde [testing] en el caso de que los paquetes sean coincidentes por versión y fecha de liberación.<br />
En cualquier caso, es mejor cambiar los mirrors y sincronizar con {{ic|pacman -Syy}}, que recurrir a un repositorio. De cualquier modo puede suceder que uno o todos los mirrors, en algún grado, estén fuera de sincronización.<br />
<br />
====Utilizar todos los mirrors====<br />
Para emular el comportamiento de {{ic|pacman -Su}}, para que revise toda la lista de mirrors, utilize el siguiente scrpit:<br />
{{hc|~/bin/pacup|<nowiki><br />
#!/bin/bash<br />
<br />
# Pacman will not exit on the first error. Comment the line below to<br />
# try from [testing] directly.<br />
pacman -Su "$@" && exit<br />
<br />
while read -r pkg; do<br />
if pacman -Ud "$pkg"; then<br />
continue<br />
else<br />
while read -r mirror; do<br />
pacman -Ud $(sed "s,.*\(/\(community-\)*testing/os/\(i686\|x86_64\)/\),$mirror\1," <<<"$pkg") &&<br />
break<br />
done < <(sed -ne 's,^ *Server *= *\|/$repo/os/\(i686\|x86_64\).*,,gp' \<br />
</etc/pacman.d/mirrorlist | tail -n +2 )<br />
fi<br />
done < <(pacman -Sup | tail -n +2 | sed -e 's,/\(core\|extra\)/,/testing/,' \<br />
-e 's,/\(community\)/,/\1-testing/,')<br />
</nowiki>}}<br />
<br />
== Véase también ==<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker</div>OmeGahttps://wiki.archlinux.org/index.php?title=Reflector&diff=247675Reflector2013-02-17T11:05:40Z<p>OmeGa: </p>
<hr />
<div>[[Category:Package management]]<br />
[[es:Reflector]]<br />
[[ko:Reflector]]<br />
[[ru:Reflector]]<br />
[[zh-CN:Reflector]]<br />
[http://xyne.archlinux.ca/projects/reflector/ Reflector] is a script which can retrieve the latest mirror list from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{Ic|/etc/pacman.d/mirrorlist}}. <br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] the {{pkg|reflector}} package which is available in the [[Official Repositories|official repositories]].<br />
<br />
== Usage ==<br />
<br />
{{Warning|Please back up your {{ic|/etc/pacman.d/mirrorlist}} file first}}<br />
<br />
First back up your {{ic|/etc/pacman.d/mirrorlist}}<br />
# cp -vf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
The following command will filter the first five mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:<br />
# reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist<br />
<br />
The following command will verbosely rate the 200 most recently synchronized HTTP servers, sort them by download rate, and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:<br />
# reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist<br />
<br />
To see all of the available commands, run the following command:<br />
# reflector --help<br />
<br />
{{Warning|Make sure the mirror list does not contain strange entries before syncing or updating with pacman.}}</div>OmeGahttps://wiki.archlinux.org/index.php?title=Reflector_(Espa%C3%B1ol)&diff=247674Reflector (Español)2013-02-17T11:04:56Z<p>OmeGa: Created page with "Category:Package management (Español) en:Reflector ko:Reflector ru:Reflector zh-CN:Reflector [http://xyne.archlinux.ca/projects/reflector/ Reflector] es u..."</p>
<hr />
<div>[[Category:Package management (Español)]]<br />
[[en:Reflector]]<br />
[[ko:Reflector]]<br />
[[ru:Reflector]]<br />
[[zh-CN:Reflector]]<br />
[http://xyne.archlinux.ca/projects/reflector/ Reflector] es un ''script'' que es capaz de obtener la lista más reciente de ''[[Mirrors_(Español)|mirrors]]'' desde la página [https://www.archlinux.org/mirrors/status/ MirrorStatus], filtrar los ''mirrors'' más actualizados, ordenarlos en base a su velocidad, y sobrescribir el archivo {{Ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
== Instalación ==<br />
<br />
[[pacman_(Español)|Instala]] el paquete {{pkg|reflector}}, disponible en los [[Official Repositories_(Español)|repositorios oficiales]].<br />
<br />
== Uso == <br />
<br />
{{Advertencia|Por favor haz una copia de seguridad de tu archivo {{ic|/etc/pacman.d/mirrorlist}} antes de continuar.}}<br />
<br />
Primero, respalda tu archivo {{ic|/etc/pacman.d/mirrorlist}}:<br />
# cp -vf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
El siguiente comando filtrará los primeros cinco ''mirrors,'' los ordenará en base a su velocidad, y sobrescribirá el archivo {{ic|/etc/pacman.d/mirrorlist}}:<br />
# reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist<br />
<br />
Este comando evaluará de manera verbosa los 200 servidores HTTP sincronizados más recientemente, los ordenará por su tasa de descarga, y sobrescribirá el archivo {{ic|/etc/pacman.d/mirrorlist}}:<br />
# reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist<br />
<br />
Para ver todos las opciones disponibles, utiliza:<br />
# reflector --help<br />
<br />
{{Advertencia|Asegúrate de que la lista de ''mirrors'' no contiene entradas extrañas antes de sincronizar o actualizar con pacman.}}<br />
<br />
=== Actualizar la lista de paquetes ===<br />
<br />
Siempre que se hagan modificaciones al arhivo {{ic|/etc/pacman.d/mirrorlist}} es recomendable forzar a pacman a actualizar la lista de paquetes. Para esto ejecuta:<br />
# pacman -Syy</div>OmeGahttps://wiki.archlinux.org/index.php?title=Conky_(Espa%C3%B1ol)&diff=229175Conky (Español)2012-10-17T08:55:19Z<p>OmeGa: </p>
<hr />
<div>[[Category:Eye Candy (Español)]]<br />
[[Category:Status Monitoring and Notification (Español)]]<br />
[[en:Conky]]<br />
[[fr:Conky]]<br />
[[it:Conky]]<br />
[[ru:Conky]]<br />
[[tr:Conky]]<br />
[[zh-CN:Conky]]<br />
Conky es un monitor de sistema para los sistemas X Window. Está disponible para GNU/Linux y FreeBSD. Es un software libre liberado bajo los términos de la licencia GPL. Conky es capaz de monitorear distintas variables de sistema, incluyendo CPU, memoria, swap, espacio de disco, temperaturas, subidas, bajadas, mensajes de sistema, y mucho más. Es completamente configurable, la configuración puede ser un poco difícil de entender, pero es bastante posible realizarla. Conky es un ''fork'' de torsmo.<br />
<br />
==Instalación y configuración==<br />
*Conky esta disponible en los repositorios Extra:<br />
# pacman -S conky<br />
*Editar el archivo de configuración usando uno como ejemplo desde [http://conky.sourceforge.net/screenshots.html homeproject-screenshot]:<br />
$ nano ~/.conkyrc<br />
*Alternativamente, se puede usar el archivo por defecto desde {{ic|/etc/conky/conky.conf}}:<br />
$ cp /etc/conky/conky.conf ~/.conkyrc<br />
*Más información sobre sentencias:<br />
$ man conky<br />
<br />
==Paquetes AUR==<br />
En adición a los paquetes básicos de conky en los repositorios, hay varios paquetes [[AUR]] disponibles con opciones extras de compilación disponibles.<br />
*Instalar [https://aur.archlinux.org/packages.php?ID=11884 conky-cli] para dependencias conky sans X11.<br />
*Instalar [https://aur.archlinux.org/packages.php?ID=19156 conky-nvidia] para soporte nVidia.<br />
*Instalar [https://aur.archlinux.org/packages.php?ID=31589 conky-lua] para soporte lua.<br />
*Instalar [https://aur.archlinux.org/packages.php?ID=36405 conky-lua-nv] para soporte de ambos (lua, nVidia).<br />
<br />
==Consejos y trucos==<br />
===Habilitar transparecian real (KDE4)===<br />
Desde la versión 1.8.0, conky soporta transparencias reales. Para habilitarlo (y hacerlo trabajar correctamente con KDE4), hay que agregar las siguientes líneas a {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_transparent yes<br />
own_window_argb_visual yes<br />
own_window_type normal<br />
own_window_class conky-semi<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
Esto reemplaza los métodos [https://www.archlinux.org/packages/?name=feh feh] descritos a continuación.<br />
<br />
===Evitar el parpadeo===<br />
Conky necesita soporte Doble de extensión de buffer (DBE) desde el servidor X para prevenir el parpadeo, porque no puede actualizar rápidamente la pantalla sin esto. Esto puede ser activado en {{ic|/etc/X11/xorg.conf}} con {{ic|Load "dbe"}} línea en {{ic|Section "Module"}}. El archivo xorg.conf ha sido reemplazado (1.8.x actualización de patch) por {{ic|/etc/X11/xorg.conf.d}}, que contiene una configuración particular de los archivos. ''DBE'' se carga automáticamente.<br />
<br />
Para verificar:<br />
# cat /var/log/Xorg.0.log | grep dbe<br />
<br />
Salida (debería ser similar):<br />
# [ 86.101] (II) LoadModule: "dbe"<br />
# [ 86.101] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so<br />
# [ 86.111] (II) Module dbe: vendor="X.Org Foundation"<br />
<br />
Para activar el buffer-doble verificar de tener en {{ic|~/.conkyrc}}:<br />
# Place below the other options, not below TEXT or XY<br />
double_buffer yes<br />
<br />
===Integrar con KDesktop===<br />
Conky con configuración de impresión de pantalla genera problemas con la visualización de iconos. Se deben seguir ciertos pasos.<br />
*Agregar estas líneas a {{ic|~/.conkyrc}}:<br />
own_window yes<br />
own_window_type normal<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
*Si esta configuración esta activada, comentarla o eliminar la línea:<br />
minimum_size<br />
*Para iniciar automáticamente conky crear el siguiente enlace:<br />
$ ln -s /usr/bin/conky ~/.kde/share/autostart/conkylink<br />
Para usuarios KDE4<br />
$ ln -s /usr/bin/conky ~/.kde4/Autostart/conkylink<br />
*Instalar feh:<br />
# pacman -S feh<br />
*Hacer un script que permita la transparencia con el escritorio:<br />
Para usuarios KDE3<br />
$ nano -w ~/.kde/share/autostart/fehconky <br />
<br />
#!/bin/bash<br />
feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`<br />
Para usuarios KDE<br />
$ nano -w ~/.kde4/Autostart/fehconky<br />
<br />
#!/bin/bash<br />
feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"<br />
Utilizar {{ic|--bg-center}} si se usa un fondo de pantalla centrado.<br />
*Hacerlo ejecutable:<br />
$ chmod +x ~/.kde/share/autostart/fehconky<br />
KDE4<br />
$ chmod +x ~/.kde4/Autostart/fehconky<br />
*Opcionalmente, en vez de usar un script se puede agregar la siguiente línea correspondiente al final de {{ic|.conkyrc}}:<br />
$ nano ~/.conkyrc:<br />
Para KDE3<br />
${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}<br />
Para KDE4<br />
${exec feh --bg-scale "`grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail --lines=1 | sed 's/wallpaper=//'`"}<br />
<br />
===Visualizar información de actualización de paquetes===<br />
*[https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Muestra información de actualizaciones de paquetes en un formato usario-definido. La salida de este programa puede ser incluida en Conky con el comando ${execpi}.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Imprime notificaciones de actualizaciones de desplazamiento. Del autor de Paconky.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Línea de comandos anterior y simple del autor de Paconky. Imprime solo la cantidad de paquetes necesarios para actualizar.<br />
*[https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Programa de notificaciones de actualización bastante configurable en Python.<br />
*[https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - Bash script para usuarios que han habilitado ShowSize.<br />
<br />
===Mostrar Weather Forecast===<br />
Mirar [http://bbs.archlinux.org/viewtopic.php?id=37381 este enlace].<br />
<br />
===Mostrar RSS feeds===<br />
Conky tiene la habilidad de mostrar RSS feeds nativamente sin la necesidad de un script ajeno para ejecutar una salida en conky. Por ejemplo, para mostrar los títulos de las diez actualizaciones más recientes de Planeta Arch y refrescar el feed cada minuto, se debe insertar dentro del archivo {{ic|.conkyrc}}:<br />
${rss http://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
<br />
===Mostrar ranking Distrowatch Arch Linux===<br />
Mirar [http://bbs.archlinux.org/viewtopic.php?id=88779 este enlace].<br />
<br />
===Mostrar estadísticas rTorrent===<br />
Mirar [http://bbs.archlinux.org/viewtopic.php?id=67304 este enlace].<br />
<br />
===Mostrar numero de correos nuevos (GMail)===<br />
Crear un archivo con nombre <code>gmail.py</code> en la ubicación conveniente (este ejemplo usa <code>~/.scripts/</code>) con el siguiente código [[Python]]:<br />
import os<br />
<br />
#Enter your username and password below within double quotes<br />
# eg. username="username" and password="password"<br />
username="****"<br />
password="****"<br />
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
Si la secuencia de comandos anterior no funciona para ti y tu cuenta de Google Apps, puedes modificar el script siquiente para que funcione con una cuenta de correo Google App, en código [[Python]]:<br />
import os<br />
<br />
#Enter your domain, username and password below within double quotes<br />
# eg. domain="yourdomain.com", username="username" and password="password"<br />
domain="yourdomain.com"<br />
username="username"<br />
password="password"<br />
com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"<br />
<br />
temp=os.popen(com)<br />
msg=temp.read()<br />
index=msg.find("<fullcount>")<br />
index2=msg.find("</fullcount>")<br />
fc=int(msg[index+11:index2])<br />
<br />
if fc==0:<br />
print "0 new"<br />
else:<br />
print str(fc)+" new"<br />
<br />
Agregar la siguiente línea de comandos a tu <code>.conky</code> para verificar tu cuenta de correo Gmail por correo nuevo cada 5 minutos (300 segundos) y mostrar: ''# new''<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
Alternativamente se puede usar [http://www.stunnel.org/ stunnel].<br />
pacman -S stunnel<br />
<br />
La siguiente configuración está tomada desde las [http://conky.sourceforge.net/faq.html Preguntas frecuentes de Conky].<br />
<br />
Modificar /etc/stunnel/stunnel.conf:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
E iniciar stunnel:<br />
/etc/rc.d/stunnel start<br />
<br />
Lo único que queda es el conkyrc:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Aquí uso * como la contraseña de conky para preguntar al inicio, pero tú no ''necesitas'' hacerlo. <br />
<br />
===Mostrar correos nuevos (IMAP + SSL)===<br />
Conky tiene soporte para cuentas IMAP, pero no soporta SSL. Esto se puede proveer utilizando la siguiente línea de comando tomada [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html este de esta publicación en un foro]. Esto requiere los modulos Perl/CPAN Mail::IMAPClient e IO::Socket::SSL que están en los paquetes perl-mail-imapclient y perl-io-socket-ssl. <br />
<br />
Crear un archivo llamado imap.pl en una ubicación para ser leída por conky. En este archivo agregar (con los cambios correspondientes):<br />
<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Agregar a .conkyrc:<br />
${execpi 300 ~/.conky/imap.pl} <br />
o donde se haya guardado el archivo.<br />
<br />
Alternativamente, se puede usar stunnel como se muestra en: [[Conky#How to display the number of new emails (Gmail) in Conky]].<br />
<br />
== Contribución de usuarios con ejemplos de configuración ==<br />
=== Graysky ===<br />
[[http://img9.imageshack.us/img9/3153/imageffj.jpg Screen shot]]<br />
<br />
[[https://github.com/graysky2/dotfiles/blob/master/.conkyrc Aquí]] esto es - modificado para ajustarse a tu pantalla. Optimizado para un chip Quad Core con varios discos de almacenamiento (HDDs) (aunque uno de ellos no esta conectado para este screenshot) y una tarjeta de video nVidia. Se puede modificar fácilmente esto para un sistema dual-o-single core con cualquier numero de discos de almacenamiento (HHDs).<br />
<br />
==Un ejemplo de los anillos con soporte nVidia==<br />
<pre><br />
1 # -- Conky settings -- #<br />
2 background no<br />
3 update_interval 1<br />
4 <br />
5 cpu_avg_samples 2<br />
6 net_avg_samples 2<br />
7 <br />
8 override_utf8_locale yes<br />
9 <br />
10 double_buffer yes<br />
11 no_buffers yes<br />
12 <br />
13 text_buffer_size 2048<br />
14 imlib_cache_size 0<br />
15 <br />
16 # -- Window specifications -- #<br />
17 <br />
18 own_window yes<br />
19 own_window_type normal<br />
20 own_window_transparent yes<br />
21 own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below<br />
22 <br />
23 border_inner_margin 0<br />
24 border_outer_margin 0<br />
25 <br />
26 minimum_size 320 800<br />
27 maximum_width 320<br />
28 <br />
29 alignment bottom_right<br />
30 gap_x 0<br />
31 gap_y 0<br />
32 <br />
33 # -- Graphics settings -- #<br />
34 draw_shades no<br />
35 draw_outline no<br />
36 draw_borders no<br />
37 draw_graph_borders yes<br />
38 <br />
39 # -- Text settings -- #<br />
40 use_xft yes<br />
41 xftfont MaiandraGD:size=24<br />
42 xftalpha 0.4<br />
43 <br />
44 uppercase no<br />
45 <br />
46 default_color 888888<br />
47 <br />
48 # -- Lua Load -- #<br />
49 lua_load ~/conky/lua/lua.lua<br />
50 lua_draw_hook_pre ring_stats<br />
51 <br />
52 TEXT<br />
53 ${alignr}${voffset 53}${goto 90}${font MaiandraGD:size=11}${time %A, %d %B %Y}<br />
54 <br />
55 <br />
56 ${voffset 5}${goto 164}${font MaiandraGD:size=16}${time %H:%M}<br />
57 <br />
58 <br />
59 <br />
60 ${voffset -40}${goto 100}${font MaiandraGD:size=9}Kernel:${offset 70}Uptime:<br />
61 ${goto 90}${font MaiandraGD:size=9}$kernel${offset 40}$uptime<br />
62 ${voffset 57}${goto 117}${font snap:size=8}${cpu cpu0}%<br />
63 ${goto 117}${cpu cpu1}%<br />
64 ${goto 117}CPU<br />
65 ${voffset 19}${goto 145}${memperc}%<br />
66 ${goto 145}$swapperc%<br />
67 ${goto 145}MEM<br />
68 ${voffset 25}${goto 170}${nvidia gpufreq}<br />
69 ${goto 170}${nvidia memfreq}<br />
70 ${goto 170}GPU<br />
71 ${voffset 27}${goto 198}${totaldown ppp0}<br />
72 ${goto 198}${totalup ppp0}<br />
73 ${goto 205}NET<br />
74 ${voffset 21}<br />
75 ${goto 222}${fs_used /home}<br />
76 ${goto 230}DISK<br />
<br />
</pre><br />
*Y la línea de comandos lua.lua requerida:<br />
<br />
<pre><br />
1 --[[<br />
2 Ring Meters by londonali1010 (2009)<br />
3 <br />
4 This script draws percentage meters as rings. It is fully customisable; all options are described in the script.<br />
5 <br />
6 IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. <br />
The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number <br />
of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that <br />
if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky <br />
every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, <br />
otherwise the update_num will not be reset and you will get an error.<br />
7 <br />
8 To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):<br />
9 lua_load ~/scripts/rings-v1.2.1.lua<br />
10 lua_draw_hook_pre ring_stats<br />
11 <br />
12 Changelog:<br />
13 + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009)<br />
14 + v1.2 -- Added option for the ending angle of the rings (07.10.2009)<br />
15 + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a <br />
numerical value rather than a percentage (29.09.2009)<br />
16 + v1.0 -- Original release (28.09.2009)<br />
17 ]]<br />
18 <br />
19 settings_table = {<br />
20 {<br />
21 -- Edit this table to customise your rings.<br />
22 -- You can create more rings simply by adding more elements to settings_table.<br />
23 -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.<br />
24 name='time',<br />
25 -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. <br />
If you would not use an argument in the Conky variable, use ''.<br />
26 arg='%I.%M',<br />
27 -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.<br />
28 max=12,<br />
29 -- "bg_colour" is the colour of the base ring.<br />
30 bg_colour=0x888888,<br />
31 -- "bg_alpha" is the alpha value of the base ring.<br />
32 bg_alpha=0.3,<br />
33 -- "fg_colour" is the colour of the indicator part of the ring.<br />
34 fg_colour=0x888888,<br />
35 -- "fg_alpha" is the alpha value of the indicator part of the ring.<br />
36 fg_alpha=0.5,<br />
37 -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky <br />
window.<br />
38 x=191, y=145,<br />
39 -- "radius" is the radius of the ring.<br />
40 radius=32,<br />
41 -- "thickness" is the thickness of the ring, centred around the radius.<br />
42 thickness=4,<br />
43 -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or <br />
negative.<br />
44 start_angle=0,<br />
45 -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, <br />
but must be larger (e.g. more clockwise) than start_angle.<br />
46 end_angle=360<br />
47 },<br />
48 {<br />
49 name='time',<br />
50 arg='%M.%S',<br />
51 max=60,<br />
52 bg_colour=0x888888,<br />
53 bg_alpha=0.3,<br />
54 fg_colour=0x888888,<br />
55 fg_alpha=0.5,<br />
56 x=191, y=145,<br />
57 radius=37,<br />
58 thickness=4,<br />
59 start_angle=0,<br />
60 end_angle=360<br />
61 },<br />
62 {<br />
63 name='time',<br />
64 arg='%S',<br />
65 max=60,<br />
66 bg_colour=0x888888,<br />
67 bg_alpha=0.3,<br />
68 fg_colour=0x888888,<br />
69 fg_alpha=0.5,<br />
70 x=191, y=145,<br />
71 radius=42,<br />
72 thickness=4,<br />
73 start_angle=0,<br />
74 end_angle=360<br />
75 },<br />
76 {<br />
77 name='cpu',<br />
78 arg='cpu0',<br />
79 max=100,<br />
80 bg_colour=0x888888,<br />
81 bg_alpha=0.3,<br />
82 fg_colour=0x888888,<br />
83 fg_alpha=0.5,<br />
84 x=140, y=300,<br />
85 radius=26,<br />
86 thickness=5,<br />
87 start_angle=-90,<br />
88 end_angle=180<br />
89 },<br />
90 {<br />
91 name='cpu',<br />
92 arg='cpu1',<br />
93 max=100,<br />
94 bg_colour=0x888888,<br />
95 bg_alpha=0.3,<br />
96 fg_colour=0x888888,<br />
97 fg_alpha=0.5,<br />
98 x=140, y=300,<br />
99 radius=20,<br />
100 thickness=5,<br />
101 start_angle=-90,<br />
102 end_angle=180<br />
103 },<br />
104 {<br />
105 name='memperc',<br />
106 arg='',<br />
107 max=100,<br />
108 bg_colour=0x888888,<br />
109 bg_alpha=0.3,<br />
110 fg_colour=0x888888,<br />
111 fg_alpha=0.5,<br />
112 x=170, y=350,<br />
113 radius=26,<br />
114 thickness=5,<br />
115 start_angle=-90,<br />
116 end_angle=180<br />
117 },<br />
118 {<br />
119 name='swapperc',<br />
120 arg='',<br />
121 max=100,<br />
122 bg_colour=0x888888,<br />
123 bg_alpha=0.3,<br />
124 fg_colour=0x888888,<br />
125 fg_alpha=0.5,<br />
126 x=170, y=350,<br />
127 radius=20,<br />
128 thickness=5,<br />
129 start_angle=-90,<br />
130 end_angle=180<br />
131 },<br />
132 {<br />
133 name='time',<br />
134 arg='%d',<br />
135 max=31,<br />
136 bg_colour=0x888888,<br />
137 bg_alpha=0.3,<br />
138 fg_colour=0x888888,<br />
139 fg_alpha=0.5,<br />
140 x=191, y=145,<br />
141 radius=50,<br />
142 thickness=5,<br />
143 start_angle=-140,<br />
144 end_angle=-30<br />
145 },<br />
146 {<br />
147 name='time',<br />
148 arg='%m',<br />
149 max=12,<br />
150 bg_colour=0x888888,<br />
151 bg_alpha=0.3,<br />
152 fg_colour=0x888888,<br />
153 fg_alpha=0.5,<br />
154 x=191, y=145,<br />
155 radius=50,<br />
156 thickness=5,<br />
157 start_angle=30,<br />
158 end_angle=140<br />
159 },<br />
160 -- {<br />
161 -- name='fs_used_perc',<br />
162 -- arg='/',<br />
163 -- max=100,<br />
164 -- bg_colour=0x888888,<br />
165 -- bg_alpha=0.3,<br />
166 -- fg_colour=0x888888,<br />
167 -- fg_alpha=0.5,<br />
168 -- x=260, y=503,<br />
169 -- radius=26,<br />
170 -- thickness=5,<br />
171 -- start_angle=-90,<br />
172 -- end_angle=180<br />
173 -- },<br />
174 {<br />
175 name='fs_used_perc',<br />
176 arg='/home',<br />
177 max=100,<br />
178 bg_colour=0x888888,<br />
179 bg_alpha=0.3,<br />
180 fg_colour=0x888888,<br />
181 fg_alpha=0.5,<br />
182 x=260, y=503,<br />
183 radius=20,<br />
184 thickness=5,<br />
185 start_angle=-90,<br />
186 end_angle=180<br />
187 },<br />
188 {<br />
189 name='totalup',<br />
190 arg='ppp0',<br />
191 max=2,<br />
192 bg_colour=0x888888,<br />
193 bg_alpha=0.3,<br />
194 fg_colour=0x888888,<br />
195 fg_alpha=0.5,<br />
196 x=230, y=452,<br />
197 radius=20,<br />
198 thickness=5,<br />
199 start_angle=-90,<br />
200 end_angle=180<br />
201 },<br />
202 {<br />
203 name='totaldown',<br />
204 arg='ppp0',<br />
205 max=2,<br />
206 bg_colour=0x888888,<br />
207 bg_alpha=0.3,<br />
208 fg_colour=0x888888,<br />
209 fg_alpha=0.5,<br />
210 x=230, y=452,<br />
211 radius=26,<br />
212 thickness=5,<br />
213 start_angle=-90,<br />
214 end_angle=180<br />
215 },<br />
216 {<br />
217 name='nvidia',<br />
218 arg='gpufreq',<br />
219 max=475,<br />
220 bg_colour=0x888888,<br />
221 bg_alpha=0.3,<br />
222 fg_colour=0x888888,<br />
223 fg_alpha=0.5,<br />
224 x=200, y=401,<br />
225 radius=26,<br />
226 thickness=5,<br />
227 start_angle=-90,<br />
228 end_angle=180<br />
229 },<br />
230 {<br />
231 name='nvidia',<br />
232 arg='memfreq',<br />
233 max=700,<br />
234 bg_colour=0x888888,<br />
235 bg_alpha=0.3,<br />
236 fg_colour=0x888888,<br />
237 fg_alpha=0.5,<br />
238 x=200, y=401,<br />
239 radius=20,<br />
240 thickness=5,<br />
241 start_angle=-90,<br />
242 end_angle=180<br />
243 },<br />
244 }<br />
245 <br />
246 require 'cairo'<br />
247 <br />
248 function rgb_to_r_g_b(colour,alpha)<br />
249 return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha<br />
250 end<br />
251 <br />
252 function draw_ring(cr,t,pt)<br />
253 local w,h=conky_window.width,conky_window.height<br />
254 <br />
255 local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']<br />
256 local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']<br />
257 <br />
258 local angle_0=sa*(2*math.pi/360)-math.pi/2<br />
259 local angle_f=ea*(2*math.pi/360)-math.pi/2<br />
260 local t_arc=t*(angle_f-angle_0)<br />
261 <br />
262 -- Draw background ring<br />
263 <br />
264 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)<br />
265 cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))<br />
266 cairo_set_line_width(cr,ring_w)<br />
267 cairo_stroke(cr)<br />
268 <br />
269 -- Draw indicator ring<br />
270 <br />
271 cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)<br />
272 cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))<br />
273 cairo_stroke(cr)<br />
274 end<br />
275 <br />
276 function conky_ring_stats()<br />
277 local function setup_rings(cr,pt)<br />
278 local str=''<br />
279 local value=0<br />
280 <br />
281 str=string.format('${%s %s}',pt['name'],pt['arg'])<br />
282 str=conky_parse(str)<br />
283 <br />
284 value=tonumber(str)<br />
285 if value == nil then value = 0 end<br />
286 pct=value/pt['max']<br />
287 <br />
288 draw_ring(cr,pct,pt)<br />
289 end<br />
290 <br />
291 if conky_window==nil then return end<br />
292 local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)<br />
293 <br />
294 local cr=cairo_create(cs)<br />
295 <br />
296 local updates=conky_parse('${updates}')<br />
297 update_num=tonumber(updates)<br />
298 <br />
299 if update_num>5 then<br />
300 for i in pairs(settings_table) do<br />
301 setup_rings(cr,settings_table[i])<br />
302 end<br />
303 end<br />
304 end<br />
~ <br />
</pre><br />
== Una nota sobre fuentes simbólicas ==<br />
Muchos de los más decorados archivos ''.conkyrc'' usan las fuentes PizzaDude Bullets y Pie Charts para mapas. Están disponibles en el AUR como 'ttf-pizzadude-bullets' y 'ttf-piechartsformaps' respectivamente, o pueden ser hallados y descargados con una simple búsqueda he instalación manual usando las instrucciones en [[Fonts]].<br />
<br />
== Enlaces externos==<br />
*[http://bbs.archlinux.org/viewtopic.php?id=39906 Configuraciones de Conkys en los foros de Arch]<br />
*[http://conky.sourceforge.net/ Página web oficial]<br />
*[http://freshmeat.net/projects/conky/ Conky] en [[Wikipedia:Freshmeat|Freshmeat]]<br />
*[http://sourceforge.net/projects/conky/ Conky] en [[wikipedia:sourceforge.net|SourceForge]]<br />
*[irc://chat.freenode.org/conky #conky] Canal de chat IRC en [[wikipedia:Freenode|freenode]]<br />
*[http://novel.evilcoder.org/wiki/index.php/ConkyFAQ FAQ]<br />
<!-- vim: set ft=Wikipedia: --></div>OmeGa