https://wiki.archlinux.org/api.php?action=feedcontributions&user=Brando56894&feedformat=atomArchWiki - User contributions [en]2024-03-28T09:02:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=KVM&diff=637185KVM2020-10-04T18:38:37Z<p>Brando56894: /* Nested virtualization */ added note that nested virtualization also works with kvm_amd</p>
<hr />
<div>[[Category:Hypervisors]]<br />
[[Category:Kernel]]<br />
[[it:KVM]]<br />
[[ja:KVM]]<br />
[[zh-hans:KVM]]<br />
[[zh-hant:KVM]]<br />
{{Related articles start}}<br />
{{Related|:Category:Hypervisors}}<br />
{{Related|Libvirt}}<br />
{{Related articles end}}<br />
'''KVM''', [[Wikipedia:Kernel-based Virtual Machine|Kernel-based Virtual Machine]], is a [[Wikipedia:hypervisor|hypervisor]] built into the Linux kernel. It is similar to [[Xen]] in purpose but much simpler to get running. Unlike native [[QEMU]], which uses emulation, KVM is a special operating mode of QEMU that uses CPU extensions ([[Wikipedia:Hardware-assisted virtualization|HVM]]) for virtualization via a kernel module.<br />
<br />
Using KVM, one can run multiple virtual machines running unmodified GNU/Linux, Windows, or any other operating system. (See [http://www.linux-kvm.org/page/Guest_Support_Status Guest Support Status] for more information.) Each virtual machine has private virtualized hardware: a network card, disk, graphics card, etc.<br />
<br />
Differences between KVM and [[Xen]], [[VMware]], or QEMU can be found at the [http://www.linux-kvm.org/page/FAQ#General_KVM_information KVM FAQ].<br />
<br />
This article does not cover features common to multiple emulators using KVM as a backend. You should see related articles for such information.<br />
<br />
== Checking support for KVM ==<br />
<br />
=== Hardware support ===<br />
<br />
KVM requires that the virtual machine host's processor has virtualization support (named VT-x for Intel processors and AMD-V for AMD processors). You can check whether your processor supports hardware virtualization with the following command:<br />
$ LC_ALL=C lscpu | grep Virtualization<br />
<br />
Alternatively:<br />
<br />
$ grep -E --color=auto 'vmx|svm|0xc0f' /proc/cpuinfo<br />
<br />
If nothing is displayed after running either command, then your processor does '''not''' support hardware virtualization, and you will '''not''' be able to use KVM.<br />
<br />
{{Note|You may need to enable virtualization support in your BIOS. All x86_64 processors manufactured by AMD and Intel in the last 10 years support virtualization. If it looks like your processor does not support virtualization, it's almost certainly turned off in the BIOS.}}<br />
<br />
=== Kernel support ===<br />
<br />
Arch Linux kernels provide the required [[kernel modules]] to support KVM.<br />
<br />
* One can check if the necessary modules, {{ic|kvm}} and either {{ic|kvm_amd}} or {{ic|kvm_intel}}, are available in the kernel with the following command:<br />
<br />
$ zgrep CONFIG_KVM /proc/config.gz<br />
<br />
The module is available only if it is set to either {{ic|y}} or {{ic|m}}.<br />
<br />
* Then, ensure that the kernel modules are automatically loaded, with the command:<br />
<br />
{{hc|$ lsmod {{!}} grep kvm|<br />
kvm_intel 245760 0<br />
kvmgt 28672 0<br />
mdev 20480 2 kvmgt,vfio_mdev<br />
vfio 32768 3 kvmgt,vfio_mdev,vfio_iommu_type1<br />
kvm 737280 2 kvmgt,kvm_intel<br />
irqbypass 16384 1 kvm<br />
}}<br />
<br />
If the command returns nothing, the module needs to be loaded manually, see [[Kernel modules#Manual module handling]].<br />
<br />
{{Tip|If modprobing {{Ic|kvm_intel}} or {{Ic|kvm_amd}} fails but modprobing {{Ic|kvm}} succeeds, and {{ic|lscpu}} claims that hardware acceleration is supported, check the BIOS settings. Some vendors, especially laptop vendors, disable these processor extensions by default. To determine whether there is no hardware support or whether the extensions are disabled in BIOS, the output from {{ic|dmesg}} after having failed to modprobe will tell.}}<br />
<br />
== Para-virtualization with Virtio ==<br />
<br />
Para-virtualization provides a fast and efficient means of communication for guests to use devices on the host machine. KVM provides para-virtualized devices to virtual machines using the '''Virtio''' API as a layer between the hypervisor and guest.<br />
<br />
All Virtio devices have two parts: the host device and the guest driver. <br />
<br />
=== Kernel support ===<br />
<br />
Use the following command to check if the VIRTIO modules are available in the kernel '''inside the virtual machine''':<br />
<br />
$ zgrep VIRTIO /proc/config.gz<br />
<br />
Then, check if the kernel modules are automatically loaded with the command:<br />
<br />
$ lsmod | grep virtio<br />
<br />
In case the above commands return nothing, you need to [[Kernel modules#Manual module handling|load the kernel modules]] manually.<br />
<br />
=== List of para-virtualized devices ===<br />
<br />
* network device (virtio-net)<br />
* block device (virtio-blk)<br />
* controller device (virtio-scsi)<br />
* serial device (virtio-serial)<br />
* balloon device (virtio-balloon)<br />
<br />
== How to use KVM ==<br />
<br />
See the main article: [[QEMU]].<br />
<br />
== Tips and tricks ==<br />
<br />
{{Note|See [[QEMU#Tips and tricks]] and [[QEMU#Troubleshooting]] for general tips and tricks.}}<br />
<br />
=== Nested virtualization ===<br />
<br />
Nested virtualization enables existing virtual machines to be run on third-party hypervisors and on other clouds without any modifications to the original virtual machines or their networking.<br />
<br />
On host, enable nested feature for {{ic|kvm_intel}}:<br />
<br />
{{Note|the same can be done for AMD, just replace intel with amd where necessary}}<br />
<br />
# modprobe -r kvm_intel<br />
# modprobe kvm_intel nested=1<br />
<br />
To make it permanent (see [[Kernel modules#Setting module options]]):<br />
<br />
{{hc|/etc/modprobe.d/kvm_intel.conf|2=<br />
options kvm_intel nested=1<br />
}}<br />
<br />
Verify that feature is activated: <br />
<br />
{{hc|$ systool -m kvm_intel -v {{!}} grep nested|2=<br />
nested = "Y"<br />
}}<br />
<br />
Enable the "host passthrough" mode to forward all CPU features to the guest system:<br />
<br />
# If using [[QEMU]], run the guest virtual machine with the following command: {{ic|qemu-system-x86_64 -enable-kvm -cpu host}}.<br />
# If using ''virt-manager'', change the CPU model to {{ic|host-passthrough}} (it will not be in the list, just write it in the box).<br />
# If using ''virsh'', use {{ic|virsh edit ''vm-name''}} and change the CPU line to {{ic|1=<cpu mode='host-passthrough' check='partial'/>}}<br />
<br />
Boot VM and check if vmx flag is present:<br />
<br />
$ grep -E --color=auto 'vmx|svm' /proc/cpuinfo<br />
<br />
=== Enabling huge pages ===<br />
<br />
{{Merge|QEMU|qemu-kvm no longer exists as all of its features have been merged into {{Pkg|qemu}}. After the above issue is cleared, I suggest merging this section into [[QEMU]].}}<br />
<br />
You may also want to enable hugepages to improve the performance of your virtual machine.<br />
With an up to date Arch Linux and a running KVM you probably already have everything you need. Check if you have the directory {{ic|/dev/hugepages}}. If not, create it. <br />
Now we need the right permissions to use this directory. The default permission is root's uid and gid with 0755, but we want anyone in the kvm group to have access to hugepages.<br />
<br />
Add to your {{ic|/etc/fstab}}:<br />
<br />
hugetlbfs /dev/hugepages hugetlbfs mode=01770,gid=78 0 0<br />
<br />
Of course the gid must match that of the {{ic|kvm}} group. The mode of {{ic|1770}} allows anyone in the group to create files but not unlink or rename each other's files. Make sure {{ic|/dev/hugepages}} is mounted properly:<br />
<br />
{{hc|# umount /dev/hugepages<br />
# mount /dev/hugepages<br />
$ mount {{!}} grep huge|2=<br />
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,mode=1770,gid=78)<br />
}}<br />
<br />
Now you can calculate how many hugepages you need. Check how large your hugepages are:<br />
<br />
$ grep Hugepagesize /proc/meminfo<br />
<br />
Normally that should be 2048 kB ≙ 2 MB. Let us say you want to run your virtual machine with 1024 MB. 1024 / 2 = 512. Add a few extra so we can round this up to 550. Now tell your machine how many hugepages you want:<br />
<br />
# echo 550 > /proc/sys/vm/nr_hugepages<br />
<br />
If you had enough free memory you should see:<br />
<br />
{{hc|$ grep HugePages_Total /proc/meminfo|<br />
HugesPages_Total: 550<br />
}}<br />
<br />
If the number is smaller, close some applications or start your virtual machine with less memory (number_of_pages x 2):<br />
<br />
$ qemu-system-x86_64 -enable-kvm -m 1024 -mem-path /dev/hugepages -hda <disk_image> [...]<br />
<br />
Note the {{ic|-mem-path}} parameter. This will make use of the hugepages.<br />
<br />
Now you can check, while your virtual machine is running, how many pages are used:<br />
<br />
{{hc|$ grep HugePages /proc/meminfo|<br />
HugePages_Total: 550<br />
HugePages_Free: 48<br />
HugePages_Rsvd: 6<br />
HugePages_Surp: 0<br />
}}<br />
<br />
Now that everything seems to work you can enable hugepages by default if you like. Add to your {{ic|/etc/sysctl.d/40-hugepage.conf}}:<br />
<br />
vm.nr_hugepages = 550<br />
<br />
See also:<br />
<br />
* [https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt summary of hugetlbpage support in the Linux kernel]<br />
* [[debian:Hugepages|Debian Wiki - Hugepages]]<br />
<br />
== See also ==<br />
<br />
* [http://www.linux-kvm.org/page/HOWTO KVM Howto]<br />
* [http://www.linux-kvm.org/page/FAQ#General_KVM_information KVM FAQ]</div>Brando56894https://wiki.archlinux.org/index.php?title=Talk:KVM&diff=637184Talk:KVM2020-10-04T18:32:32Z<p>Brando56894: /* Nested Virtualization With kvm_amd */ signing</p>
<hr />
<div>== Enabling huge pages ==<br />
With systemd, hugetlbfs is mounted on /dev/hugepages by default, but with mode 0755 and root's uid and gid.<br />
<br />
I'm giving this a try right now.<br />
[[User:Rbellamy|Rbellamy]] ([[User talk:Rbellamy|talk]]) 03:39, 27 January 2015 (UTC)<br />
<br />
And not so much... seems I can't access the hugetlbfs as I should.<br />
<br />
Jan 26 19:57:59 eanna libvirtd[619]: Unable to read from monitor: Connection reset by peer<br />
Jan 26 19:57:59 eanna libvirtd[619]: internal error: early end of file from monitor: possible problem:<br />
2015-01-27T03:57:59.072699Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory<br />
Jan 26 19:57:59 eanna kernel: virbr0: port 2(vnet0) entered disabled state<br />
Jan 26 19:57:59 eanna kernel: device vnet0 left promiscuous mode<br />
Jan 26 19:57:59 eanna kernel: virbr0: port 2(vnet0) entered disabled state<br />
Jan 26 19:57:59 eanna avahi-daemon[669]: Withdrawing workstation service for vnet0.<br />
Jan 26 19:57:59 eanna NetworkManager[576]: <info> (virbr0): link disconnected<br />
Jan 26 19:57:59 eanna systemd-coredump[894]: Process 870 (qemu-system-x86) of user 99 dumped core.<br />
Jan 26 19:57:59 eanna systemd-machined[871]: Machine qemu-prometheus terminated.<br />
Jan 26 19:57:59 eanna gnome-session[711]: Gjs-Message: JS LOG: Failed to launch ibus-daemon: Failed to execute child process "ibus-daemon" (No such file or directory)<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Activating via systemd: service name='org.freedesktop.GeoClue2' unit='geoclue.service'<br />
Jan 26 19:57:59 eanna libvirtd[619]: error from service: TerminateMachine: No machine 'qemu-prometheus' known<br />
Jan 26 19:57:59 eanna libvirtd[619]: Failed to autostart VM 'prometheus': internal error: early end of file from monitor: possible problem:<br />
2015-01-27T03:57:59.072699Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'<br />
Jan 26 19:57:59 eanna libvirtd[619]: internal error: Unable to find any usable hugetlbfs mount for 16777216 KiB<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'<br />
Jan 26 19:57:59 eanna NetworkManager[576]: <info> wpa_supplicant started<br />
Jan 26 19:57:59 eanna polkitd[598]: Registered Authentication Agent for unix-session:c1 (system bus name :1.29 [gnome-shell --mode=gdm], object path /org/ freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Successfully activated service 'org.freedesktop.GeoClue2'<br />
Jan 26 19:57:59 eanna gnome-session[711]: Gjs-Message: JS LOG: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop. PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigg<br />
Jan 26 19:57:59 eanna org.freedesktop.Telepathy.AccountManager[715]: (process:921): libnm-glib-WARNING **: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" d<br />
Jan 26 19:57:59 eanna libvirtd[619]: Failed to autostart VM 'atlas': internal error: Unable to find any usable hugetlbfs mount for 16777216 KiB<br />
[[User:Rbellamy|Rbellamy]] ([[User talk:Rbellamy|talk]]) 04:11, 27 January 2015 (UTC)<br />
<br />
:I think the proper way to manually set hugepage size is with sysctl:<br />
: sysctl vm.nr_hugepages=550<br />
:<br />
:Then you can enable it permanently by creating the file "/etc/sysctl.d/40-hugepags.conf" and putting the following inside it:<br />
: vm.nr_hugepages=550<br />
:[[User:Meskarune|Meskarune]] ([[User talk:Meskarune|talk]]) 20:53, 14 September 2017 (UTC)<br />
<br />
: I just wanted to confirm that with default permissions on dev/hugepages, this error happened: https://gist.github.com/meskarune/90a2c561488303a16e67554cc108e47e<br />
:[[User:Meskarune|Meskarune]] ([[User talk:Meskarune|talk]]) 17:57, 4 November 2017 (UTC)<br />
<br />
== Merge KVM article into QEMU ==<br />
<br />
Because the QEMU-KVM fork of QEMU has been deprecated/obsoleted as of QEMU 1.3 [http://wiki.qemu.org/KVM] (about 9 months ago as of this writing [http://git.qemu.org/?p=qemu.git;a=tags]) and QEMU is now on version 1.6, we should strongly consider merging the [[KVM]] article into the main article for [[QEMU]]. A separate article for the KVM fork made sense historically, but now that the fork has been merged upstream, we should just keep everything on one page.<br />
<br />
Does anyone disagree?<br><br />
-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 16:29, 16 September 2013 (UTC)<br />
<br />
:Good idea, I don't think anybody can disagree, as the main section of this article, [[KVM#How_to_use_KVM]], already just links to [[QEMU]] ^^<br />
:If then somebody considers [[QEMU]] to have become too long, it should be discussed to split it in some other way.<br />
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 01:06, 18 September 2013 (UTC)<br />
<br />
::The problems of [[KVM#Tips_and_tricks]] should be solved along the way, especially [[KVM#Live_snapshots]] which belongs to [[libvirt]] and not to [[QEMU]]. It should also be clearly stated which features are KVM-specific to avoid confusion.<br />
::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:44, 22 September 2013 (UTC)<br />
<br />
:::I just merged [[KVM#Live_snapshots]] into [[libvirt]].<br />
:::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 01:03, 7 November 2013 (UTC)<br />
<br />
== Works with "AMD FX(tm)-8350 Eight-Core Processor" using 2013.11.01 64-bit ==<br />
<br />
Using Arch Linux release 2013.11.01 in 64-bit mode... it boots fine. Following the wikis... this is basically the parameters I used<br />
<br />
$ /usr/bin/qemu-system-x86_64 -boot d -m 1024 -hda '/home/user/path/to/storage' -cdrom '/path/to/archlinux-2013.11.01-dual.iso' -net nic,vlanx=0 -net user,vlan=0 -localtime -k en-gb -smp 8 -enable-kvm -cpu host &<br />
<br />
* I also booted the Gentoo minimal ISO 20131010 in 64-bit mode (go to gentoo to find out more) using the same parameter but different ISO<br />
<br />
$ /usr/bin/qemu-system-x86_64 -boot d -m 1024 -hda '/home/user/path/to/storage' -cdrom '/path/to/install-amd64-minimal-20131010.iso' -net nic,vlan=0 -net user,vlan=0 -localtime -k en-gb -smp 8 -enable-kvm -cpu host &<br />
<br />
* During live CD boot up... I see this error message... which I think is normal...<br />
<br />
Failed to access perfctr msr (MSR c0010001 is ffffffffffffffff)<br />
<br />
* You also get errors about not being able to access hardware... obvious why :p (unless I'm wrong)<br />
<br />
* I haven't installed Arch Linux in the guest yet (busy :p) but will get some time to<br />
<br />
* from what I can see, the parameter "nested" is already set to "1" for the {{ic|kvm_amd}} module when using the {{ic|systool}} command before applying the "nested" parameter myself<br />
<br />
* I found loading {{ic|kvm}} or {{ic|kvm_amd}} loads both<br />
<br />
* you should say {{ic|grep svm /proc/cpuinfo}} for AMD<br />
<br />
* I have another AMD machine which has "AMD Phenom II x4 955" (showing the {{ic|svm}} CPU flag from {{ic|/proc/cpuinfo}} file which too is using Arch Linux (my server) when I have time... will try it out there<br />
<br />
* I do plan to move to Intel... better drivers... lets get cracking before I move to Intel<br />
<br />
* I'm new to wiki code :p<br><br />
-- [[User:Sinatosk|Sinatosk]] ([[User talk:Sinatosk|talk]]) 22:34, 4 November 2013<br />
<br />
== Missing virtio_serial ==<br />
<br />
Instructions mention a virtio_serial.<br />
<br />
This appears to be missing, the rest in the list exist.<br />
<br />
[root@ lib]# find . | grep -i virtio_ | grep ko<br />
./modules/5.5.8-arch1-1/kernel/drivers/block/virtio_blk.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/char/virtio_console.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/crypto/virtio/virtio_crypto.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/net/virtio_net.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/nvdimm/virtio_pmem.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/rpmsg/virtio_rpmsg_bus.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/scsi/virtio_scsi.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_balloon.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_input.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_mmio.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_pci.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko.xz<br />
[root@ lib]# <br />
<br />
[[User:Beepboo|Beepboo]] ([[User talk:Beepboo|talk]]) 21:33, 9 March 2020 (UTC)<br />
<br />
== Hugepages Troubleshooting ==<br />
=== unable to map backing store for guest RAM: Cannot allocate memory ===<br />
Certify guest memory ram does not exceed the amount allocated to hugepages.<br />
<br />
[[User:Superherointj|SuperHeroINTJ]] ([[User talk:Superherointj|talk]]) 16:50, 1 June 2020 (UTC)<br />
<br />
== Nested Virtualization With kvm_amd ==<br />
<br />
Works perfectly<br />
<br />
[bran@server ~]$ cat /proc/cpuinfo<br />
processor : 0<br />
vendor_id : AuthenticAMD<br />
cpu family : 23<br />
model : 8<br />
model name : AMD Ryzen Threadripper 2970WX 24-Core Processor<br />
[root@server opt]# modprobe -r kvm_amd<br />
[root@server opt]# modprobe kvm_amd nested=1<br />
[root@server opt]# systool -m kvm_amd -v|grep nested<br />
nested = "1"<br />
<br />
<br />
In VM<br />
truenas# grep -E --color=auto 'vmx|svm' /proc/cpuinfo<br />
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibpb vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr virt_ssbd arat npt nrip_save arch_capabilities<br />
<br />
[[User:Brando56894|Brando56894]] ([[User talk:Brando56894|talk]]) 18:32, 4 October 2020 (UTC)</div>Brando56894https://wiki.archlinux.org/index.php?title=Talk:KVM&diff=637182Talk:KVM2020-10-04T18:22:56Z<p>Brando56894: /* Nested Virtualization With kvm_amd */ new section</p>
<hr />
<div>== Enabling huge pages ==<br />
With systemd, hugetlbfs is mounted on /dev/hugepages by default, but with mode 0755 and root's uid and gid.<br />
<br />
I'm giving this a try right now.<br />
[[User:Rbellamy|Rbellamy]] ([[User talk:Rbellamy|talk]]) 03:39, 27 January 2015 (UTC)<br />
<br />
And not so much... seems I can't access the hugetlbfs as I should.<br />
<br />
Jan 26 19:57:59 eanna libvirtd[619]: Unable to read from monitor: Connection reset by peer<br />
Jan 26 19:57:59 eanna libvirtd[619]: internal error: early end of file from monitor: possible problem:<br />
2015-01-27T03:57:59.072699Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory<br />
Jan 26 19:57:59 eanna kernel: virbr0: port 2(vnet0) entered disabled state<br />
Jan 26 19:57:59 eanna kernel: device vnet0 left promiscuous mode<br />
Jan 26 19:57:59 eanna kernel: virbr0: port 2(vnet0) entered disabled state<br />
Jan 26 19:57:59 eanna avahi-daemon[669]: Withdrawing workstation service for vnet0.<br />
Jan 26 19:57:59 eanna NetworkManager[576]: <info> (virbr0): link disconnected<br />
Jan 26 19:57:59 eanna systemd-coredump[894]: Process 870 (qemu-system-x86) of user 99 dumped core.<br />
Jan 26 19:57:59 eanna systemd-machined[871]: Machine qemu-prometheus terminated.<br />
Jan 26 19:57:59 eanna gnome-session[711]: Gjs-Message: JS LOG: Failed to launch ibus-daemon: Failed to execute child process "ibus-daemon" (No such file or directory)<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Activating via systemd: service name='org.freedesktop.GeoClue2' unit='geoclue.service'<br />
Jan 26 19:57:59 eanna libvirtd[619]: error from service: TerminateMachine: No machine 'qemu-prometheus' known<br />
Jan 26 19:57:59 eanna libvirtd[619]: Failed to autostart VM 'prometheus': internal error: early end of file from monitor: possible problem:<br />
2015-01-27T03:57:59.072699Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'<br />
Jan 26 19:57:59 eanna libvirtd[619]: internal error: Unable to find any usable hugetlbfs mount for 16777216 KiB<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'<br />
Jan 26 19:57:59 eanna NetworkManager[576]: <info> wpa_supplicant started<br />
Jan 26 19:57:59 eanna polkitd[598]: Registered Authentication Agent for unix-session:c1 (system bus name :1.29 [gnome-shell --mode=gdm], object path /org/ freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.<br />
Jan 26 19:57:59 eanna dbus[571]: [system] Successfully activated service 'org.freedesktop.GeoClue2'<br />
Jan 26 19:57:59 eanna gnome-session[711]: Gjs-Message: JS LOG: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop. PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigg<br />
Jan 26 19:57:59 eanna org.freedesktop.Telepathy.AccountManager[715]: (process:921): libnm-glib-WARNING **: Error in get_property: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" d<br />
Jan 26 19:57:59 eanna libvirtd[619]: Failed to autostart VM 'atlas': internal error: Unable to find any usable hugetlbfs mount for 16777216 KiB<br />
[[User:Rbellamy|Rbellamy]] ([[User talk:Rbellamy|talk]]) 04:11, 27 January 2015 (UTC)<br />
<br />
:I think the proper way to manually set hugepage size is with sysctl:<br />
: sysctl vm.nr_hugepages=550<br />
:<br />
:Then you can enable it permanently by creating the file "/etc/sysctl.d/40-hugepags.conf" and putting the following inside it:<br />
: vm.nr_hugepages=550<br />
:[[User:Meskarune|Meskarune]] ([[User talk:Meskarune|talk]]) 20:53, 14 September 2017 (UTC)<br />
<br />
: I just wanted to confirm that with default permissions on dev/hugepages, this error happened: https://gist.github.com/meskarune/90a2c561488303a16e67554cc108e47e<br />
:[[User:Meskarune|Meskarune]] ([[User talk:Meskarune|talk]]) 17:57, 4 November 2017 (UTC)<br />
<br />
== Merge KVM article into QEMU ==<br />
<br />
Because the QEMU-KVM fork of QEMU has been deprecated/obsoleted as of QEMU 1.3 [http://wiki.qemu.org/KVM] (about 9 months ago as of this writing [http://git.qemu.org/?p=qemu.git;a=tags]) and QEMU is now on version 1.6, we should strongly consider merging the [[KVM]] article into the main article for [[QEMU]]. A separate article for the KVM fork made sense historically, but now that the fork has been merged upstream, we should just keep everything on one page.<br />
<br />
Does anyone disagree?<br><br />
-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 16:29, 16 September 2013 (UTC)<br />
<br />
:Good idea, I don't think anybody can disagree, as the main section of this article, [[KVM#How_to_use_KVM]], already just links to [[QEMU]] ^^<br />
:If then somebody considers [[QEMU]] to have become too long, it should be discussed to split it in some other way.<br />
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 01:06, 18 September 2013 (UTC)<br />
<br />
::The problems of [[KVM#Tips_and_tricks]] should be solved along the way, especially [[KVM#Live_snapshots]] which belongs to [[libvirt]] and not to [[QEMU]]. It should also be clearly stated which features are KVM-specific to avoid confusion.<br />
::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 10:44, 22 September 2013 (UTC)<br />
<br />
:::I just merged [[KVM#Live_snapshots]] into [[libvirt]].<br />
:::-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 01:03, 7 November 2013 (UTC)<br />
<br />
== Works with "AMD FX(tm)-8350 Eight-Core Processor" using 2013.11.01 64-bit ==<br />
<br />
Using Arch Linux release 2013.11.01 in 64-bit mode... it boots fine. Following the wikis... this is basically the parameters I used<br />
<br />
$ /usr/bin/qemu-system-x86_64 -boot d -m 1024 -hda '/home/user/path/to/storage' -cdrom '/path/to/archlinux-2013.11.01-dual.iso' -net nic,vlanx=0 -net user,vlan=0 -localtime -k en-gb -smp 8 -enable-kvm -cpu host &<br />
<br />
* I also booted the Gentoo minimal ISO 20131010 in 64-bit mode (go to gentoo to find out more) using the same parameter but different ISO<br />
<br />
$ /usr/bin/qemu-system-x86_64 -boot d -m 1024 -hda '/home/user/path/to/storage' -cdrom '/path/to/install-amd64-minimal-20131010.iso' -net nic,vlan=0 -net user,vlan=0 -localtime -k en-gb -smp 8 -enable-kvm -cpu host &<br />
<br />
* During live CD boot up... I see this error message... which I think is normal...<br />
<br />
Failed to access perfctr msr (MSR c0010001 is ffffffffffffffff)<br />
<br />
* You also get errors about not being able to access hardware... obvious why :p (unless I'm wrong)<br />
<br />
* I haven't installed Arch Linux in the guest yet (busy :p) but will get some time to<br />
<br />
* from what I can see, the parameter "nested" is already set to "1" for the {{ic|kvm_amd}} module when using the {{ic|systool}} command before applying the "nested" parameter myself<br />
<br />
* I found loading {{ic|kvm}} or {{ic|kvm_amd}} loads both<br />
<br />
* you should say {{ic|grep svm /proc/cpuinfo}} for AMD<br />
<br />
* I have another AMD machine which has "AMD Phenom II x4 955" (showing the {{ic|svm}} CPU flag from {{ic|/proc/cpuinfo}} file which too is using Arch Linux (my server) when I have time... will try it out there<br />
<br />
* I do plan to move to Intel... better drivers... lets get cracking before I move to Intel<br />
<br />
* I'm new to wiki code :p<br><br />
-- [[User:Sinatosk|Sinatosk]] ([[User talk:Sinatosk|talk]]) 22:34, 4 November 2013<br />
<br />
== Missing virtio_serial ==<br />
<br />
Instructions mention a virtio_serial.<br />
<br />
This appears to be missing, the rest in the list exist.<br />
<br />
[root@ lib]# find . | grep -i virtio_ | grep ko<br />
./modules/5.5.8-arch1-1/kernel/drivers/block/virtio_blk.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/char/virtio_console.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/crypto/virtio/virtio_crypto.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/net/virtio_net.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/nvdimm/virtio_pmem.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/rpmsg/virtio_rpmsg_bus.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/scsi/virtio_scsi.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_balloon.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_input.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_mmio.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/drivers/virtio/virtio_pci.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko.xz<br />
./modules/5.5.8-arch1-1/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko.xz<br />
[root@ lib]# <br />
<br />
[[User:Beepboo|Beepboo]] ([[User talk:Beepboo|talk]]) 21:33, 9 March 2020 (UTC)<br />
<br />
== Hugepages Troubleshooting ==<br />
=== unable to map backing store for guest RAM: Cannot allocate memory ===<br />
Certify guest memory ram does not exceed the amount allocated to hugepages.<br />
<br />
[[User:Superherointj|SuperHeroINTJ]] ([[User talk:Superherointj|talk]]) 16:50, 1 June 2020 (UTC)<br />
<br />
== Nested Virtualization With kvm_amd ==<br />
<br />
Works perfectly<br />
<br />
[bran@server ~]$ cat /proc/cpuinfo<br />
processor : 0<br />
vendor_id : AuthenticAMD<br />
cpu family : 23<br />
model : 8<br />
model name : AMD Ryzen Threadripper 2970WX 24-Core Processor<br />
[root@server opt]# modprobe -r kvm_amd<br />
[root@server opt]# modprobe kvm_amd nested=1<br />
[root@server opt]# systool -m kvm_amd -v|grep nested<br />
nested = "1"<br />
<br />
<br />
In VM<br />
truenas# grep -E --color=auto 'vmx|svm' /proc/cpuinfo<br />
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibpb vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr virt_ssbd arat npt nrip_save arch_capabilities</div>Brando56894https://wiki.archlinux.org/index.php?title=Pydio&diff=457583Pydio2016-11-23T21:20:27Z<p>Brando56894: updated name of nginx config sample</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:Pydio]]<br />
[https://pydio.com/ Pydio] (formerly AjaXplorer) is a mature open source web application for file sharing and synchronization.<br />
<br />
== Installation ==<br />
[[Install]] the {{AUR|pydio}} package. Further you will need a database (e.g. [[MariaDB]]), a web server ([[Apache]], [[Lighttpd]] or [[Nginx]]) with [[PHP]]-support. You may refer following sites:<br />
<br />
== Configuration ==<br />
Make sure to adjust following variables to these minimal values in your {{ic|php.ini}}:<br />
{{hc|/etc/php/php.ini|<br />
<nowiki>extension=exif.so<br />
extension=gd.so<br />
extension=mcrypt.so<br />
extension=iconv.so<br />
extension=mysqli.so<br />
session.save_path = "/tmp"<br />
output_buffering = Off<br />
<br />
file_uploads = On<br />
post_max_size = 20G<br />
upload_max_filesize = 20G<br />
max_file_uploads = 20000<br />
</nowiki>}}<br />
In this configuration, we will configure the [[Nginx]] web server to serve Pydio on localhost in the root location without SSL enabled (even tough it's recommended to use it with SSL). First, place a copy of the Pydio Nginx configuration<br />
# cp /usr/share/doc/pydio/nginx.conf.sample /etc/webapps/pydio/nginx.conf<br />
replace the domain name<br />
# sed -i 's/pydio.example.com/localhost/g' /etc/webapps/pydio/nginx.conf<br />
and reference this configuration file in the main nginx.conf:<br />
{{hc|/etc/nginx/nginx.conf|<br />
<nowiki><br />
http {<br />
[...]<br />
include /etc/webapps/pydio/nginx.conf;<br />
[...]<br />
}<br />
</nowiki>}}<br />
Here's an example on how you could setup a database for Pydio with [[MariaDB]] called {{ic|pydio}} for the user {{ic|pydio}} identified by the password {{ic|password}}:<br />
{{bc|<br />
CREATE DATABASE pydio;<br />
GRANT ALL PRIVILEGES ON pydio.* TO pydio@'localhost' IDENTIFIED BY 'pydio';<br />
FLUSH PRIVILEGES;<br />
}}<br />
Do not forget to (re)start your services (e.g. {{ic|nginx.service}} and {{ic|php-fpm.service}})!<br />
<br />
Visit the installation wizard page at http://127.0.0.1/ and follow the instructions.<br />
<br />
== See also ==<br />
* [https://pyd.io/archlinux/ Official ArchLinux installation manual]</div>Brando56894https://wiki.archlinux.org/index.php?title=OpenLDAP&diff=449668OpenLDAP2016-09-06T22:03:49Z<p>Brando56894: removed the core.schema line since it already exists in the default config, and made a note regarding the samba.schema since it is MIA</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:openLDAP]]<br />
[[ru:OpenLDAP]]<br />
[[zh-CN:OpenLDAP]]<br />
{{Related articles start}}<br />
{{Related|LDAP Authentication}}<br />
{{Related|LDAP Hosts}}<br />
{{Related articles end}}<br />
<br />
OpenLDAP is an open-source implementation of the LDAP protocol. An LDAP server basically is a non-relational database which is optimised for accessing, but not writing, data. It is mainly used as an address book (for e.g. email clients) or authentication backend to various services (such as Samba, where it is used to emulate a domain controller, or [[LDAP authentication|Linux system authentication]], where it replaces {{ic|/etc/passwd}}) and basically holds the user data.<br />
<br />
{{note|Commands related to OpenLDAP that begin with {{ic|ldap}} (like {{ic|ldapsearch}}) are client-side utilities, while commands that begin with {{ic|slap}} (like {{ic|slapcat}}) are server-side.}}<br />
<br />
This page is a starting point for a basic OpenLDAP installation and a sanity check.<br />
<br />
{{Tip|Directory services are an enormous topic. Configuration can therefore be complex. If you are totally new to those concepts, [http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html this] is an good introduction that is easy to understand and that will get you started, even if you are new to everything LDAP.}}<br />
<br />
== Installation ==<br />
<br />
OpenLDAP contains both a LDAP server and client. [[Install]] it with the package {{Pkg|openldap}}.<br />
<br />
== Configuration ==<br />
<br />
=== The server ===<br />
<br />
{{Note|If you already have an OpenLDAP database on your machine, remove it by deleting everything inside {{ic|/var/lib/openldap/openldap-data/}}.}}<br />
<br />
The server configuration file is located at {{ic|/etc/openldap/slapd.conf}}.<br />
<br />
Edit the suffix and rootdn. The suffix typically is your domain name but it does not have to be. It depends on how you use your directory. We will use ''example'' for the domain name, and ''com'' for the tld. The rootdn is your LDAP administrator's name (we will use ''root'' here).<br />
{{bc|<nowiki><br />
suffix "dc=example,dc=com"<br />
rootdn "cn=root,dc=example,dc=com"<br />
</nowiki>}}<br />
<br />
Now we delete the default root password and create a strong one:<br />
# sed -i "/rootpw/ d" /etc/openldap/slapd.conf #find the line with rootpw and delete it<br />
# echo "rootpw $(slappasswd)" >> /etc/openldap/slapd.conf #add a line which includes the hashed password output from slappasswd<br />
<br />
You will likely want to add some typically used [http://www.openldap.org/doc/admin24/schema.html schemas] to the top of {{ic|slapd.conf}}:<br />
<br />
{{Note|currently missing: <br />
cp /usr/share/doc/samba/examples/LDAP/samba.schema /etc/openldap/schema}}<br />
<br />
{{bc|<br />
include /etc/openldap/schema/cosine.schema<br />
include /etc/openldap/schema/inetorgperson.schema<br />
include /etc/openldap/schema/nis.schema<br />
#include /etc/openldap/schema/samba.schema<br />
}}<br />
<br />
You will likely want to add some typically used [http://www.openldap.org/doc/admin24/tuning.html#Indexes indexes] to the bottom of {{ic|slapd.conf}}:<br />
{{bc|<br />
index uid pres,eq<br />
index mail pres,sub,eq<br />
index cn pres,sub,eq<br />
index sn pres,sub,eq<br />
index dc eq<br />
}}<br />
<br />
Now prepare the database directory. You will need to copy the default config file and set the proper ownership:<br />
# cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG<br />
<br />
{{Note|With OpenLDAP 2.4 the configuration of {{ic|slapd.conf}} is deprecated. From this version on all configuration settings are stored in {{ic|/etc/openldap/slapd.d/}}.}}<br />
<br />
To store the recent changes in {{ic|slapd.conf}} to the new {{ic|/etc/openldap/slapd.d/}} configuration settings, we have to delete the old configuration files first, do this every time you change the configuration:<br />
<br />
# rm -rf /etc/openldap/slapd.d/*<br />
<br />
<br />
(if you do not have a database yet, you might need to create one by starting and stopping the {{ic|slapd.service}} [[systemd#Using units|using systemd]] )<br />
<br />
Then we generate the new configuration with:<br />
<br />
# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/<br />
<br />
The above command has to be run every time you change {{ic|slapd.conf}}. Check if everything succeeded. Ignore message "bdb_monitor_db_open: monitoring disabled; configure monitor database to enable". <br />
<br />
Change ownership recursively on the new files and directory in /etc/openldap/slapd.d:<br />
<br />
# chown -R ldap:ldap /etc/openldap/slapd.d<br />
<br />
<br />
{{note|Index the directory after you populate it. You should stop slapd before doing this.<br />
# slapindex<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
or just<br />
<br />
$ sudo -u ldap slapindex<br />
}}<br />
<br />
Finally, start the slapd daemon with {{ic|slapd.service}} using systemd.<br />
<br />
=== The client ===<br />
The client config file is located at {{ic|/etc/openldap/ldap.conf}}. <br />
<br />
It is quite simple: you will only have to alter {{ic|BASE}} to reflect the suffix of the server, and {{ic|URI}} to reflect the address of the server, like:<br />
<br />
{{hc|/etc/openldap/ldap.conf|2=<br />
BASE dc=example,dc=com<br />
URI ldap://localhost<br />
}}<br />
<br />
If you decide to use SSL:<br />
<br />
* The protocol (ldap or ldaps) in the {{ic|URI}} entry has to conform with the slapd configuration<br />
* If you decide to use self-signed certificates, add a {{ic|TLS_REQCERT allow}} line to {{ic|ldap.conf}}<br />
* If you use a signed certificate from a CA, add the line {{ic|TLS_CACERTDIR /usr/share/ca-certificates/trust-source}} in {{ic|ldap.conf}}.<br />
<br />
=== Create initial entry ===<br />
Once your client is configured, you probably want to create the root entry, and an entry for the root role:<br />
<br />
$ ldapadd -x -D 'cn=root,dc=example,dc=com' -W<br />
dn: dc=example,dc=com<br />
objectClass: dcObject<br />
objectClass: organization<br />
dc: example<br />
o: Example<br />
description: Example directory<br />
<br />
dn: cn=root,dc=example,dc=com<br />
objectClass: organizationalRole<br />
cn: root<br />
description: Directory Manager<br />
^D<br />
<br />
The text after the first line is entered on stdin, or could be read from a file either with the -f option or a file redirect.<br />
<br />
=== Test your new OpenLDAP installation ===<br />
<br />
This is easy, just run the command below:<br />
$ ldapsearch -x '(objectclass=*)'<br />
<br />
Or authenticating as the rootdn (replacing {{ic|-x}} by {{ic|-D <user> -W}}), using the example configuration we had above:<br />
$ ldapsearch -D "cn=root,dc=example,dc=com" -W '(objectclass=*)'<br />
<br />
Now you should see some information about your database.<br />
<br />
=== OpenLDAP over TLS ===<br />
{{Note|[http://www.openldap.org/doc/admin24/ upstream documentation] is much more useful/complete than this section}}<br />
<br />
If you access the OpenLDAP server over the network and especially if you have sensitive data stored on the server you run the risk of someone sniffing your data which is sent clear-text. The next part will guide you on how to setup an SSL connection between the LDAP server and the client so the data will be sent encrypted.<br />
<br />
In order to use TLS, you must have a certificate. For testing purposes, a ''self-signed'' certificate will suffice. To learn more about certificates, see [[OpenSSL]].<br />
<br />
{{Warning|OpenLDAP cannot use a certificate that has a password associated to it.}}<br />
<br />
==== Create a self-signed certificate ====<br />
To create a ''self-signed'' certificate, type the following:<br />
$ openssl req -new -x509 -nodes -out slapdcert.pem -keyout slapdkey.pem -days 365<br />
<br />
You will be prompted for information about your LDAP server. Much of the information can be left blank. The most important information is the common name. This must be set to the DNS name of your LDAP server. If your LDAP server's IP address resolves to example.org but its server certificate shows a CN of bad.example.org, LDAP clients will reject the certificate and will be unable to negotiate TLS connections (apparently the results are wholly unpredictable).<br />
<br />
Now that the certificate files have been created copy them to {{ic|/etc/openldap/ssl/}} (create this directory if it does not exist) and secure them. <br />
{{ic|slapdcert.pem}} must be world readable because it contains the public key. {{ic|slapdkey.pem}} on the other hand should only be readable for the ldap user for security reasons:<br />
# mv slapdcert.pem slapdkey.pem /etc/openldap/ssl/<br />
# chmod -R 755 /etc/openldap/ssl/<br />
# chmod 400 /etc/openldap/ssl/slapdkey.pem<br />
# chmod 444 /etc/openldap/ssl/slapdcert.pem<br />
# chown ldap /etc/openldap/ssl/slapdkey.pem<br />
<br />
==== Configure slapd for SSL ====<br />
Edit the daemon configuration file ({{ic|/etc/openldap/slapd.conf}}) to tell LDAP where the certificate files reside by adding the following lines:<br />
{{bc|<br />
# Certificate/SSL Section<br />
TLSCipherSuite DEFAULT<br />
TLSCertificateFile /etc/openldap/ssl/slapdcert.pem<br />
TLSCertificateKeyFile /etc/openldap/ssl/slapdkey.pem<br />
}}<br />
<br />
If you are using a signed SSL Certificate from a certification authority such as [[Let’s Encrypt]], you will also need to specify the path to the root certificates database and your intermediary certificate. You will also need to change ownership of the {{ic|.pem}} files and intermediary directories to make them readable to the user {{ic|ldap}}:<br />
{{bc|<br />
# Certificate/SSL Section<br />
TLSCipherSuite DEFAULT<br />
TLSCertificateFile /etc/letsencrypt/live/ldap.my-domain.com/cert.pem<br />
TLSCertificateKeyFile /etc/letsencrypt/live/ldap.my-domain.com/privkey.pem<br />
TLSCACertificateFile /etc/letsencrypt/live/ldap.my-domain.com/chain.pem<br />
TLSCACertificatePath /usr/share/ca-certificates/trust-source<br />
}}<br />
<br />
The TLSCipherSuite specifies a list of OpenSSL ciphers from which slapd will choose when negotiating TLS connections, in decreasing order of preference. In addition to those specific ciphers, you can use any of the wildcards supported by OpenSSL. '''NOTE:''' DEFAULT is a wildcard. See {{ic|man ciphers}} for description of ciphers, wildcards and options supported.<br />
<br />
{{Note|To see which ciphers are supported by your local OpenSSL installation, type the following: {{ic|openssl ciphers -v ALL:COMPLEMENTOFALL}}. Always test which ciphers will actually be enabled by TLSCipherSuite by providing it to OpenSSL command, like this: {{ic|openssl ciphers -v 'DEFAULT'}} }}<br />
<br />
Regenerate the configuration directory:<br />
# rm -rf /etc/openldap/slapd.d/* # erase old config settings<br />
# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d/ # generate new config directory from config file<br />
# chown -R ldap:ldap /etc/openldap/slapd.d # Change ownership recursively to ldap on the config directory<br />
<br />
==== Start slapd with SSL ====<br />
You will have to edit {{ic|slapd.service}} to change to protocol slapd listens on.<br />
<br />
Create the override unit:<br />
{{hc|systemctl edit slapd.service|<nowiki><br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/slapd -u ldap -g ldap -h "ldaps:///"</nowiki>}}<br />
<br />
Localhost connections do not need to use SSL. So, if you want to access the server locally you should change the {{ic|ExecStart}} line to:<br />
ExecStart=/usr/bin/slapd -u ldap -g ldap -h "ldap://127.0.0.1 ldaps:///"<br />
<br />
Then [[restart]] {{ic|slapd.service}}. If it was enabled before, reenable it now.<br />
<br />
{{Note|If you created a self-signed certificate above, be sure to add {{ic|TLS_REQCERT allow}} to {{ic|/etc/openldap/ldap.conf}} on the client, or it will not be able connect to the server.}}<br />
<br />
== Next Steps ==<br />
<br />
You now have a basic LDAP installation. The next step is to design your directory. The design is heavily dependent on what you are using it for. If you are new to LDAP, consider starting with a directory design recommended by the specific client services that will use the directory ([[PAM]], [[Postfix]], etc).<br />
<br />
A directory for system authentication is the [[LDAP authentication]] article.<br />
<br />
A nice web frontend is [[phpLDAPadmin]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Client Authentication Checking ===<br />
If you cannot connect to your server for non-secure authentication<br />
<br />
$ ldapsearch -x -H ldap://ldaservername:389 -D cn=Manager,dc=example,dc=exampledomain<br />
<br />
and for TLS secured authentication with:<br />
<br />
$ ldapsearch -x -H ldaps://ldaservername:636 -D cn=Manager,dc=example,dc=exampledomain<br />
<br />
=== LDAP Server Stops Suddenly ===<br />
<br />
If you notice that slapd seems to start but then stops, try running:<br />
<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
to allow slapd write access to its data directory as the user "ldap".<br />
<br />
=== LDAP Server Doesn't Start ===<br />
<br />
Try starting the server from the command line with debugging output enabled:<br />
<br />
# slapd -u ldap -g ldap -h ldaps://ldaservername:636 -d Config,Stats<br />
<br />
== See Also ==<br />
* [http://www.openldap.org/doc/admin24/ Official OpenLDAP Software 2.4 Administrator's Guide]<br />
* [[phpLDAPadmin]] is a web interface tool in the style of phpMyAdmin.<br />
* [[LDAP authentication]]<br />
* {{AUR|apachedirectorystudio}} from the [[Arch User Repository]] is an Eclipse-based LDAP viewer. Works perfect with OpenLDAP installations.</div>Brando56894https://wiki.archlinux.org/index.php?title=ZFS_on_FUSE&diff=438753ZFS on FUSE2016-06-22T16:08:46Z<p>Brando56894: /* NFS shares */ changed from rc.d to systemd syntax</p>
<hr />
<div>[[Category:File systems]]<br />
{{Related articles start}}<br />
{{Related|ZFS}}<br />
{{Related|Experimenting with ZFS}}<br />
{{Related|Installing Arch Linux on ZFS}}<br />
{{Related articles end}}<br />
{{Accuracy|Be aware that this package is still using systemv init scripts.}}<br />
ZFS on FUSE/Linux is a project bringing the ZFS file system to Linux. Due to incompatible license with GPL it is argued that it cannot exist as a direct kernel module, however, this does not apply for implementation as a FUSE file system.<br />
<br />
Some of the capabilities of version 0.7.0 (as of Feb 2012) are limited compared to original implementation (incomplete list):<br />
<br />
* sharenfs uses different syntax than on Solaris;<br />
* it is possible to create snapshots, however, they have to be cloned to another disk to actually be able to browse the file system (due to missing .zfs special directory).<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{AUR|zfs-fuse}}{{Broken package link|{{aur-mirror|zfs-fuse}}}} from the [[AUR]].<br />
<br />
Read the messages after installation and be sure to edit the configuration files as per your needs.<br />
<br />
Further, make sure that fuse module is loaded (as root):<br />
<br />
# modprobe fuse<br />
<br />
Start zfs-fuse daemon:<br />
<br />
# rc.d start zfs-fuse<br />
<br />
You will want to add "fuse" module to MODULES array in /etc/rc.conf and the zfs-fuse to the DAEMONS array to have it started after reboot.<br />
<br />
== Usage ==<br />
<br />
=== Quick setup guide ===<br />
<br />
Search on Google how ZFS works. Be sure, which block device you specify and better backup before continueing!<br />
<br />
Briefly, you will want to create a pool (as root): <br />
{{Warning|Always try to use id names instead when working with ZFS, otherwise import errors will occur.}}<br />
# zpool create mypool /dev/disk/by-id/''id-to-partition''<br />
Alternatively:<br />
# zpool create mypool /dev/sdb<br />
<br />
This will create a "pool" called "mypool" on physical block device {{ic|/dev/sdb}} (on whole disk, not on a single partition). Also, a first dataset (aka zfs file system) with the same name will be created and automatically mounted to {{ic|/mypool}}.<br />
<br />
You can create other datasets (file systems) within the pool. The reason for doing so is to be able to set various properties on them, to be able to create snapshots independently, etc.<br />
<br />
# zfs create mypool/my1stdataset <br />
<br />
Note that "mypool" is a reference to an existing pool, not to the mount point (which is {{ic|/mypool}} at the moment).<br />
<br />
==== Automatically mount pools and datasets on boot ====<br />
<br />
Pools and datasets can be mounted during boot by adding them to the arrays in {{ic|/etc/conf.d/zfs-fuse}}.<br />
<br />
If you like to have all pools and all datasets mounted you can add a {{ic|-a}} in the array:<br />
<br />
ZFS_IMPORT=("-a")<br />
<br />
If you like to have all datasets mounted add {{ic|-a}} in that array as well:<br />
<br />
ZFS_MOUNT=("-a")<br />
<br />
=== NFS shares ===<br />
<br />
ZFS can export datasets (file systems) as NFS without the need to place the directories in {{ic|/etc/exports}}.<br />
<br />
The nfs-kernel daemon should be installed and started:<br />
<br />
# pacman -S nfs-utils<br />
# systemctl start nfs-kernel<br />
<br />
Enable and Start the nfs-fuse daemon.<br />
<br />
# systemctl enable nfs-fuse.service<br />
# systemctl start nfs-fuse.service<br />
<br />
The syntax of setting the NFS share is:<br />
<br />
# zfs set sharenfs="host1:option1,option2,option3 host2:option1,...,optionN" dataset_name<br />
# zfs set sharenfs="192.168.1.1/24:ro 192.168.1.3:rw" mypool/my1stdataset<br />
<br />
The exported shares and their options can be listed as follows:<br />
<br />
# cat /var/lib/nfs/etab<br />
<br />
{{Note|<br />
* It does not work to use only {{ic|zfs set sharenfs&#61;on mypool/my1stdataset}} - it is not possible to mount such a share from other computers.<br />
* Only NFS version 3 seems to be supported for readonly ({{ic|ro}}) shares (use {{ic|mount servername:/mypool/my1stdataset /mnt -o vers&#613,defaults}} to force that version)<br />
* It does not work to use "*" as shortcut for any host name. Use the actual IP address/mask of NFS clients list.<br />
* Running subsequent {{ic|zfs set sharenfs&#61;"10.1.0.3:rw" mypool/my1stdataset}} will ''add'' the extra host to the existing exports.<br />
* To remove existing exports, run {{ic|zfs set sharenfs&#61;off mypool/my1stdataset}}.<br />
* To enable sharing after reboot, put {{ic|zfs share -a" to your /etc/rc.local}}.<br />
* It is possible to use also the regular way of exporting NFS shares via {{ic|/etc/exports}}, however, do not set it up for the shares, which are exported by ZFS directly!<br />
}}</div>Brando56894https://wiki.archlinux.org/index.php?title=User_talk:Plfiorini&diff=372471User talk:Plfiorini2015-05-04T04:38:09Z<p>Brando56894: /* Hawaii */</p>
<hr />
<div>== Hawaii ==<br />
<br />
Hi, judging from your username, I suppose you are a Hawaii dev[https://github.com/plfiorini], so I guess you're allowed to edit the Hawaii article like [https://wiki.archlinux.org/index.php?title=Hawaii&curid=17658&diff=364913&oldid=360708], but if you could please justify your edits a bit, as explained in [[ArchWiki:Contributing#The_3_fundamental_rules]] you would make life much easier for the wiki staff, thank you. Can you explain the removal of the reference to [[Unofficial user repositories#hawaii]]? If there's something wrong with it, it should be pointed out also in that article. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 04:24, 11 March 2015 (UTC)<br />
<br />
: Hi, Yes I am the Hawaii dev. The binary packages archive is not supported anymore: now all dependencies (except for hawaii-qt5-wayland-git until all of my patches are approved by other upstream developers, which will likely happen in time for Qt 5.5) are now available on Arch so users only have to build Hawaii packages. Maintaining binary packages for Arch has proven to be difficult because of the rolling nature, it was meant to help users try the desktop without building large packages such as Qt but this is no longer needed. - [[User:Plfiorini|Plfiorini]] ([[User talk:Plfiorini|talk]]) 06:34, 11 March 2015 (UTC)<br />
<br />
::I see, I've [https://wiki.archlinux.org/index.php?title=Unofficial_user_repositories&diff=365090&oldid=364612 removed] the repo from [[Unofficial user repositories]] then, thank you. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:28, 12 March 2015 (UTC)<br />
<br />
<br />
Hawaii Wouldn't compile for me without plasma-framework, so that's why I added it in to the wiki.</div>Brando56894https://wiki.archlinux.org/index.php?title=Liri&diff=371955Liri2015-04-30T21:31:25Z<p>Brando56894: /* Installation */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[ja:Hawaii]]<br />
{{Related articles start}}<br />
{{Related|Wayland}}<br />
{{Related|Desktop environment}}<br />
{{Related|Display manager}}<br />
{{Related|Window manager}}<br />
{{Related|Qt}}<br />
{{Related articles end}}<br />
<br />
From [http://www.phoronix.com/scan.php?page=news_item&px=MTI4ODA phoronix.com]:<br />
:The Hawaii Desktop is looking to be the very first [[Wayland]]-friendly desktop environment for Linux.<br />
<br />
{{Warning|The Hawaii desktop environment has not reached its stable 1.0 release.}}<br />
<br />
== Installation ==<br />
<br />
Install {{AUR|hawaii-meta-git}} from the [[Arch User Repository]].<br />
<br />
Make sure you also have {{Pkg|weston}} and {{Pkg|plasma-framework}} installed.<br />
<br />
== Run hawaii ==<br />
<br />
Log in to a tty and type:<br />
{{bc|1=$ hawaii-session --mode=nested}}<br />
<br />
With nested mode, Hawaii will run nested into Weston with the full screen shell plugin.<br />
This is the preferred mode until Qt 5.5 is released, in fact it will be the first Qt release to ship with fully function kms support hence Hawaii won't need another compositor to run.<br />
<br />
{{Note|Do not use ~/.xinitrc to start hawaii. [[Xinit]] is commonly used to start [[Xorg]], but hawaii uses Wayland, which is a newer graphical protocol.}}<br />
<br />
== See also ==<br />
<br />
* https://github.com/hawaii-desktop Hawaii's github page</div>Brando56894https://wiki.archlinux.org/index.php?title=Wayland&diff=369167Wayland2015-04-09T23:50:48Z<p>Brando56894: /* Window managers and desktop shells */ Added Information regarding Nested Kwin support for Wayland in KDE 5.3 and it's planned inclusion in KDE 5.4.</p>
<hr />
<div>[[Category:X Server]]<br />
[[es:Wayland]]<br />
[[fr:Wayland]]<br />
[[ja:Wayland]]<br />
[[ru:Wayland]]<br />
[[zh-CN:Wayland]]<br />
{{Related articles start}}<br />
{{Related|KMS}}<br />
{{Related|Xorg}}<br />
{{Related|Mir}}<br />
{{Related articles end}}<br />
'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].<br />
<br />
{{Warning|Wayland is still under development and some features may be incomplete.}}<br />
<br />
== Requirements ==<br />
<br />
Currently Wayland will only work on systems utilizing [[KMS]].<br />
<br />
== Installation ==<br />
<br />
Wayland is most likely installed on your system already, as it is an indirect dependency of {{Pkg|gtk2}} and {{Pkg|gtk3}}. If it is not installed, you will find the {{Pkg|wayland}} package in the [[official repositories]].<br />
<br />
== Usage ==<br />
<br />
As Wayland is only a library, it is useless on its own. To replace X Server, you need a compositor (like Weston).<br />
<br />
== Weston ==<br />
<br />
=== Installation ===<br />
<br />
You need to install {{Pkg|weston}} from the official repositories.<br />
<br />
=== Usage ===<br />
<br />
{| class="wikitable" style="float: right; width: 200px;"<br />
|+ '''''Keyboard Shortcuts''' (super = windows key - can be changed, see weston.ini)'' {{Ic|Ctrl-b}}<br />
!Cmd<br />
!Action<br />
|-<br />
|Ctrl + Alt + Backspace<br />
|Quit Weston<br />
|-<br />
|Super + Scroll (or PageUp/PageDown)<br />
|Zoom in/out of desktop<br />
|-<br />
|Super + Tab<br />
|Switch windows<br />
|-<br />
|Super + LMB<br />
|Move Window<br />
|-<br />
|Super + MMB<br />
|Resize Window<br />
|-<br />
|Super + RMB<br />
|Rotate Window !<br />
|-<br />
|Super + Alt + Scroll<br />
|Change window opacity<br />
|-<br />
|Super + K<br />
|Force Kill Active Window<br />
|-<br />
|Super + KeyUp/KeyDown<br />
|Switch Prev/Next Workspace<br />
|-<br />
|Super + Shift + KeyUp/KeyDown<br />
|Grab Current Window and Switch Workspace<br />
|-<br />
|Super + F'''''n'''''<br />
|Switch to Workspace '''''n'''''<br />
|-<br />
|Super + S<br />
|Take a screenshot<br />
|-<br />
|Super + R<br />
|Record a screencast.<br />
|}<br />
<br />
Now that Wayland and its requirements are installed you should be ready to test it out. <br />
<br />
It is possible to run Weston inside a running X session:<br />
$ weston<br />
<br />
Alternatively, to launch Weston natively, try switching to a terminal and running:<br />
$ weston-launch<br />
<br />
Then at a TTY within Weston, you can run the demos. To launch a terminal emulator:<br />
$ weston-terminal<br />
<br />
To move flowers around the screen:<br />
$ weston-flower <br />
<br />
To test the frame protocol (runs {{ic|glxgears}}):<br />
$ weston-gears<br />
<br />
To display images:<br />
$ weston-image image1.jpg image2.jpg...<br />
<br />
To display PDF Files:<br />
$ weston-view doc1.pdf doc2.pdf...<br />
<br />
=== Configuration ===<br />
Example configuration file for keyboard layout, module selection and UI modifications. See {{ic|man weston.ini}} for full details:<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
### uncomment this line for xwayland support ###<br />
#modules=xwayland.so<br />
<br />
[shell]<br />
background-image=/usr/share/backgrounds/gnome/Aqua.jpg<br />
background-color=0xff002244<br />
panel-color=0x90ff0000<br />
locking=true<br />
animation=zoom<br />
#binding-modifier=ctrl<br />
#num-workspaces=6<br />
### for cursor themes install xcursor-themes pkg from Extra. ###<br />
#cursor-theme=whiteglass<br />
#cursor-size=24<br />
<br />
### tablet options ###<br />
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png<br />
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg<br />
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg<br />
#animation=fade<br />
<br />
[keyboard]<br />
keymap_rules=evdev<br />
#keymap_layout=gb<br />
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel<br />
### keymap_options from /usr/share/X11/xkb/rules/base.lst ###<br />
<br />
<br />
[terminal]<br />
#font=DroidSansMono<br />
#font-size=14<br />
<br />
<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/gnome-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/arts.png<br />
path=./clients/flower<br />
<br />
[screensaver]<br />
# Uncomment path to disable screensaver<br />
path=/usr/libexec/weston-screensaver<br />
duration=600<br />
<br />
[input-method]<br />
path=/usr/libexec/weston-keyboard<br />
<br />
### for Laptop displays ###<br />
#[output]<br />
#name=LVDS1<br />
#mode=1680x1050<br />
#transform=90<br />
<br />
#[output]<br />
#name=VGA1<br />
# The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility<br />
#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync<br />
#transform=flipped<br />
<br />
#[output]<br />
#name=X1<br />
#mode=1024x768<br />
#transform=flipped-270</nowiki><br />
}}<br />
<br />
Minimal {{ic|weston.ini}} :<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so<br />
<br />
[keyboard]<br />
keymap_layout=gb<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
<br />
[output]<br />
name=LVDS1<br />
mode=1680x1050<br />
transform=90</nowiki><br />
}}<br />
<br />
==== XWayland ====<br />
You can find an official {{Pkg|xorg-server-xwayland}} package in extra.<br />
<br />
When you want to run an X application from within Weston, it spins up Xwayland to service the request. The following configuration file is required:<br />
<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so</nowiki><br />
}}<br />
<br />
==== Screencast recording ====<br />
Weston has build-in screencast recording which can be started and stopped by pressing the '''Super''' + '''R''' key combination. Screencasts are saved to the file {{ic|capture.wcap}} in the current working directory of Weston. <br />
<br />
The WCAP format is a lossless video format specific to Weston, which only records the difference in frames. To be able to play the recorded screencast, the WCAP file will need to be converted to a format which a media player can understand. <br />
<br />
To convert the file to webm, execute:<br />
<br />
$ wcap-decode capture.wcap --yuv4mpeg2 | vpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -<br />
<br />
To convert the file to ogv, execute:<br />
<br />
$ wcap-decode capture.wcap --yuv4mpeg2 | theora_encode - -o cap.ogv<br />
<br />
==== High DPI displays ====<br />
Use<br />
{{hc|~/.config/weston.ini|<br />
<nowiki><br />
[output]<br />
name=...<br />
scale=2<br />
</nowiki><br />
}}<br />
for "retina" or "HiDPI" displays.<br />
<br />
== GUI libraries ==<br />
<br />
See details on the [http://wayland.freedesktop.org/toolkits.html official website].<br />
<br />
=== GTK+ 3 ===<br />
<br />
The {{Pkg|gtk3}} package from the official repositories now has the Wayland backend enabled.<br />
<br />
GTK+ 3 gained support for multiple backends at runtime and can switch between backends in the same way Qt can with lighthouse.<br />
<br />
When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by modifying an environment variable: {{ic|GDK_BACKEND&#61;wayland}}.<br />
<br />
=== Qt 5 ===<br />
You need to install {{Pkg|qt5-wayland}}. <br />
To run a Qt 5 app with the Wayland plugin, set the {{ic|1=QT_QPA_PLATFORM=wayland-egl}} [[environment variable]].<br />
<br />
=== Clutter ===<br />
<br />
The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is enabled in the official package in extra.<br />
<br />
To run a Clutter app on Wayland, set {{ic|CLUTTER_BACKEND&#61;wayland}}.<br />
<br />
=== SDL ===<br />
<br />
Experimental wayland support is now in SDL 2.0.2 and enabled by default on Arch Linux.<br />
<br />
To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.<br />
<br />
=== GLFW ===<br />
<br />
Experimental wayland support is now in GLFW 3.1 and can be enabled with a CMake option at compile time. You can also install the package {{AUR|glfw3-git}} from the AUR and add {{ic|-DGLFW_USE_WAYLAND&#61;ON}} to the CMake flags.<br />
<br />
=== EFL ===<br />
<br />
EFL has complete Wayland support. <br />
To run a EFL application on Wayland, see Wayland [http://wayland.freedesktop.org/efl.html project page].<br />
<br />
== Window managers and desktop shells ==<br />
<br />
=== GNOME ===<br />
<br />
{{Warning| Gnome Wayland session will not launch unless you have {{pkg|xorg-server-xwayland}} installed.}}<br />
With version 3.14, [[GNOME]] supports running the desktop using Wayland. The Gnome compositor can be run without using X, and will act as a Wayland system compositor. It is considered stable for production use, but there are still some features that are not yet supported (refer Gnome documentation). Under this desktop, applications using X will run using XWayland.<br />
<br />
To start up a Gnome Wayland session, GDM login manager needs to be used, and the user must select the "Gnome on Wayland" session before logging in.<br />
<br />
=== Hawaii ===<br />
<br />
See [[Hawaii]].<br />
<br />
=== i3 ===<br />
<br />
Some developers from [[i3]] are thinking of starting [http://www.i3way.org/ a completely new project] for implementing a shell plugin for Weston to implement the same features and style of i3.<br />
<br />
=== KDE ===<br />
<br />
[[KDE]] 4.11 added support for [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. Since KDE 5.3 [https://community.kde.org/KWin/Wayland/ KWin is also able to be run nested] and can start an Xwayland server to support X11 clients under Wayland. Support for Wayland clients is planned for KDE 5.4.<br />
<br />
=== Orbment ===<br />
<br />
[https://github.com/Cloudef/orbment orbment] (previously loliwm) is a tiling WM for Wayland.<br />
<br />
=== Velox ===<br />
<br />
[https://github.com/michaelforney/velox velox] is a simple window manager based on swc. It is inspired by [[dwm]] and [[xmonad]].<br />
<br />
=== Orbital ===<br />
<br />
[https://github.com/giucam/orbital Orbital] is a Wayland compositor and shell, using Qt5 and Weston. The goal of the project is to build a simple yet flexible and good looking Wayland desktop. It is not a full fledged DE but rather the analogue of a WM in the X11 world, such as [[Awesome]] or [[Fluxbox]].<br />
<br />
=== Papyros Shell ===<br />
<br />
[https://github.com/papyros/papyros-shell Papyros Shell] is the desktop shell for [http://papyros.io Papyros], built using QtQuick and QtCompositor as a compositor for Wayland.<br />
<br />
=== Maynard ===<br />
<br />
[https://github.com/raspberrypi/maynard Maynard] is a desktop shell client for Weston based on GTK. It was based on weston-gtk-shell, a project by Tiago Vignatti.<br />
<br />
=== Motorcar ===<br />
<br />
[https://github.com/evil0sheep/motorcar Motorcar] is a wayland compositor to explore 3D windowing.<br />
<br />
==Troubleshooting==<br />
<br />
=== LLVM assertion failure ===<br />
If you get an LLVM assertion failure, you need to rebuild {{Pkg|mesa}} without Gallium LLVM until this problem is fixed. <br />
<br />
This may imply disabling some drivers which require LLVM.<br />
You may also try exporting the following, if having problems with hardware drivers: <br />
<br />
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so<br />
<br />
=== Weston fails to launch after update to 1.7 ===<br />
This is possibly caused by the `desktop-shell.so` module being loaded by your weston.ini. This used to be required, but is not anymore.<br />
<br />
To remove it simply look for a line similar to this line.<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so,desktop-shell.so</nowiki><br />
}}<br />
Remove the `desktop-shell.so` from that line. <br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so</nowiki><br />
}}<br />
<br />
=== mouse click fail for chrome/chromium in weston+xwayland ===<br />
Chrome/chromium could launch from weston, but only keyboard works, no mouse click work.<br />
It is a weston [https://bugs.freedesktop.org/show_bug.cgi?id=89178 bug]. Chrome works well in other wayland compositors, like loliwm<br />
<br />
== See also ==<br />
* [[Cursor Themes]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion]<br />
* [http://wayland.freedesktop.org/docs/html/ Wayland documentation online]<br />
* [http://www.chaosreigns.com/wiki/Wayland_State Wayland usability wiki]</div>Brando56894https://wiki.archlinux.org/index.php?title=Makepkg&diff=343591Makepkg2014-11-06T22:31:52Z<p>Brando56894: changed 'noexec' to exec since using the noexec mount flag gives "/bin/sh: Permission denied"</p>
<hr />
<div>{{DISPLAYTITLE:makepkg}}<br />
[[Category:Package development]]<br />
[[Category:About Arch]]<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[es:Makepkg]]<br />
[[fr:makepkg]]<br />
[[it:Makepkg]]<br />
[[ja:Makepkg]]<br />
[[nl:Makepkg]]<br />
[[pt:Makepkg]]<br />
[[ru:Makepkg]]<br />
[[sr:Makepkg]]<br />
[[tr:Makepkg]]<br />
[[zh-CN:Makepkg]]<br />
{{Related articles start}}<br />
{{Related|Creating packages}}<br />
{{Related|PKGBUILD}}<br />
{{Related|Arch User Repository}}<br />
{{Related|pacman}}<br />
{{Related|Official repositories}}<br />
{{Related|Arch Build System}}<br />
{{Related articles end}}<br />
<br />
makepkg is used for compiling and building packages suitable for installation with [[pacman]], Arch Linux's package manager. makepkg is a script that automates the building of packages; it can download and validate source files, check dependencies, configure build-time settings, compile the sources, install into a temporary root, make customizations, generate meta-info, and package everything together.<br />
<br />
makepkg is provided by the {{Pkg|pacman}} package.<br />
<br />
== Configuration ==<br />
{{ic|/etc/makepkg.conf}} is the main configuration file for makepkg. Most users will wish to fine-tune makepkg configuration options prior to building any packages. You also might create a {{ic|~/.makepkg.conf}} file.<br />
<br />
=== Architecture, compile flags ===<br />
The {{ic|MAKEFLAGS}}, {{ic|CFLAGS}}, and {{ic|CXXFLAGS}} options are used by {{Pkg|make}}, {{Pkg|gcc}}, and {{ic|g++}} whilst compiling software with makepkg. By default, these options generate generic packages that can be installed on a wide range of machines. A performance improvement can be achieved by tuning compilation for the host machine. The downside is that packages compiled specifically for the compiling host's processor may not run on other machines.<br />
<br />
{{Note|Do keep in mind that not all package build systems will use your exported variables. Some override them in the original Makefiles or the [[PKGBUILD]].}}<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
[...]<br />
<br />
#########################################################################<br />
# ARCHITECTURE, COMPILE FLAGS<br />
#########################################################################<br />
#<br />
CARCH="x86_64"<br />
CHOST="x86_64-unknown-linux-gnu"<br />
<br />
#-- Exclusive: will only run on x86_64<br />
# -march (or -mcpu) builds exclusively for an architecture<br />
# -mtune optimizes for an architecture, but builds for whole processor family<br />
CPPFLAGS="-D_FORTIFY_SOURCE=2"<br />
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"<br />
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"<br />
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"<br />
#-- Make Flags: change this for DistCC/SMP systems<br />
#MAKEFLAGS="-j2"<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
The default makepkg.conf {{ic|CFLAGS}} and {{ic|CXXFLAGS}} are compatible with all machines within their respective architectures. <br />
<br />
On x86_64 machines, there are rarely significant enough real world performance gains that would warrant investing the time to rebuild official packages.<br />
<br />
As of version 4.3.0, GCC offers the {{ic|1=-march=native}} switch that enables CPU auto-detection and automatically selects optimizations supported by the local machine at GCC runtime. To use it, just modify the default settings by changing the {{ic|CFLAGS}} and {{ic|CXXFLAGS}} lines as follows:<br />
<br />
# -march=native also sets the correct -mtune=<br />
CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
{{Tip|To see what {{ic|1=march=native}} flags are, run:<br />
<nowiki>$ gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'</nowiki><br />
}}<br />
<br />
Further optimizing for CPU type can theoretically enhance performance because {{ic|1=-march=native}} enables all available instruction sets and improves scheduling for a particular CPU. This is especially noticeable when rebuilding applications (for example: audio/video encoding tools, scientific applications, math-heavy programs, etc.) that can take heavy advantage of newer instructions sets not enabled when using the default options (or packages) provided by Arch Linux. <br />
<br />
It is very easy to reduce performance by using "non-standard" CFLAGS because compilers tend to heavily blow up the code size with loop unrolling, bad vectorization, crazy inlining, etc. depending on compiler switches. Unless you can verify/benchmark that something is faster, there is a very good chance it is not! <br />
<br />
See the GCC man page for a complete list of available options. The Gentoo [http://www.gentoo.org/doc/en/gcc-optimization.xml Compilation Optimization Guide] and [http://wiki.gentoo.org/wiki/Safe_CFLAGS Safe CFLAGS] wiki article provide more in-depth information.<br />
<br />
====MAKEFLAGS====<br />
The {{ic|MAKEFLAGS}} option can be used to specify additional options for make. Users with multi-core/multi-processor systems can specify the number of jobs to run simultaneously. This can be accomplished with the use of {{ic|nproc}} to determine the number of available processors, e.g. {{ic|-j4}} ''(where 4 is the output of {{ic|nproc}})''. Some [[PKGBUILD]]'s specifically override this with {{ic|-j1}}, because of race conditions in certain versions or simply because it is not supported in the first place. Packages that fail to build because of this should be [[Reporting Bug Guidelines|reported]] on the bug tracker (or in the case of [[AUR]] packages, to the package maintainer) after making sure that the error is indeed being caused by your MAKEFLAGS.<br />
<br />
See {{ic|man make}} for a complete list of available options.<br />
<br />
=== Package output ===<br />
Next, one can configure where source files and packages should be placed and identify themselves as the packager. This step is optional; packages will be created in the working directory where makepkg is run by default.<br />
<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
[...]<br />
<br />
#########################################################################<br />
# PACKAGE OUTPUT<br />
#########################################################################<br />
#<br />
# Default: put built package and cached source in build directory<br />
#<br />
#-- Destination: specify a fixed directory where all packages will be placed<br />
#PKGDEST=/home/packages<br />
#-- Source cache: specify a fixed directory where source files will be cached<br />
#SRCDEST=/home/sources<br />
#-- Source packages: specify a fixed directory where all src packages will be placed<br />
#SRCPKGDEST=/home/srcpackages<br />
#-- Packager: name/email of the person or organization building packages<br />
#PACKAGER="John Doe <john@doe.com>"<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
For example, create the directory:<br />
<br />
$ mkdir /home/$USER/packages<br />
<br />
Then modify the {{ic|PKGDEST}} variable in {{ic|/etc/makepkg.conf}} accordingly.<br />
<br />
The {{ic|PACKAGER}} variable will set the {{ic|packager}} value within compiled packages' {{ic|.PKGINFO}} metadata file. By default, user-compiled packages will display:<br />
<br />
{{hc|pacman -Qi package|<nowiki><br />
[...]<br />
Packager : Unknown Packager<br />
[...]<br />
</nowiki>}}<br />
<br />
Afterwards:<br />
<br />
{{hc|pacman -Qi package|<nowiki><br />
[...]<br />
Packager : John Doe <john@doe.com><br />
[...]<br />
</nowiki>}}<br />
<br />
This is useful if multiple users will be compiling packages on a system, or you are otherwise distributing your packages to other users.<br />
<br />
=== Signature checking ===<br />
The following procedure is not necessary for compiling with makepkg, for your initial configuration proceed to [[#Usage]]. To temporarily disable signature checking, call the makepkg command with the {{ic|--skippgpcheck}} option.<br />
If a signature file in the form of .sig is part of the [[PKGBUILD]] source array, makepkg validates the authenticity of source files. For example, the signature {{ic|pkgname-pkgver.tar.gz.sig}} is used to check the integrity of the file {{ic|pkgname-pkgver.tar.gz}} with the gpg program. If desired, signatures by other developers can be manually added to the GPG keyring. Look into the [[GnuPG]] article for further information.<br />
<br />
{{Note|The signature checking implemented in makepkg does not use pacman's keyring. Configure GPG, as explained below, to allow makepkg to read pacman's keyring.}}<br />
<br />
The GPG keys are expected to be stored in the user's {{ic|~/.gnupg/pubring.gpg}} file. In case it does not contain the given signature, makepkg shows a warning.<br />
{{hc|makepkg|<nowiki><br />
[...]<br />
==> Verifying source file signatures with gpg...<br />
pkgname-pkgver.tar.gz ... FAILED (unknown public key 1234567890)<br />
==> WARNING: Warnings have occurred while verifying the signatures.<br />
Please make sure you really trust them.<br />
[...]<br />
</nowiki>}}<br />
To show the current list of GPG keys, use the gpg command.<br />
{{bc|gpg --list-keys}}<br />
If the {{ic|pubring.gpg}} file does not exist, it will be created for you immediately.<br />
You can now proceed with configuring gpg to allow compiling AUR packages submitted by Arch Linux developers with successful signature checking.<br />
Add the following line to the end of your GPG configuration file to include the pacman keyring in your user's personal keyring.<br />
{{hc|~/.gnupg/gpg.conf|<nowiki><br />
[...]<br />
keyring /etc/pacman.d/gnupg/pubring.gpg<br />
</nowiki>}}<br />
When configured as before, the output of {{ic|gpg --list-keys}} contains a list of keyrings and developers. Now makepkg can compile AUR packages submitted by Arch Linux developers with successful signature checking.<br />
<br />
== Usage ==<br />
Before continuing, ensure the {{Grp|base-devel}} group is installed. Packages belonging to this group are not required to be listed as build-time (make) dependencies in [[PKGBUILD]] files. Install the "base-devel" group by issuing (as root):<br />
<br />
# pacman -S base-devel<br />
<br />
{{Note|Before complaining about missing (make) dependencies, remember that the {{Grp|base}} group is assumed to be installed on all Arch Linux systems. The group "base-devel" is assumed to be installed when building with ''makepkg'' or when using [[AUR helpers]].}}<br />
<br />
To build a package, one must first create a [[PKGBUILD]], or build script, as described in [[Creating packages]], or obtain one from the [[Arch Build System|ABS tree]], [[Arch User Repository]], or some other source. <br />
<br />
{{Warning|Only build and/or install packages from trusted sources.}}<br />
<br />
Once in possession of a {{ic|PKGBUILD}}, change to the directory where it is saved and issue the following command to build the package described by said {{ic|PKGBUILD}}:<br />
<br />
$ makepkg<br />
<br />
''makepkg'' will issue a warning when run as root. Besides how a {{ic|PKGBUILD}} may contain arbitrary commands, building as root is generally considered unsafe (see for example [https://bbs.archlinux.org/viewtopic.php?id=67561]).<br />
<br />
''makepkg'' may behave unexpectedly if certain environment variables are set. (For example, BUILDDIR.) It may be safest to invoke it as ''env -i makepkg''.<br />
<br />
To have makepkg clean out leftover files and folders, such as files extracted to the $srcdir, add the following option. This is useful for multiple builds of the same package or updating the package version, while using the same build folder. It prevents obsolete and remnant files from carrying over to the new builds.<br />
<br />
$ makepkg -c<br />
<br />
If required dependencies are missing, makepkg will issue a warning before failing. To build the package and install needed dependencies automatically, simply use the command:<br />
<br />
$ makepkg -s<br />
<br />
Note that these dependencies must be available in the configured repositories; see [[pacman#Repositories]] for details. Alternatively, one can manually install dependencies prior to building ({{ic|pacman -S --asdeps dep1 dep2}}).<br />
<br />
Once all dependencies are satisfied and the package builds successfully, a package file ({{ic|pkgname-pkgver.pkg.tar.xz}}) will be created in the working directory. To install, run (as root):<br />
<br />
# pacman -U pkgname-pkgver.pkg.tar.xz<br />
<br />
Alternatively, to install, using the {{ic|-i}} flag is an easier way of running {{ic|pacman -U pkgname-pkgver.pkg.tar.xz}}, as in:<br />
<br />
$ makepkg -i<br />
<br />
== Tips and Tricks ==<br />
=== Improving compile times ===<br />
<br />
==== tmpfs ====<br />
<br />
Compiling requires handling of many small files and involves many I/O operations; therefore moving its working directory to a [[tmpfs]] may bring significant improvements in build times. <br />
<br />
The {{ic|BUILDDIR}} value may be exported within a shell to temporarily set [[makepkg]] build directory to an existing tmpfs:<br />
$ BUILDDIR=/tmp/makepkg makepkg<br />
<br />
Relevant option in {{ic|/etc/makepkg.conf}} is to be found at the end of the {{ic|BUILD ENVIRONMENT}} section:<br />
{{hc|/etc/makepkg.conf|<nowiki><br />
[...]<br />
<br />
#########################################################################<br />
# BUILD ENVIRONMENT<br />
#########################################################################<br />
#<br />
# Defaults: BUILDENV=(fakeroot !distcc color !ccache check !sign)<br />
# A negated environment option will do the opposite of the comments below.<br />
#<br />
#-- fakeroot: Allow building packages as a non-root user<br />
#-- distcc: Use the Distributed C/C++/ObjC compiler<br />
#-- color: Colorize output messages<br />
#-- ccache: Use ccache to cache compilation<br />
#-- check: Run the check() function if present in the PKGBUILD<br />
#-- sign: Generate PGP signature file<br />
#<br />
BUILDENV=(fakeroot !distcc color !ccache check !sign)<br />
#<br />
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,<br />
#-- specify a space-delimited list of hosts running in the DistCC cluster.<br />
#DISTCC_HOSTS=""<br />
#<br />
#-- Specify a directory for package building.<br />
#BUILDDIR=/tmp/makepkg<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
Uncommenting the {{ic|1=BUILDDIR=/tmp/makepkg}} line and setting it to e.g. {{ic|1=BUILDDIR=/tmp/builds}} (or leaving it to its default value) will make use of Arch default {{ic|/tmp}} [[tmpfs]].<br />
{{Note|The [[tmpfs]] folder needs to be mounted without the {{ic|exec}} option, else it will prevent build scripts or utilities from being executed. Also, as stated in [[fstab#tmpfs]], its default size is half of the available RAM so you may run out of space.}}<br />
Please be reminded that any package compiled in [[tmpfs]] will not persist across reboot. Therefore, such packages should be installed consecutively to building or be moved to another (persistent) directory.<br />
<br />
==== ccache ====<br />
<br />
The use of [[ccache]] can improve build times by caching the results of compilations.<br />
<br />
=== Generate new checksums ===<br />
Since [http://allanmcrae.com/2013/04/pacman-4-1-released/ pacman 4.1], {{ic|makepkg -g >> PKGBUILD}} is no longer required because pacman-contrib was [https://projects.archlinux.org/pacman.git/tree/NEWS merged into upstream pacman], including the {{ic|updpkgsums}} script that will generate new checksums and/or replace them in the PKGBUILD. In the same directory as the PKGBUILD file, run the following command:<br />
$ updpkgsums<br />
<br />
=== Makepkg source PKGBUILD twice ===<br />
Makepkg sources the PKGBUILD twice (once when initially run, and the second time under fakeroot). Any non-standard functions placed in the PKGBUILD will be run twice as well.<br />
<br />
=== WARNING: Package contains reference to $srcdir ===<br />
Somehow, the literal strings {{ic|$srcdir}} or {{ic|$pkgdir}} ended up in one of the installed files in your package.<br />
<br />
To identify which files, run the following from the makepkg build directory:<br />
$ grep -R "$(pwd)/src" pkg/<br />
<br />
[http://www.mail-archive.com/arch-general@archlinux.org/msg15561.html Link] to discussion thread.<br />
<br />
=== Create uncompressed packages ===<br />
If you only want to install packages locally, you can speed up the process by avoiding the [[Wikipedia:xz|LZMA2]] compression and subsequent decompression:<br />
<br />
{{hc|/etc/makepkg.conf|2=<br />
[...]<br />
#PKGEXT='.pkg.tar.xz'<br />
PKGEXT='.pkg.tar'<br />
[...]<br />
}}<br />
<br />
=== Utilizing multiple cores on compression ===<br />
{{pkg|xz}} does not yet support [[Wikipedia:Symmetric multiprocessing|symmetric multiprocessing (SMP)]] on compression. This can be done with {{Pkg|p7zip}}:<br />
<br />
{{hc|/etc/makepkg.conf|2=<br />
[...]<br />
COMPRESSXZ=(7z a dummy -txz -si -so)<br />
[...]<br />
}}<br />
<br />
{{AUR|xz-git}} from the AUR now supports [[Wikipedia:Symmetric multiprocessing|symmetric multiprocessing (SMP)]].<br />
<br />
{{hc|/etc/makepkg.conf|2=<br />
[...]<br />
COMPRESSXZ=(xz -T0 -c -z -)<br />
[...]<br />
}}<br />
<br />
== See also ==<br />
* [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5) Manual Page]<br />
* [https://github.com/pixelb/scripts/blob/master/scripts/gcccpuopt gcccpuopt]: A script to print the GCC CPU-specific options tailored for the current CPU</div>Brando56894https://wiki.archlinux.org/index.php?title=Wayland&diff=324238Wayland2014-07-09T18:05:01Z<p>Brando56894: /* Qt5 */</p>
<hr />
<div>[[Category:X Server]]<br />
[[es:Wayland]]<br />
[[fr:Wayland]]<br />
[[ja:Wayland]]<br />
[[zh-CN:Wayland]]<br />
{{Related articles start}}<br />
{{Related|KMS}}<br />
{{Related|Xorg}}<br />
{{Related|Mir}}<br />
{{Related articles end}}<br />
'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].<br />
<br />
{{Warning|Wayland is under heavy development. Support can not be guaranteed and it may not function as you expect.}}<br />
<br />
== Requirements ==<br />
<br />
Currently Wayland will only work on systems utilizing [[KMS]].<br />
<br />
== Installation ==<br />
<br />
Wayland is most probably installed on your system already as it is an indirect dependency of {{Pkg|gtk2}} and {{Pkg|gtk3}}. If it is not installed, you will find the {{Pkg|wayland}} package in the [[official repositories]].<br />
<br />
== Usage ==<br />
<br />
As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 with Wayland plugin, and/or GTK+ with Wayland support.<br />
<br />
== Weston ==<br />
<br />
=== Installation ===<br />
<br />
You need to install {{Pkg|weston}} from the official repositories.<br />
<br />
=== Usage ===<br />
<br />
{| class="wikitable" style="float: right; width: 200px;"<br />
|+ '''''Keyboard Shortcuts''' (super = windows key - can be changed, see weston.ini)'' {{Ic|Ctrl-b}}<br />
!Cmd<br />
!Action<br />
|-<br />
|Ctrl + Alt + Backspace<br />
|Quit Weston<br />
|-<br />
|Super + Scroll (or PageUp/PageDown)<br />
|Zoom in/out of desktop<br />
|-<br />
|Super + Tab<br />
|Switch windows<br />
|-<br />
|Super + LMB<br />
|Move Window<br />
|-<br />
|Super + MMB<br />
|Resize Window<br />
|-<br />
|Super + RMB<br />
|Rotate Window !<br />
|-<br />
|Super + K<br />
|Force Kill Active Window<br />
|-<br />
|Super + KeyUp/KeyDown<br />
|Switch Prev/Next Workspace<br />
|-<br />
|Super + Shift + KeyUp/KeyDown<br />
|Grab Current Window and Switch Workspace<br />
|-<br />
|Super + F'''''n'''''<br />
|Switch to Workspace '''''n'''''<br />
|-<br />
|Super + S<br />
|Take a screenshot<br />
|-<br />
|Super + R<br />
|Record a screencast.<br />
|}<br />
<br />
Now that Wayland and its requirements are installed you should be ready to test it out. <br />
<br />
It is possible to run Weston inside a running X session:<br />
$ weston<br />
<br />
Alternatively, to launch Weston natively, try switching to a terminal and running:<br />
$ weston-launch<br />
<br />
Then at a TTY within Weston, you can run the demos. To launch a terminal emulator:<br />
$ weston-terminal<br />
<br />
To move flowers around the screen:<br />
$ weston-flower <br />
<br />
To test the frame protocol (runs {{ic|glxgears}}):<br />
$ weston-gears<br />
<br />
To display images:<br />
$ weston-image image1.jpg image2.jpg...<br />
<br />
To display PDF Files:<br />
$ weston-view doc1.pdf doc2.pdf...<br />
<br />
=== Configuration ===<br />
Example configuration file for keyboard layout, module selection and UI modifications. See {{ic|man weston.ini}} for full details:<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
### uncomment this line for xwayland support ###<br />
#modules=desktop-shell.so,xwayland.so<br />
<br />
[shell]<br />
background-image=/usr/share/backgrounds/gnome/Aqua.jpg<br />
background-color=0xff002244<br />
panel-color=0x90ff0000<br />
locking=true<br />
animation=zoom<br />
#binding-modifier=ctrl<br />
#num-workspaces=6<br />
### for cursor themes install xcursor-themes pkg from Extra. ###<br />
#cursor-theme=whiteglass<br />
#cursor-size=24<br />
<br />
### tablet options ###<br />
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png<br />
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg<br />
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg<br />
#animation=fade<br />
<br />
[keyboard]<br />
keymap_rules=evdev<br />
#keymap_layout=gb<br />
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel<br />
### keymap_options from /usr/share/X11/xkb/rules/base.lst ###<br />
<br />
<br />
[terminal]<br />
#font=DroidSansMono<br />
#font-size=14<br />
<br />
<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/gnome-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/arts.png<br />
path=./clients/flower<br />
<br />
[screensaver]<br />
# Uncomment path to disable screensaver<br />
path=/usr/libexec/weston-screensaver<br />
duration=600<br />
<br />
[input-method]<br />
path=/usr/libexec/weston-keyboard<br />
<br />
### for Laptop displays ###<br />
#[output]<br />
#name=LVDS1<br />
#mode=1680x1050<br />
#transform=90<br />
<br />
#[output]<br />
#name=VGA1<br />
# The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility<br />
#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync<br />
#transform=flipped<br />
<br />
#[output]<br />
#name=X1<br />
#mode=1024x768<br />
#transform=flipped-270</nowiki><br />
}}<br />
<br />
Minimal {{ic|weston.ini}} :<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=desktop-shell.so,xwayland.so<br />
<br />
[keyboard]<br />
keymap_layout=gb<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
<br />
[output]<br />
name=LVDS1<br />
mode=1680x1050<br />
transform=90</nowiki><br />
}}<br />
<br />
==== XWayland ====<br />
XWayland is ''now'' a Device-Dependent X. And will be [http://www.phoronix.com/scan.php?page=news_item&px=MTY1NDU released with Xorg 1.16]. The code has been in the main develop branch of X server. It is now a standalone program and we won't need those patched DDXes anymore.<br />
<br />
When you want to run an X application from within Weston, it spins up Xwayland to service the request.<br />
{{Note|<br />
Weston 1.4 or older doesn't support the new Xwayland. Neither does GNOME 3.12.<br />
}}<br />
If you plan to run native X-applications inside Wayland, install {{AUR|xwayland-git}} from the AUR. After that, create or modify following configuration file:<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so,desktop-shell.so</nowiki><br />
}}<br />
Now you can also run X applications in weston.<br />
<br />
If you want to run GNOME 3.12 on wayland, some hack is needed you may and refer to [http://www.reddit.com/r/LinuxActionShow/comments/254hwo/howto_run_gnome_312_on_wayland_on_arch/ this guide]. It also contains a PKGBUILD for Xwayland.<br />
<br />
== GUI libraries ==<br />
<br />
(See details on the [http://wayland.freedesktop.org/toolkits.html official website])<br />
<br />
=== GTK+ ===<br />
<br />
You need to install {{Pkg|gtk3}} from the official repositories, which now has the Wayland backend enabled.<br />
<br />
With GTK+ 3.0, GTK+ gained support for multiple backends at runtime and can switch between backends in the same way Qt can with lighthouse.<br />
<br />
When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by modifying an environment variable: {{ic|GDK_BACKEND&#61;wayland}}.<br />
<br />
=== Qt5 ===<br />
<br />
You need to either <strike>rebuild {{Pkg|qt5-base}} with ''-opengl es2''</strike> (currently not working, see http://lists.qt-project.org/pipermail/development/2013-December/014789.html ) or use {{AUR|qtbase-git}}. Then build the wayland plugin {{AUR|qt5-wayland-git}}.<br />
<br />
To run a Qt5 app with the Wayland plugin, set the {{ic|1=QT_QPA_PLATFORM=wayland-egl}} [[environment variable]].<br />
<br />
=== Clutter ===<br />
<br />
The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is enabled in the official package in extra.<br />
<br />
To run a Clutter app on Wayland, set {{ic|CLUTTER_BACKEND&#61;wayland}}.<br />
<br />
=== SDL ===<br />
<br />
Experimental wayland support is now in SDL 2.0.2 and enabled by default on Arch Linux.<br />
<br />
To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.<br />
<br />
=== glfw ===<br />
<br />
Version 3.1 will have wayland support through a compile flag that you have to enable. In the mean time you can install the package from the AUR {{AUR|glfw3-git}} and add {{ic|-DGLFW_USE_WAYLAND&#61;ON}} to the cmake flags<br />
<br />
=== EFL ===<br />
<br />
EFL has complete Wayland support. <br />
To run a EFL application on Wayland, see Wayland [http://wayland.freedesktop.org/efl.html project page].<br />
<br />
== Window managers and desktop shells ==<br />
<br />
=== KDE ===<br />
<br />
KDE 4.11 beta supports starting [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. There is currently no support for using KWin as a session compositor.<br />
<br />
=== GNOME ===<br />
With version 3.12 Gnome has experimental Wayland support but you have to install {{AUR|xwayland-git}}. <br />
You also have to install a mutter-wayland snapshot that makes use of the new Xwayland DDX. Use these two files to rebuild the package with makepkg. <br />
<br />
[https://gist.github.com/blackout24/9e1e255962a007ae6482 PKGBUILD] <br />
<br />
[https://gist.github.com/blackout24/84eca898dd3c2e9360e2 mutter-wayland.install] <br />
<br />
With any open source driver you can now start "Gnome on Wayland" from GDM as a special session.<br />
<br />
=== i3 ===<br />
<br />
Some developers from i3 have [http://www.i3way.org/ sprouted a completely new project] for implementing a shell plugin for Weston to implement the same features and style of i3.<br />
<br />
===Hawaii===<br />
[[Hawaii|See the article on Hawaii]]<br />
<br />
=== Pure Wayland ===<br />
<br />
{{Warning|Some really quick notes on installing a pure (no X11) Wayland system on Arch Linux. This is from source and installed into {{ic|/usr/local}}. May break your system. You have been warned.}}<br />
<br />
First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.<br />
<br />
==== Wayland, DRM, Pixman, libxkbcommon ====<br />
<br />
$ pacman -S wayland libdrm pixman libxkbcommon<br />
<br />
==== Mesa ====<br />
<br />
$ sudo pacman -S python2 libxml2 llvm<br />
$ git clone git://anongit.freedesktop.org/mesa/mesa<br />
$ cd mesa<br />
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local --enable-gles2 --disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi --with-gallium-drivers=r300,r600,swrast,nouveau --disable-glx --disable-xlib<br />
$ make<br />
$ sudo make install<br />
<br />
==== cairo ====<br />
<br />
Note - no glx/gl or xcb - EGL only.<br />
<br />
$ pacman -S libpng<br />
$ git clone git://anongit.freedesktop.org/cairo<br />
$ cd cairo<br />
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local/ --disable-xcb --enable-glesv2 <br />
$ make<br />
$ sudo make install<br />
<br />
==== weston ====<br />
$ sudo pacman -S gegl mtdev<br />
''(choose mesa-gl from options for libgl)''<br />
$ git clone git://anongit.freedesktop.org/wayland/weston<br />
$ cd weston/<br />
$ CFLAGS="-DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable-xwayland-test<br />
$ make<br />
$ sudo make install<br />
<br />
==Troubleshooting==<br />
<br />
=== LLVM assertion failure ===<br />
If you get an LLVM assertion failure, you need to rebuild {{Pkg|mesa}} without Gallium LLVM until this problem is fixed. <br />
<br />
This may imply disabling some drivers which require LLVM.<br />
You may also try exporting the following, if having problems with hardware drivers: <br />
<br />
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so<br />
<br />
== See also ==<br />
* [[Cursor Themes]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion]<br />
* [http://wayland.freedesktop.org/docs/html/ Wayland documentation online]<br />
* [http://www.chaosreigns.com/wiki/Wayland_State Wayland usability wiki]</div>Brando56894https://wiki.archlinux.org/index.php?title=Wayland&diff=324237Wayland2014-07-09T18:03:27Z<p>Brando56894: /* Qt5 */</p>
<hr />
<div>[[Category:X Server]]<br />
[[es:Wayland]]<br />
[[fr:Wayland]]<br />
[[ja:Wayland]]<br />
[[zh-CN:Wayland]]<br />
{{Related articles start}}<br />
{{Related|KMS}}<br />
{{Related|Xorg}}<br />
{{Related|Mir}}<br />
{{Related articles end}}<br />
'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].<br />
<br />
{{Warning|Wayland is under heavy development. Support can not be guaranteed and it may not function as you expect.}}<br />
<br />
== Requirements ==<br />
<br />
Currently Wayland will only work on systems utilizing [[KMS]].<br />
<br />
== Installation ==<br />
<br />
Wayland is most probably installed on your system already as it is an indirect dependency of {{Pkg|gtk2}} and {{Pkg|gtk3}}. If it is not installed, you will find the {{Pkg|wayland}} package in the [[official repositories]].<br />
<br />
== Usage ==<br />
<br />
As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 with Wayland plugin, and/or GTK+ with Wayland support.<br />
<br />
== Weston ==<br />
<br />
=== Installation ===<br />
<br />
You need to install {{Pkg|weston}} from the official repositories.<br />
<br />
=== Usage ===<br />
<br />
{| class="wikitable" style="float: right; width: 200px;"<br />
|+ '''''Keyboard Shortcuts''' (super = windows key - can be changed, see weston.ini)'' {{Ic|Ctrl-b}}<br />
!Cmd<br />
!Action<br />
|-<br />
|Ctrl + Alt + Backspace<br />
|Quit Weston<br />
|-<br />
|Super + Scroll (or PageUp/PageDown)<br />
|Zoom in/out of desktop<br />
|-<br />
|Super + Tab<br />
|Switch windows<br />
|-<br />
|Super + LMB<br />
|Move Window<br />
|-<br />
|Super + MMB<br />
|Resize Window<br />
|-<br />
|Super + RMB<br />
|Rotate Window !<br />
|-<br />
|Super + K<br />
|Force Kill Active Window<br />
|-<br />
|Super + KeyUp/KeyDown<br />
|Switch Prev/Next Workspace<br />
|-<br />
|Super + Shift + KeyUp/KeyDown<br />
|Grab Current Window and Switch Workspace<br />
|-<br />
|Super + F'''''n'''''<br />
|Switch to Workspace '''''n'''''<br />
|-<br />
|Super + S<br />
|Take a screenshot<br />
|-<br />
|Super + R<br />
|Record a screencast.<br />
|}<br />
<br />
Now that Wayland and its requirements are installed you should be ready to test it out. <br />
<br />
It is possible to run Weston inside a running X session:<br />
$ weston<br />
<br />
Alternatively, to launch Weston natively, try switching to a terminal and running:<br />
$ weston-launch<br />
<br />
Then at a TTY within Weston, you can run the demos. To launch a terminal emulator:<br />
$ weston-terminal<br />
<br />
To move flowers around the screen:<br />
$ weston-flower <br />
<br />
To test the frame protocol (runs {{ic|glxgears}}):<br />
$ weston-gears<br />
<br />
To display images:<br />
$ weston-image image1.jpg image2.jpg...<br />
<br />
To display PDF Files:<br />
$ weston-view doc1.pdf doc2.pdf...<br />
<br />
=== Configuration ===<br />
Example configuration file for keyboard layout, module selection and UI modifications. See {{ic|man weston.ini}} for full details:<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
### uncomment this line for xwayland support ###<br />
#modules=desktop-shell.so,xwayland.so<br />
<br />
[shell]<br />
background-image=/usr/share/backgrounds/gnome/Aqua.jpg<br />
background-color=0xff002244<br />
panel-color=0x90ff0000<br />
locking=true<br />
animation=zoom<br />
#binding-modifier=ctrl<br />
#num-workspaces=6<br />
### for cursor themes install xcursor-themes pkg from Extra. ###<br />
#cursor-theme=whiteglass<br />
#cursor-size=24<br />
<br />
### tablet options ###<br />
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png<br />
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg<br />
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg<br />
#animation=fade<br />
<br />
[keyboard]<br />
keymap_rules=evdev<br />
#keymap_layout=gb<br />
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel<br />
### keymap_options from /usr/share/X11/xkb/rules/base.lst ###<br />
<br />
<br />
[terminal]<br />
#font=DroidSansMono<br />
#font-size=14<br />
<br />
<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/gnome-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/arts.png<br />
path=./clients/flower<br />
<br />
[screensaver]<br />
# Uncomment path to disable screensaver<br />
path=/usr/libexec/weston-screensaver<br />
duration=600<br />
<br />
[input-method]<br />
path=/usr/libexec/weston-keyboard<br />
<br />
### for Laptop displays ###<br />
#[output]<br />
#name=LVDS1<br />
#mode=1680x1050<br />
#transform=90<br />
<br />
#[output]<br />
#name=VGA1<br />
# The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility<br />
#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync<br />
#transform=flipped<br />
<br />
#[output]<br />
#name=X1<br />
#mode=1024x768<br />
#transform=flipped-270</nowiki><br />
}}<br />
<br />
Minimal {{ic|weston.ini}} :<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=desktop-shell.so,xwayland.so<br />
<br />
[keyboard]<br />
keymap_layout=gb<br />
<br />
[launcher]<br />
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png<br />
path=/usr/bin/weston-terminal<br />
<br />
[launcher]<br />
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png<br />
path=/usr/bin/firefox<br />
<br />
<br />
[output]<br />
name=LVDS1<br />
mode=1680x1050<br />
transform=90</nowiki><br />
}}<br />
<br />
==== XWayland ====<br />
XWayland is ''now'' a Device-Dependent X. And will be [http://www.phoronix.com/scan.php?page=news_item&px=MTY1NDU released with Xorg 1.16]. The code has been in the main develop branch of X server. It is now a standalone program and we won't need those patched DDXes anymore.<br />
<br />
When you want to run an X application from within Weston, it spins up Xwayland to service the request.<br />
{{Note|<br />
Weston 1.4 or older doesn't support the new Xwayland. Neither does GNOME 3.12.<br />
}}<br />
If you plan to run native X-applications inside Wayland, install {{AUR|xwayland-git}} from the AUR. After that, create or modify following configuration file:<br />
{{hc|~/.config/weston.ini|<br />
<nowiki>[core]<br />
modules=xwayland.so,desktop-shell.so</nowiki><br />
}}<br />
Now you can also run X applications in weston.<br />
<br />
If you want to run GNOME 3.12 on wayland, some hack is needed you may and refer to [http://www.reddit.com/r/LinuxActionShow/comments/254hwo/howto_run_gnome_312_on_wayland_on_arch/ this guide]. It also contains a PKGBUILD for Xwayland.<br />
<br />
== GUI libraries ==<br />
<br />
(See details on the [http://wayland.freedesktop.org/toolkits.html official website])<br />
<br />
=== GTK+ ===<br />
<br />
You need to install {{Pkg|gtk3}} from the official repositories, which now has the Wayland backend enabled.<br />
<br />
With GTK+ 3.0, GTK+ gained support for multiple backends at runtime and can switch between backends in the same way Qt can with lighthouse.<br />
<br />
When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by modifying an environment variable: {{ic|GDK_BACKEND&#61;wayland}}.<br />
<br />
=== Qt5 ===<br />
<br />
You need to either <strike>rebuild {{Pkg|qt5-base}} with ''-opengl es2''</strike> (currently not working, see http://lists.qt-project.org/pipermail/development/2013-December/014789.html ) or use {{AUR|qtbase-git}}. Then build the wayland plugin {{AUR|qt5wayland-git}}.<br />
<br />
To run a Qt5 app with the Wayland plugin, set the {{ic|1=QT_QPA_PLATFORM=wayland-egl}} [[environment variable]].<br />
<br />
=== Clutter ===<br />
<br />
The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is enabled in the official package in extra.<br />
<br />
To run a Clutter app on Wayland, set {{ic|CLUTTER_BACKEND&#61;wayland}}.<br />
<br />
=== SDL ===<br />
<br />
Experimental wayland support is now in SDL 2.0.2 and enabled by default on Arch Linux.<br />
<br />
To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.<br />
<br />
=== glfw ===<br />
<br />
Version 3.1 will have wayland support through a compile flag that you have to enable. In the mean time you can install the package from the AUR {{AUR|glfw3-git}} and add {{ic|-DGLFW_USE_WAYLAND&#61;ON}} to the cmake flags<br />
<br />
=== EFL ===<br />
<br />
EFL has complete Wayland support. <br />
To run a EFL application on Wayland, see Wayland [http://wayland.freedesktop.org/efl.html project page].<br />
<br />
== Window managers and desktop shells ==<br />
<br />
=== KDE ===<br />
<br />
KDE 4.11 beta supports starting [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. There is currently no support for using KWin as a session compositor.<br />
<br />
=== GNOME ===<br />
With version 3.12 Gnome has experimental Wayland support but you have to install {{AUR|xwayland-git}}. <br />
You also have to install a mutter-wayland snapshot that makes use of the new Xwayland DDX. Use these two files to rebuild the package with makepkg. <br />
<br />
[https://gist.github.com/blackout24/9e1e255962a007ae6482 PKGBUILD] <br />
<br />
[https://gist.github.com/blackout24/84eca898dd3c2e9360e2 mutter-wayland.install] <br />
<br />
With any open source driver you can now start "Gnome on Wayland" from GDM as a special session.<br />
<br />
=== i3 ===<br />
<br />
Some developers from i3 have [http://www.i3way.org/ sprouted a completely new project] for implementing a shell plugin for Weston to implement the same features and style of i3.<br />
<br />
===Hawaii===<br />
[[Hawaii|See the article on Hawaii]]<br />
<br />
=== Pure Wayland ===<br />
<br />
{{Warning|Some really quick notes on installing a pure (no X11) Wayland system on Arch Linux. This is from source and installed into {{ic|/usr/local}}. May break your system. You have been warned.}}<br />
<br />
First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.<br />
<br />
==== Wayland, DRM, Pixman, libxkbcommon ====<br />
<br />
$ pacman -S wayland libdrm pixman libxkbcommon<br />
<br />
==== Mesa ====<br />
<br />
$ sudo pacman -S python2 libxml2 llvm<br />
$ git clone git://anongit.freedesktop.org/mesa/mesa<br />
$ cd mesa<br />
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local --enable-gles2 --disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi --with-gallium-drivers=r300,r600,swrast,nouveau --disable-glx --disable-xlib<br />
$ make<br />
$ sudo make install<br />
<br />
==== cairo ====<br />
<br />
Note - no glx/gl or xcb - EGL only.<br />
<br />
$ pacman -S libpng<br />
$ git clone git://anongit.freedesktop.org/cairo<br />
$ cd cairo<br />
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local/ --disable-xcb --enable-glesv2 <br />
$ make<br />
$ sudo make install<br />
<br />
==== weston ====<br />
$ sudo pacman -S gegl mtdev<br />
''(choose mesa-gl from options for libgl)''<br />
$ git clone git://anongit.freedesktop.org/wayland/weston<br />
$ cd weston/<br />
$ CFLAGS="-DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable-xwayland-test<br />
$ make<br />
$ sudo make install<br />
<br />
==Troubleshooting==<br />
<br />
=== LLVM assertion failure ===<br />
If you get an LLVM assertion failure, you need to rebuild {{Pkg|mesa}} without Gallium LLVM until this problem is fixed. <br />
<br />
This may imply disabling some drivers which require LLVM.<br />
You may also try exporting the following, if having problems with hardware drivers: <br />
<br />
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so<br />
<br />
== See also ==<br />
* [[Cursor Themes]]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion]<br />
* [http://wayland.freedesktop.org/docs/html/ Wayland documentation online]<br />
* [http://www.chaosreigns.com/wiki/Wayland_State Wayland usability wiki]</div>Brando56894https://wiki.archlinux.org/index.php?title=AUR_helpers&diff=282895AUR helpers2013-11-15T03:19:25Z<p>Brando56894: /* AUR search/build helpers */</p>
<hr />
<div>[[Category:Arch User Repository]]<br />
[[Category:Package management]]<br />
[[es:Aurbuild]]<br />
[[fr:Assistants AUR]]<br />
[[ja:AUR Helpers]]<br />
[[ru:AUR Helpers]]<br />
[[tr:AUR_Yardımcı_Uygulamaları]]<br />
[[zh-CN:AUR Helpers]]<br />
{{Warning|None of these tools are officially supported by Arch devs. See [https://bbs.archlinux.org/viewtopic.php?pid&#61;828254#p828254 this forum thread].}}<br />
<br />
'''AUR Helpers''' are written to make using the [[Arch User Repository]] more comfortable.<br />
<br />
== AUR uploader helpers ==<br />
<br />
* {{App|aurploader|prompts the user for an AUR username and password and will then upload PKGBUILD tarballs to the AUR. Before uploading each package, the user is prompted to select a category. When the uploads have completed, the user is asked if the cookie file should be kept so that the script can be run again without needing the AUR username and password to be re-entered. It can include comments, vote and toggle notifications as well. It is now part of the python3-aur package, which includes modules for AUR automation and some other helpers. |http://xyne.archlinux.ca/projects/python3-aur|{{AUR|python3-aur}}}}<br />
<br />
* {{App|aurup|a command line tool to upload AUR packages|http://www.pierloz.com/Aurup/|{{AUR|aurup}}}}<br />
<br />
* {{App|burp|fast and simple AUR uploader written in C. Supports persistent cookies for seamless logins|https://github.com/falconindy/burp|{{pkg|burp}}}}<br />
<br />
== AUR search/build helpers ==<br />
This is a list of helper utilities that search and/or build packages.<br />
<br />
* {{App|[[aur.sh]]|A ~150 byte Bash script outside the package system that downloads and builds AUR packages named on the command line (and their dependencies). Useful for bootstrapping more full-featured AUR helpers.|https://github.com/stuartpb/aur.sh|4=<span class="plainlinks" style="font-family: monospace">bash <(curl [http://aur.sh/ aur.sh]) -si ''[package ...]''</span>}}<br />
<br />
* {{App|[[aura]]|a secure, multilingual package manager for Arch Linux written in Haskell. Has all pacman options, new ones for managing AUR packages, and a nifty logo.|https://github.com/fosskers/aura|{{AUR|aura}}}}<br />
<br />
* {{App|aurifere|AUR wrapper for lazy people in Python.|https://github.com/madjar/aurifere|{{AUR|aurifere-git}}}}<br />
<br />
* {{App|aurinstaller|a full of bugs bash AUR helper.|https://github.com/umby213/aurinstaller|{{AUR|aurinstaller-git}}}}<br />
<br />
* {{App|aurnotify|a tool set to notify the status of your favorite packages from AUR.|http://adesklets.sourceforge.net/desklets.html|{{AUR|aurnotify}}}}<br />
<br />
* {{App|aurbuild|tool to download and build packages from the AUR.|http://aurbuild.berlios.de/|{{AUR|aurbuild}}}}<br />
<br />
* {{App|aurget|aims to be a simple, pacman-like interface to the AUR. It tries to make the AUR convenient; whether the user wishes to find, download, build, install, or update AUR packages quickly. Aurget does not wrap any pure pacman commands, this is by design|http://pbrisbin.com/posts/aurget/|{{AUR|aurget}}}}<br />
<br />
* {{App|aurora|very simple frontend for the AUR. It allows the user to install AUR packages, download the AUR packages (for manual installation) and also offers an AUR upgrade feature. By design, aurora does not wrap pacman|http://bitbucket.org/bbenne10/aurora|{{AUR|aurora-hg}}}}<br />
<br />
* {{App|aurpac|light'n'fast AUR and pacman frontend|http://3ed.jogger.pl/2009/02/15/aurpac/|{{AUR|aurpac}}}}<br />
<br />
* {{App|aurquery|caching wrapper around the AUR's RPC interface using the python3-aur modules |http://xyne.archlinux.ca/projects/python3-aur|{{AUR|python3-aur}}}}}}<br />
<br />
* {{App|[[autoaur]]|script for automatic mass downloading, updating, building, and installing groups of AUR packages|https://github.com/stefanhusmann/autoaur|{{AUR|autoaur}}}}<br />
<br />
* {{App|1=cower|2=fast and simple AUR search and download agent, which will also check for updates and download dependencies.<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=97137 Forum page]|3=https://github.com/falconindy/cower|4={{AUR|cower}}}}<br />
<br />
* {{App|meat|front-end for cower ( see above ) and it is fully written in bash<br />
:{{Note|Meat is in actually under development/alpha state.}}|https://github.com/e36freak/meat|{{AUR|meat-git}}}}<br />
<br />
* {{App|owl|pacman and cower wrapper focused on simplicity|https://github.com/baskerville/owl<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=129609 Forum page]|https://github.com/baskerville/owl|{{AUR|owl-git}}}}<br />
<br />
* {{App|1=[[pacaur]]|2=fast workflow AUR helper, using cower as backend. It aims at speed and simplicity, and is designed to minimize user prompt interaction and to use an uncluttered interface.<br />
:* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]|3=https://github.com/Spyhawk/pacaur|4={{AUR|pacaur}}}}<br />
<br />
* {{App|1=packer|2=wrapper for pacman and the AUR. It was designed to be a simple and very fast replacement for the basic functionality of Yaourt. It has commands to install, update, search, and show information for any package in the main repositories and in the AUR. Use pacman for other commands, such as removing a package<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=88115 Forum page]<br />
:* [https://github.com/keenerd/packer/wiki Wiki]|3=https://github.com/keenerd/packer|4={{AUR|packer}}}}<br />
<br />
* {{App|1=paktahn|2=yaourt replacement. Includes improvements such as a local cache for fast searches and interactive installation. Last Updated: 2013-04-15 08:17<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=77674&p=1 Forum page]<br />
|3=https://github.com/skypher/paktahn|4={{AUR|paktahn}}}}<br />
<br />
* {{App|1=pbfetch|2=script which can be used as a pacman-independent AUR helper or a pacman wrapper with additional AUR functionality. Pbfetch aims to be a simple and fast versus the well established yaourt. Pbfetch can be used as a shortcut to simply download PKGBUILDs from AUR or automatically build with dependency resolution among other things. The user can select which AUR packages to upgrade using a simple menu as well as update all AUR packages<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=87789 Forum page]<br />
|3=https://github.com/dalingrin/pbfetch|4={{AUR|pbfetch-git}}}}<br />
<br />
* {{App|pbget|simple command-line tool for retrieving PKGBUILDs and local source files for Arch Linux. It is able to retrieve files from the official SVN and CVS web interface, the AUR and the ABS rsync server|http://xyne.archlinux.ca/projects/pbget|{{AUR|pbget}}}}<br />
<br />
* {{App|1=PKGBUILDer|2=a python3 AUR helper with dependency support. It was (probably) the first helper supporting updates through multiinfo. Contains many useful features and is written to be fast and verbose, to eliminate long waiting times.|3=https://github.com/Kwpolska/pkgbuilder|4={{AUR|pkgbuilder}}}}<br />
<br />
* {{App|1=pkgman|2=script which helps to manage a local repository. It retrieves the PKGBUILD and related files for given name from ABS or AUR and lets you edit them, automatically generates checksums, backs up the source tarball, builds and adds the package to your local repository. Then you can install it as usual with pacman. It also has AUR support for submitting tarballs and leaving comments<br />
:* [https://bbs.archlinux.org/viewtopic.php?id=49023 Forum page]<br />
|3=http://sourceforge.net/apps/mediawiki/pkgman/index.php|4={{AUR|pkgman}}}}<br />
<br />
* {{App|pywer|A python rewrite of cower with a library ({{ic|libaur}}) for use in python scripts, currently in development. It does not build packages. Checks for updates, searches for packages and maintainers and gets information on packages. | http://kaictl.net/docs/pywer/ https://github.com/KaiSforza/pywer | {{AUR|python-pywer-git}}}}<br />
<br />
* {{App|spinach|just another bash AUR helper|http://floft.net/wiki/Scripts/Spinach|{{AUR|spinach}}}}<br />
<br />
* {{App|1=srcman|2=pacman/makepkg wrapper written in Bash, which transparently handles pacman operations on 'source packages'. This means, for example, that packages can be specified for installation either explicitly (pacman's {{Ic|-U}} operation) or can be installed from a (source) repository (-S operation). The address of an AUR pacman database can be found in the corresponding forum thread, by the way. The primary goal of this project is to provide a complete pacman wrapper and therefore, srcman supports all current pacman operations for binary ''and'' source packages|3=https://bbs.archlinux.org/viewtopic.php?id=65501|4={{AUR|srcman}}}}<br />
<br />
* {{App|trizen|A lightweight wrapper for AUR in Perl.|https://github.com/trizen/trizen|{{AUR|trizen}}}}<br />
<br />
* {{App|yaah|A minimalist wrapper for AUR in Bash.|https://bitbucket.org/the_metalgamer/yaah/|{{AUR|yaah}}}}<br />
<br />
* {{App|[[yaourt]] (Yet Another User Repository Tool)|community-contributed wrapper for pacman which adds seamless access to the AUR, allowing and automating package compilation and installation from your choice of the thousands of PKGBUILDs in the AUR, in addition to the many thousands of available Arch binary packages. Yaourt uses the same exact syntax as pacman, which saves you from relearning an entirely new method of system maintenance, but also adds new options. Yaourt expands the power and simplicity of pacman by adding even more useful features and provides pleasing, colorized output, interactive search mode, and much more|http://archlinux.fr/yaourt-en|{{AUR|yaourt}}}}<br />
<br />
== AUR maintaining helpers ==<br />
* {{App|pkgcheck|Uses rules in PKGBUILDs to parse upstream version information or looks for changes by checksuming the web page|https://bbs.archlinux.org/viewtopic.php?id=162816|Repository: [https://github.com/onny/pkgcheck Github]}}<br />
<br />
* {{App|pkgbuild-watch|Looks for changes on the upstream web pages|http://kmkeen.com/pkgbuild-watch|{{AUR|pkgbuild-watch}}}}<br />
<br />
* {{App|pkglivecheck|Parses the source url from PKGBUILDs and tries to find new versions of packages by incrementing the version number and sending requests to the webserver|https://mailman.archlinux.org/pipermail/pacman-dev/2013-April/017048.html |Repositoy: [https://github.com/anatol/pkglivecheck Github]}}<br />
<br />
== Others ==<br />
Other useful libraries.<br />
<br />
* {{App|haskell-archlinux|library to programmatically access the AUR and package metadata from the Haskell programming language|http://hackage.haskell.org/package/archlinux|{{AUR|haskell-archlinux}}}}<br />
<br />
* {{App|parched|pacman package and PKGBUILD parser module written in python|https://github.com/sebnow/parched|{{AUR|parched-git}}}}<br />
<br />
== Quick Comparison Table ==<br />
<br />
{{note|''Secure'' means that the application, by default, doesn't source the PKGBUILD at all, or, before doing it, reminds the user and offers him the opportunity to inspect it manually. Some helpers are known to source PKGBUILDs before the user can inspect them, for example for dependency resolution, and this can allow malicious code to be executed.}}<br />
<br />
{| border="1" cellpadding="4" cellspacing="0" <br />
! Name !! Written in !! Active Project !! Official Repo support !! Pacman-like Syntax !! Shell Tab Completion !! Secure (<small>see&nbsp;note&nbsp;above</small>) !! Multilingual !! Specificity<br />
|- <br />
! [[aura]] <br />
| Haskell || {{Yes}} || {{Yes}} || {{Yes}} || Bash/zsh || {{Yes}} || {{Yes}} || Handles Backups, Downgrades, ABS Support<br />
|-<br />
! aurget<br />
| Bash || {{Yes}} || {{No}} || {{Yes}} || Bash || {{No}} || {{No}} || -<br />
|-<br />
! aurora<br />
| Python3 || {{Yes}} || {{No}} || {{No}} || {{No}} || {{No}} || {{No}} || -<br />
|-<br />
! cower<br />
| C || {{Yes}} || {{No}} || {{No}} || Bash/zsh || {{Yes}} || {{No}} || Minimalist helper without automatic build support.<br />
|-<br />
! owl<br />
| Dash || {{Yes}} || {{Yes}} || {{No}} || Bash || {{Yes}} || {{No}} || -<br />
|-<br />
! [[pacaur]]<br />
| Bash/C || {{Yes}} || {{Yes}} || {{Yes}} || Bash || optional || {{Yes}} || Minimize user interaction.<br />
|-<br />
! packer<br />
| Bash || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} || {{No}} || {{No}} || -<br />
|-<br />
! paktahn<br />
| Lisp || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} || {{No}} || {{No}} || -<br />
|-<br />
! pbfetch<br />
| Bash || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} || {{No}} || -<br />
|-<br />
! PKGBUILDer<br />
| Python3 || {{Yes}} || {{Yes}} ({{Ic|pb}} command) || {{No}} || {{No}} || {{No}} || {{Yes}} || - <br />
|-<br />
! pywer<br />
| Python3 || {{Yes}} || {{No}} (read only libaur.repos) || {{No}} || {{Yes}} (zsh) || {{Yes}} || {{No}} || Includes python3 {{ic|libaur}} library<br />
|-<br />
! spinach<br />
| Bash || {{Yes}} || {{Yes}} || {{No}} || {{No}} || {{Yes}} || {{No}} || -<br />
|-<br />
! yaah<br />
| Bash || {{Yes}} || {{No}} || {{No}} || Bash || {{Yes}} || {{No}} || Minimalist helper without automatic build support.<br />
|-<br />
! [[yaourt]]<br />
| Bash/C || {{Yes}} || {{Yes}} || {{Yes}} || Bash/zsh/fish || {{Yes}} || {{Yes}} || Handles Backups, ABS support<br />
|}<br />
<br />
== See also ==<br />
* [[pacman GUI Frontends]]</div>Brando56894https://wiki.archlinux.org/index.php?title=Archiso&diff=282426Archiso2013-11-12T03:13:08Z<p>Brando56894: removed references to rc.local</p>
<hr />
<div>[[Category:Live Arch systems]]<br />
[[ar:Archiso]]<br />
[[el:Archiso]]<br />
[[es:Archiso]]<br />
[[fr:Archiso]]<br />
[[it:Archiso]]<br />
[[nl:Archiso]]<br />
[[ru:Archiso]]<br />
[[uk:Archiso]]<br />
{{Out of date|References to {{ic|/etc/rc.local}}, [[systemd]] does not use it.}}<br />
<br />
'''Archiso''' is a small set of bash scripts capable of building fully functional Arch Linux based live CD and USB images. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, install disks, to special interest live CD/DVD/USB systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. The heart and soul of Archiso is mkarchiso. All of its options are documented in its usage output, so its direct usage won't be covered here. Instead, this wiki article will act as a guide for rolling your own live media in no time!<br />
<br />
== Setup ==<br />
{{Note|The script is to be used on an x86_64 machine.}}<br />
Before we begin, we need to [[pacman|install]] {{Pkg|archiso}} from the [[official repositories]]. Alternatively, {{AUR|archiso-git}} can be found in the [[AUR]].<br />
<br />
Create a directory to work within, this is where all the modifications to the live image will take place: {{ic|~/archlive}} should do fine.<br />
$ mkdir ~/archlive<br />
<br />
The archiso scripts that were installed to the host system earlier now need to be copied over into the newly created directory you will be working within.<br />
Archiso comes with two "profiles": ''releng'' and ''baseline''.<br />
If you wish to create a fully customised live version of Arch Linux, pre-installed with all your favourite programs and configurations, use ''releng''.<br />
If you just want to create the most basic live medium, with no pre-installed packages and a minimalistic configuration, use ''baseline''.<br />
<br />
So, depending on your needs, execute the following, replacing 'PROFILE' with either '''releng''' or '''baseline'''.<br />
# cp -r /usr/share/archiso/configs/'''PROFILE'''/ ~USER/archlive<br />
<br />
If you are using the ''releng'' profile to make a fully customised image, then you can proceed onto [[#Configure our live medium]].<br />
<br />
If you are using the ''baseline'' profile to create a bare image, then you won't be needing to do any customisations and can proceed onto [[#Build the ISO]].<br />
<br />
== Configure our live medium ==<br />
<br />
This section details configuring the image you will be creating, allowing you to define the packages and configurations you want your live image to contain.<br />
<br />
Change into the directory we created earlier (~/archlive/releng/ if you have been following this guide), you will see a number of files and directories; we are only concerned with a few of these, mainly: <br />
packages.* - this is where you list, line by line, the packages you want to have installed, and<br />
the root-image directory - this directory acts as an overlay and it is where you make all the customisations.<br />
<br />
=== Installing packages ===<br />
<br />
You will want to create a list of packages you want installed on your live CD system. A file full of package names, one-per-line, is the format for this. This is '''''great''''' for special interest live CDs, just specify packages you want in packages.both and bake the image.<br />
The packages.i686 and packages.x86_64 files allow you to install software on just 32bit or 64bit, respectively.<br />
<br />
{{Tip|You can also create a '''[[custom local repository]]''' for the purpose of preparing custom packages or packages from [[AUR]]/[[ABS]]. Just add your local repository at the first position (for top priority) of your build machine's '''pacman.conf''' and you are good to go!}}<br />
I recommend installing "rsync" if you wish to install the system later on with no internet connection or skipping downloading it all over again. ([[#Installation]])<br />
<br />
=== Adding a user ===<br />
<br />
Copy your /etc/shadow, /etc/passwd, and /etc/group from your '''host''' system to the /etc/ directory '''of the new live system''' (which should be ~/archlive/releng/root-image/etc)<br />
e.g.<br />
# cp /etc/{shadow,passwd,group} ~/archlive/releng/root-image/etc/<br />
<br />
{{Warning|The shadow file will contain your encrypted password. I recommend before you copy the shadow file over, you change the password of your host user to that which you want your live user to have, copy the shadow file over, and then change back your password.}}<br />
<br />
=== Adding files to image ===<br />
<br />
{{Note|You must be root to do this, do not change the ownership of any of the files you copy over, '''everything''' within the root-image directory must be root owned. Proper ownerships will be sorted out shortly.}}<br />
<br />
The root-image directory acts as an overlay, think of it as root directory '/' on your current system, so any files you place within this directory will be copied over on boot-up.<br />
<br />
So if you have a set of iptables scripts on your current system you want to be used on you live image, copy them over as such:<br />
# cp -r /etc/iptables ~/archlive/releng/root-image/etc<br />
<br />
Placing files in the users home directory is a little different. Do not place them within root-image/home, but instead create a skel directory within root-image/ and place them there. We will then add the relevant commands to the customize_root_image.sh which we are going to use to copy them over on boot and sort out the permissions.<br />
<br />
First, create the skel directory; making sure you are within ~/archlive/releng/root-image/etc directory (if this is where you are working from):<br />
# cd ~/archlive/releng/root-image/etc && mkdir skel<br />
<br />
Now copy the 'home' files to the skel directory, again doing everything as root!<br />
e.g for .bashrc. <br />
# cp ~/.bashrc ~/archlive/releng/root-image/etc/skel/<br />
<br />
Now add the all of following to ~/archlive/releng/root-image/root/customize_root_image.sh , replacing 'youruser' with the user you specified earlier.<br />
# Create the user directory for live session<br />
if [ ! -d /home/'''youruser''' ]; then<br />
mkdir /home/'''youruser''' && chown '''youruser''' /home/'''youruser'''<br />
fi<br />
# Copy files over to home<br />
su -c "cp -r /etc/skel/.* /home/'''youruser'''/" '''youruser'''<br />
<br />
=== aitab ===<br />
<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
The aitab file holds information about the filesystems images that must be created by mkarchiso and mounted at initramfs stage from the archiso hook.<br />
It consists of some fields which define the behaviour of images.<br />
<br />
# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size><br />
<br />
; <img>: Image name without extension (.fs .fs.sfs .sfs).<br />
; <mnt>: Mount point.<br />
; <arch>: Architecture { i686 | x86_64 | any }.<br />
; <sfs_comp>: SquashFS compression type { gzip | lzo | xz }.<br />
; <fs_type>: Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs }. A special value of "none" denotes no usage of a filesystem. In that case all files are pushed directly to SquashFS filesystem.<br />
; <fs_size>: An absolute value of file system image size in MiB (example: 100, 1000, 4096, etc) A relative value of file system free space [in percent] {1%..99%} (example 50%, 10%, 7%). This is an estimation, and calculated in a simple way. Space used + 10% (estimated for metadata overhead) + desired %<br />
<br />
{{Note|Some combinations are invalid. Example both sfs_comp and fs_type are set to none}}<br />
<br />
=== Boot Loader ===<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
Due to the modular nature of isolinux, you are able to use lots of addons since all *.c32 files are copied and available to you. Take a look at the [http://syslinux.zytor.com/wiki/index.php/SYSLINUX official syslinux site] and the [https://projects.archlinux.org/archiso.git/tree/configs/syslinux-iso/boot-files archiso git repo]. Using said addons, it is possible to make visually attractive and complex menus. See [http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32 here].<br />
<br />
=== Login manager ===<br />
<br />
Starting X at boot time was done by modifying ''inittab'' on [[sysvinit]] systems. On a [[systemd]] based system things are handled by enabling your login manager's service. If you know which .service file needs a softlink: Great. If not, you can easily find out in case you're using the same program on the system you build your iso on. Just use<br />
<br />
# systemctl disable '''nameofyourloginmanager'''<br />
<br />
to temporarily turn it off. Next type the same command again and replace "disable" with "enable" to activate it again. Systemctl prints information about softlink it creates. Now change to ~/archiso/releng/root-image/etc/systemd/system and create the same softlink there.<br />
<br />
An example (make sure you're either in ~/archiso/releng/root-image/etc/systemd/system or add it to the command):<br />
<br />
# ln -s /usr/lib/systemd/system/lxdm.service display-manager.service<br />
<br />
This will enable LXDM at system start on your live system.<br />
<br />
== Build the ISO ==<br />
<br />
Now you are ready to turn your files into the .iso which you can then burn to CD or USB:<br />
Inside the directory you are working with, either ~/archlive/releng, or ~/archlive/baseline, execute:<br />
<br />
# ./build.sh -v<br />
<br />
The script will now download and install the packages you specified to work/*/root-image, create the kernel and init images, apply your customizations and finally build the iso into out/.<br />
<br />
== Using the ISO ==<br />
=== CD ===<br />
Just burn the iso to a cd. You can follow [[CD Burning]] as you wish.<br />
=== USB ===<br />
You can now dd the iso file onto a USB using dd, an example of which:<br />
# dd if=~/archlive/releng/out/*.iso of=/dev/sdx<br />
You will have to adjust accordingly, and make sure you choose the right output file! A simple mistake here will destroy data on your harddisk.<br />
<br />
=== grub4dos ===<br />
Grub4dos is a utility that can be used to create multiboot usbs, able to boot multiple linux distros from the same usb stick.<br />
<br />
To boot the generated system on a usb with grub4dos already installed, loop mount the ISO and copy the entire {{ic|/arch}} directory to the '''root of the usb'''.<br />
Then edit the {{ic|menu.lst}} file from the grub4dos (it must be on the usb root) and add this lines:<br />
{{bc|<nowiki><br />
title Archlinux x86_64<br />
kernel /arch/boot/x86_64/vmlinuz archisolabel=<your usb label><br />
initrd /arch/boot/x86_64/archiso.img<br />
</nowiki>}}<br />
Change the {{ic|x86_64}} part as necessary and put your '''real''' usb label there.<br />
<br />
=== Installation ===<br />
<br />
Boot the created CD/DVD/USB. If you wish to install the Archiso you created '''-as it is-''', there are several ways to do this, but either way we're following the [[Beginners' Guide]] mostly.<br />
<br />
If you don't have an internet connection on that PC, or if you don't want to download every packages you want again, follow the guide, and when you get to [[Beginners' Guide#Install_the_base_system]], instead of downloading, use this: [[Full System Backup with rsync]]. (more info here: [[Talk:Archiso]])<br />
<br />
You can also try: [[Archboot]], GUI installer.<br />
<br />
== See also ==<br />
*[https://projects.archlinux.org/?p=archiso.git;a=summary Archiso project page]<br />
*[[Archiso_as_pxe_server|Archiso as pxe server]]<br />
*[https://kroweer.wordpress.com/2011/09/07/creating-a-custom-arch-linux-live-usb Step-by-step tutorial on using ArchISO]<br />
*[http://didjix.blogspot.com/ A live DJ distribution powered by ArchLinux and built with Archiso]</div>Brando56894https://wiki.archlinux.org/index.php?title=Archiso&diff=282425Archiso2013-11-12T03:06:43Z<p>Brando56894: removed references to rc.local</p>
<hr />
<div>[[Category:Live Arch systems]]<br />
[[ar:Archiso]]<br />
[[el:Archiso]]<br />
[[es:Archiso]]<br />
[[fr:Archiso]]<br />
[[it:Archiso]]<br />
[[nl:Archiso]]<br />
[[ru:Archiso]]<br />
[[uk:Archiso]]<br />
{{Out of date|References to {{ic|/etc/rc.local}}, [[systemd]] does not use it.}}<br />
<br />
'''Archiso''' is a small set of bash scripts capable of building fully functional Arch Linux based live CD and USB images. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, install disks, to special interest live CD/DVD/USB systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. The heart and soul of Archiso is mkarchiso. All of its options are documented in its usage output, so its direct usage won't be covered here. Instead, this wiki article will act as a guide for rolling your own live media in no time!<br />
<br />
== Setup ==<br />
{{Note|The script is to be used on an x86_64 machine.}}<br />
Before we begin, we need to [[pacman|install]] {{Pkg|archiso}} from the [[official repositories]]. Alternatively, {{AUR|archiso-git}} can be found in the [[AUR]].<br />
<br />
Create a directory to work within, this is where all the modifications to the live image will take place: {{ic|~/archlive}} should do fine.<br />
$ mkdir ~/archlive<br />
<br />
The archiso scripts that were installed to the host system earlier now need to be copied over into the newly created directory you will be working within.<br />
Archiso comes with two "profiles": ''releng'' and ''baseline''.<br />
If you wish to create a fully customised live version of Arch Linux, pre-installed with all your favourite programs and configurations, use ''releng''.<br />
If you just want to create the most basic live medium, with no pre-installed packages and a minimalistic configuration, use ''baseline''.<br />
<br />
So, depending on your needs, execute the following, replacing 'PROFILE' with either '''releng''' or '''baseline'''.<br />
# cp -r /usr/share/archiso/configs/'''PROFILE'''/ ~USER/archlive<br />
<br />
If you are using the ''releng'' profile to make a fully customised image, then you can proceed onto [[#Configure our live medium]].<br />
<br />
If you are using the ''baseline'' profile to create a bare image, then you won't be needing to do any customisations and can proceed onto [[#Build the ISO]].<br />
<br />
== Configure our live medium ==<br />
<br />
This section details configuring the image you will be creating, allowing you to define the packages and configurations you want your live image to contain.<br />
<br />
Change into the directory we created earlier (~/archlive/releng/ if you have been following this guide), you will see a number of files and directories; we are only concerned with a few of these, mainly: <br />
packages.* - this is where you list, line by line, the packages you want to have installed, and<br />
the root-image directory - this directory acts as an overlay and it is where you make all the customisations.<br />
<br />
=== Installing packages ===<br />
<br />
You will want to create a list of packages you want installed on your live CD system. A file full of package names, one-per-line, is the format for this. This is '''''great''''' for special interest live CDs, just specify packages you want in packages.both and bake the image.<br />
The packages.i686 and packages.x86_64 files allow you to install software on just 32bit or 64bit, respectively.<br />
<br />
{{Tip|You can also create a '''[[custom local repository]]''' for the purpose of preparing custom packages or packages from [[AUR]]/[[ABS]]. Just add your local repository at the first position (for top priority) of your build machine's '''pacman.conf''' and you are good to go!}}<br />
I recommend installing "rsync" if you wish to install the system later on with no internet connection or skipping downloading it all over again. ([[#Installation]])<br />
<br />
=== Adding a user ===<br />
<br />
Copy your /etc/shadow, /etc/passwd, and /etc/group from your '''host''' system to the /etc/ directory '''of the new live system''' (which should be ~/archlive/releng/root-image/etc)<br />
e.g.<br />
# cp /etc/{shadow,passwd,group} ~/archlive/releng/root-image/etc/<br />
<br />
{{Warning|The shadow file will contain your encrypted password. I recommend before you copy the shadow file over, you change the password of your host user to that which you want your live user to have, copy the shadow file over, and then change back your password.}}<br />
<br />
=== Adding files to image ===<br />
<br />
{{Note|You must be root to do this, do not change the ownership of any of the files you copy over, '''everything''' within the root-image directory must be root owned. Proper ownerships will be sorted out shortly.}}<br />
<br />
The root-image directory acts as an overlay, think of it as root directory '/' on your current system, so any files you place within this directory will be copied over on boot-up.<br />
<br />
So if you have a set of iptables scripts on your current system you want to be used on you live image, copy them over as such:<br />
# cp -r /etc/iptables ~/archlive/releng/root-image/etc<br />
<br />
Placing files in the users home directory is a little different. Do not place them within root-image/home, but instead create a skel directory within root-image/ and place them there. We will then add the relevant commands to the rc.local we are going to create to copy them over on boot and sort out the permissions.<br />
<br />
First, create the skel directory; making sure you are within ~/archlive/releng/root-image/etc directory (if this is where you are working from):<br />
# cd ~/archlive/releng/root-image/etc && mkdir skel<br />
<br />
Now copy the 'home' files to the skel directory, again doing everything as root!<br />
e.g for .bashrc. <br />
# cp ~/.bashrc ~/archlive/releng/root-image/etc/skel/<br />
<br />
Now add the all of following to ~/archlive/releng/root-image/root/customize_root_image.sh , replacing 'youruser' with the user you specified earlier.<br />
# Create the user directory for live session<br />
if [ ! -d /home/'''youruser''' ]; then<br />
mkdir /home/'''youruser''' && chown '''youruser''' /home/'''youruser'''<br />
fi<br />
# Copy files over to home<br />
su -c "cp -r /etc/skel/.* /home/'''youruser'''/" '''youruser'''<br />
<br />
=== aitab ===<br />
<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
The aitab file holds information about the filesystems images that must be created by mkarchiso and mounted at initramfs stage from the archiso hook.<br />
It consists of some fields which define the behaviour of images.<br />
<br />
# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size><br />
<br />
; <img>: Image name without extension (.fs .fs.sfs .sfs).<br />
; <mnt>: Mount point.<br />
; <arch>: Architecture { i686 | x86_64 | any }.<br />
; <sfs_comp>: SquashFS compression type { gzip | lzo | xz }.<br />
; <fs_type>: Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs }. A special value of "none" denotes no usage of a filesystem. In that case all files are pushed directly to SquashFS filesystem.<br />
; <fs_size>: An absolute value of file system image size in MiB (example: 100, 1000, 4096, etc) A relative value of file system free space [in percent] {1%..99%} (example 50%, 10%, 7%). This is an estimation, and calculated in a simple way. Space used + 10% (estimated for metadata overhead) + desired %<br />
<br />
{{Note|Some combinations are invalid. Example both sfs_comp and fs_type are set to none}}<br />
<br />
=== Boot Loader ===<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
Due to the modular nature of isolinux, you are able to use lots of addons since all *.c32 files are copied and available to you. Take a look at the [http://syslinux.zytor.com/wiki/index.php/SYSLINUX official syslinux site] and the [https://projects.archlinux.org/archiso.git/tree/configs/syslinux-iso/boot-files archiso git repo]. Using said addons, it is possible to make visually attractive and complex menus. See [http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32 here].<br />
<br />
=== Login manager ===<br />
<br />
Starting X at boot time was done by modifying ''inittab'' on [[sysvinit]] systems. On a [[systemd]] based system things are handled by enabling your login manager's service. If you know which .service file needs a softlink: Great. If not, you can easily find out in case you're using the same program on the system you build your iso on. Just use<br />
<br />
# systemctl disable '''nameofyourloginmanager'''<br />
<br />
to temporarily turn it off. Next type the same command again and replace "disable" with "enable" to activate it again. Systemctl prints information about softlink it creates. Now change to ~/archiso/releng/root-image/etc/systemd/system and create the same softlink there.<br />
<br />
An example (make sure you're either in ~/archiso/releng/root-image/etc/systemd/system or add it to the command):<br />
<br />
# ln -s /usr/lib/systemd/system/lxdm.service display-manager.service<br />
<br />
This will enable LXDM at system start on your live system.<br />
<br />
== Build the ISO ==<br />
<br />
Now you are ready to turn your files into the .iso which you can then burn to CD or USB:<br />
Inside the directory you are working with, either ~/archlive/releng, or ~/archlive/baseline, execute:<br />
<br />
# ./build.sh -v<br />
<br />
The script will now download and install the packages you specified to work/*/root-image, create the kernel and init images, apply your customizations and finally build the iso into out/.<br />
<br />
== Using the ISO ==<br />
=== CD ===<br />
Just burn the iso to a cd. You can follow [[CD Burning]] as you wish.<br />
=== USB ===<br />
You can now dd the iso file onto a USB using dd, an example of which:<br />
# dd if=~/archlive/releng/out/*.iso of=/dev/sdx<br />
You will have to adjust accordingly, and make sure you choose the right output file! A simple mistake here will destroy data on your harddisk.<br />
<br />
=== grub4dos ===<br />
Grub4dos is a utility that can be used to create multiboot usbs, able to boot multiple linux distros from the same usb stick.<br />
<br />
To boot the generated system on a usb with grub4dos already installed, loop mount the ISO and copy the entire {{ic|/arch}} directory to the '''root of the usb'''.<br />
Then edit the {{ic|menu.lst}} file from the grub4dos (it must be on the usb root) and add this lines:<br />
{{bc|<nowiki><br />
title Archlinux x86_64<br />
kernel /arch/boot/x86_64/vmlinuz archisolabel=<your usb label><br />
initrd /arch/boot/x86_64/archiso.img<br />
</nowiki>}}<br />
Change the {{ic|x86_64}} part as necessary and put your '''real''' usb label there.<br />
<br />
=== Installation ===<br />
<br />
Boot the created CD/DVD/USB. If you wish to install the Archiso you created '''-as it is-''', there are several ways to do this, but either way we're following the [[Beginners' Guide]] mostly.<br />
<br />
If you don't have an internet connection on that PC, or if you don't want to download every packages you want again, follow the guide, and when you get to [[Beginners' Guide#Install_the_base_system]], instead of downloading, use this: [[Full System Backup with rsync]]. (more info here: [[Talk:Archiso]])<br />
<br />
You can also try: [[Archboot]], GUI installer.<br />
<br />
== See also ==<br />
*[https://projects.archlinux.org/?p=archiso.git;a=summary Archiso project page]<br />
*[[Archiso_as_pxe_server|Archiso as pxe server]]<br />
*[https://kroweer.wordpress.com/2011/09/07/creating-a-custom-arch-linux-live-usb Step-by-step tutorial on using ArchISO]<br />
*[http://didjix.blogspot.com/ A live DJ distribution powered by ArchLinux and built with Archiso]</div>Brando56894https://wiki.archlinux.org/index.php?title=Archiso&diff=282290Archiso2013-11-11T04:16:22Z<p>Brando56894: /* Adding files to image */</p>
<hr />
<div>[[Category:Live Arch systems]]<br />
[[ar:Archiso]]<br />
[[el:Archiso]]<br />
[[es:Archiso]]<br />
[[fr:Archiso]]<br />
[[it:Archiso]]<br />
[[nl:Archiso]]<br />
[[ru:Archiso]]<br />
[[uk:Archiso]]<br />
{{Out of date|References to {{ic|/etc/rc.local}}, [[systemd]] does not use it.}}<br />
<br />
'''Archiso''' is a small set of bash scripts capable of building fully functional Arch Linux based live CD and USB images. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, install disks, to special interest live CD/DVD/USB systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. The heart and soul of Archiso is mkarchiso. All of its options are documented in its usage output, so its direct usage won't be covered here. Instead, this wiki article will act as a guide for rolling your own live media in no time!<br />
<br />
== Setup ==<br />
{{Note|The script is to be used on an x86_64 machine.}}<br />
Before we begin, we need to [[pacman|install]] {{Pkg|archiso}} from the [[official repositories]]. Alternatively, {{AUR|archiso-git}} can be found in the [[AUR]].<br />
<br />
Create a directory to work within, this is where all the modifications to the live image will take place: {{ic|~/archlive}} should do fine.<br />
$ mkdir ~/archlive<br />
<br />
The archiso scripts that were installed to the host system earlier now need to be copied over into the newly created directory you will be working within.<br />
Archiso comes with two "profiles": ''releng'' and ''baseline''.<br />
If you wish to create a fully customised live version of Arch Linux, pre-installed with all your favourite programs and configurations, use ''releng''.<br />
If you just want to create the most basic live medium, with no pre-installed packages and a minimalistic configuration, use ''baseline''.<br />
<br />
So, depending on your needs, execute the following, replacing 'PROFILE' with either '''releng''' or '''baseline'''.<br />
# cp -r /usr/share/archiso/configs/'''PROFILE'''/ ~USER/archlive<br />
<br />
If you are using the ''releng'' profile to make a fully customised image, then you can proceed onto [[#Configure our live medium]].<br />
<br />
If you are using the ''baseline'' profile to create a bare image, then you won't be needing to do any customisations and can proceed onto [[#Build the ISO]].<br />
<br />
== Configure our live medium ==<br />
<br />
This section details configuring the image you will be creating, allowing you to define the packages and configurations you want your live image to contain.<br />
<br />
Change into the directory we created earlier (~/archlive/releng/ if you have been following this guide), you will see a number of files and directories; we are only concerned with a few of these, mainly: <br />
packages.* - this is where you list, line by line, the packages you want to have installed, and<br />
the root-image directory - this directory acts as an overlay and it is where you make all the customisations.<br />
<br />
=== Installing packages ===<br />
<br />
You will want to create a list of packages you want installed on your live CD system. A file full of package names, one-per-line, is the format for this. This is '''''great''''' for special interest live CDs, just specify packages you want in packages.both and bake the image.<br />
The packages.i686 and packages.x86_64 files allow you to install software on just 32bit or 64bit, respectively.<br />
<br />
{{Tip|You can also create a '''[[custom local repository]]''' for the purpose of preparing custom packages or packages from [[AUR]]/[[ABS]]. Just add your local repository at the first position (for top priority) of your build machine's '''pacman.conf''' and you are good to go!}}<br />
I recommend installing "rsync" if you wish to install the system later on with no internet connection or skipping downloading it all over again. ([[#Installation]])<br />
<br />
=== Adding a user ===<br />
<br />
There are two methods to creating a user: either by adding the relevant useradd command to rc.local, or by copying over (and modifying) /etc/shadow, /etc/passwd, and /etc/group.<br />
The latter method shall be discussed here.<br />
<br />
Copy your /etc/shadow, /etc/passwd, and /etc/group from your '''host''' system to the /etc/ directory '''of the new live system''' (which should be ~/archlive/releng/root-image/etc)<br />
e.g.<br />
# cp /etc/{shadow,passwd,group} ~/archlive/releng/root-image/etc/<br />
<br />
{{Warning|The shadow file will contain your encrypted password. I recommend before you copy the shadow file over, you change the password of your host user to that which you want your live user to have, copy the shadow file over, and then change back your password.}}<br />
<br />
=== Adding files to image ===<br />
<br />
{{Note|You must be root to do this, do not change the ownership of any of the files you copy over, '''everything''' within the root-image directory must be root owned. Proper ownerships will be sorted out shortly.}}<br />
<br />
The root-image directory acts as an overlay, think of it as root directory '/' on your current system, so any files you place within this directory will be copied over on boot-up.<br />
<br />
So if you have a set of iptables scripts on your current system you want to be used on you live image, copy them over as such:<br />
# cp -r /etc/iptables ~/archlive/releng/root-image/etc<br />
<br />
Placing files in the users home directory is a little different. Do not place them within root-image/home, but instead create a skel directory within root-image/ and place them there. We will then add the relevant commands to the rc.local we are going to create to copy them over on boot and sort out the permissions.<br />
<br />
First, create the skel directory; making sure you are within ~/archlive/releng/root-image/etc directory (if this is where you are working from):<br />
# cd ~/archlive/releng/root-image/etc && mkdir skel<br />
<br />
Now copy the 'home' files to the skel directory, again doing everything as root!<br />
e.g for .bashrc. <br />
# cp ~/.bashrc ~/archlive/releng/root-image/etc/skel/<br />
<br />
Now add the all of following to ~/archlive/releng/root-image/root/customize_root_image.sh , replacing 'youruser' with the user you specified earlier.<br />
# Create the user directory for live session<br />
if [ ! -d /home/'''youruser''' ]; then<br />
mkdir /home/'''youruser''' && chown '''youruser''' /home/'''youruser'''<br />
fi<br />
# Copy files over to home<br />
su -c "cp -r /etc/skel/.* /home/'''youruser'''/" '''youruser'''<br />
<br />
=== aitab ===<br />
<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
The aitab file holds information about the filesystems images that must be created by mkarchiso and mounted at initramfs stage from the archiso hook.<br />
It consists of some fields which define the behaviour of images.<br />
<br />
# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size><br />
<br />
; <img>: Image name without extension (.fs .fs.sfs .sfs).<br />
; <mnt>: Mount point.<br />
; <arch>: Architecture { i686 | x86_64 | any }.<br />
; <sfs_comp>: SquashFS compression type { gzip | lzo | xz }.<br />
; <fs_type>: Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs }. A special value of "none" denotes no usage of a filesystem. In that case all files are pushed directly to SquashFS filesystem.<br />
; <fs_size>: An absolute value of file system image size in MiB (example: 100, 1000, 4096, etc) A relative value of file system free space [in percent] {1%..99%} (example 50%, 10%, 7%). This is an estimation, and calculated in a simple way. Space used + 10% (estimated for metadata overhead) + desired %<br />
<br />
{{Note|Some combinations are invalid. Example both sfs_comp and fs_type are set to none}}<br />
<br />
=== Boot Loader ===<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
Due to the modular nature of isolinux, you are able to use lots of addons since all *.c32 files are copied and available to you. Take a look at the [http://syslinux.zytor.com/wiki/index.php/SYSLINUX official syslinux site] and the [https://projects.archlinux.org/archiso.git/tree/configs/syslinux-iso/boot-files archiso git repo]. Using said addons, it is possible to make visually attractive and complex menus. See [http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32 here].<br />
<br />
=== Login manager ===<br />
<br />
Starting X at boot time was done by modifying ''inittab'' on [[sysvinit]] systems. On a [[systemd]] based system things are handled by enabling your login manager's service. If you know which .service file needs a softlink: Great. If not, you can easily find out in case you're using the same program on the system you build your iso on. Just use<br />
<br />
# systemctl disable '''nameofyourloginmanager'''<br />
<br />
to temporarily turn it off. Next type the same command again and replace "disable" with "enable" to activate it again. Systemctl prints information about softlink it creates. Now change to ~/archiso/releng/root-image/etc/systemd/system and create the same softlink there.<br />
<br />
An example (make sure you're either in ~/archiso/releng/root-image/etc/systemd/system or add it to the command):<br />
<br />
# ln -s /usr/lib/systemd/system/lxdm.service display-manager.service<br />
<br />
This will enable LXDM at system start on your live system.<br />
<br />
== Build the ISO ==<br />
<br />
Now you are ready to turn your files into the .iso which you can then burn to CD or USB:<br />
Inside the directory you are working with, either ~/archlive/releng, or ~/archlive/baseline, execute:<br />
<br />
# ./build.sh -v<br />
<br />
The script will now download and install the packages you specified to work/*/root-image, create the kernel and init images, apply your customizations and finally build the iso into out/.<br />
<br />
== Using the ISO ==<br />
=== CD ===<br />
Just burn the iso to a cd. You can follow [[CD Burning]] as you wish.<br />
=== USB ===<br />
You can now dd the iso file onto a USB using dd, an example of which:<br />
# dd if=~/archlive/releng/out/*.iso of=/dev/sdx<br />
You will have to adjust accordingly, and make sure you choose the right output file! A simple mistake here will destroy data on your harddisk.<br />
<br />
=== grub4dos ===<br />
Grub4dos is a utility that can be used to create multiboot usbs, able to boot multiple linux distros from the same usb stick.<br />
<br />
To boot the generated system on a usb with grub4dos already installed, loop mount the ISO and copy the entire {{ic|/arch}} directory to the '''root of the usb'''.<br />
Then edit the {{ic|menu.lst}} file from the grub4dos (it must be on the usb root) and add this lines:<br />
{{bc|<nowiki><br />
title Archlinux x86_64<br />
kernel /arch/boot/x86_64/vmlinuz archisolabel=<your usb label><br />
initrd /arch/boot/x86_64/archiso.img<br />
</nowiki>}}<br />
Change the {{ic|x86_64}} part as necessary and put your '''real''' usb label there.<br />
<br />
=== Installation ===<br />
<br />
Boot the created CD/DVD/USB. If you wish to install the Archiso you created '''-as it is-''', there are several ways to do this, but either way we're following the [[Beginners' Guide]] mostly.<br />
<br />
If you don't have an internet connection on that PC, or if you don't want to download every packages you want again, follow the guide, and when you get to [[Beginners' Guide#Install_the_base_system]], instead of downloading, use this: [[Full System Backup with rsync]]. (more info here: [[Talk:Archiso]])<br />
<br />
You can also try: [[Archboot]], GUI installer.<br />
<br />
== See also ==<br />
*[https://projects.archlinux.org/?p=archiso.git;a=summary Archiso project page]<br />
*[[Archiso_as_pxe_server|Archiso as pxe server]]<br />
*[https://kroweer.wordpress.com/2011/09/07/creating-a-custom-arch-linux-live-usb Step-by-step tutorial on using ArchISO]<br />
*[http://didjix.blogspot.com/ A live DJ distribution powered by ArchLinux and built with Archiso]</div>Brando56894https://wiki.archlinux.org/index.php?title=Shorewall&diff=256380Shorewall2013-05-08T17:59:15Z<p>Brando56894: /* Configuration */</p>
<hr />
<div>[[Category:Firewalls]]<br />
[http://www.shorewall.net/ The Shoreline Firewall], more commonly known as "Shorewall", is high-level tool for configuring Netfilter. <br />
<br />
You describe your firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables utility, Shorewall configures Netfilter to match your requirements. <br />
<br />
Shorewall can be used on a dedicated firewall system, a multi-function gateway/router/server or on a standalone GNU/Linux system. Shorewall does not use Netfilter's ipchains compatibility mode and can thus take advantage of Netfilter's connection state tracking capabilities.<br />
<br />
== Installation ==<br />
{{Pkg|shorewall}} is available in the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
These settings are based on the [http://www.shorewall.net/two-interface.htm two-interface documentation on the shorewall website].<br />
<br />
Use the some example configuration files that come with the shorewall package<br />
<br />
# cp /usr/share/doc/shorewall/Samples/two-interfaces/* /etc/shorewall/<br />
<br />
===/etc/shorewall/interfaces===<br />
<br />
'''Change''' the interface settings to match the names used for our ethernet devices and to allow dhcp traffic on the local network. Edit {{ic|/etc/shorewall/interfaces}}<br />
<br />
original<br />
net eth0 detect dhcp,tcpflags,nosmurfs,routefilter,logmartians<br />
loc eth1 detect tcpflags,nosmurfs,routefilter,logmartians<br />
<br />
new<br />
net wan detect dhcp,tcpflags,nosmurfs,routefilter,logmartians<br />
loc lan detect dhcp,tcpflags,nosmurfs,routefilter,logmartians<br />
<br />
===/etc/shorewall/policy===<br />
<br />
'''Change''' the policy file to allow the router (this machine) to access the Internet. Edit {{ic|/etc/shorewall/policy}}<br />
<br />
original<br />
{{bc|<br />
###############################################################################<br />
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST<br />
<br />
loc net ACCEPT<br />
net all DROP info<br />
# THE FOLLOWING POLICY MUST BE LAST<br />
all all REJECT info<br />
}}<br />
<br />
new<br />
{{bc|<br />
###############################################################################<br />
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST<br />
$FW net ACCEPT<br />
loc net ACCEPT<br />
net all DROP info<br />
# THE FOLLOWING POLICY MUST BE LAST<br />
all all REJECT info<br />
}}<br />
<br />
===/etc/shorewall/rules===<br />
<br />
DNS lookups are handled (actually forwarded) by dnsmasq, so shorewall needs to allow those connections. '''Add''' these lines to {{ic|/etc/shorewall/rules}}<br />
<br />
{{bc|<br />
# Accept DNS connections from the local network to the firewall<br />
#<br />
DNS(ACCEPT) loc $FW<br />
}}<br />
<br />
==== SSH ====<br />
'''OPTIONAL:''' You can '''add''' these lines if you want to be able to SSH into the router from computers on the Internet<br />
<br />
{{bc|<br />
# Accept SSH connections from the internet for administration<br />
#<br />
SSH(ACCEPT) net $FW TCP <SSH port used><br />
}}<br />
<br />
====Port forwarding (DNAT)====<br />
* /etc/shorewall/rules : here is an example for a webserver on our LAN with IP 10.0.0.85. You can reach it on port 5000 of our "external" IP.<br />
DNAT net loc:10.0.0.85:80 tcp 5000<br />
<br />
===/etc/shorewall/shorewall.conf===<br />
<br />
When you are finished making above changes, enable shorewall by a '''change''' in it's config file {{ic|/etc/shorewall/shorewall.conf}}:<br />
<br />
original<br />
STARTUP_ENABLED=No<br />
<br />
new<br />
STARTUP_ENABLED=Yes<br />
<br />
See [http://shorewall.net/manpages/shorewall.conf.html man page] for more info.<br />
<br />
== Start ==<br />
# systemctl enable shorewall<br />
# systemctl start shorewall</div>Brando56894https://wiki.archlinux.org/index.php?title=LibreOffice&diff=256004LibreOffice2013-05-03T20:45:54Z<p>Brando56894: /* Speed up LibreOffice */</p>
<hr />
<div>[[Category:Office]]<br />
[[de:LibreOffice]]<br />
[[es:LibreOffice]]<br />
[[fr:LibreOffice]]<br />
[[ja:LibreOffice]]<br />
[[ru:LibreOffice]]<br />
[[zh-CN:LibreOffice]]<br />
From [http://www.libreoffice.org/ Home - LibreOffice]:<br />
<br />
:''LibreOffice is the free power-packed Open Source personal productivity suite for Windows, Macintosh and Linux, that gives you six feature-rich applications for all your document production and data processing needs: Writer, Calc, Impress, Draw, Math and Base. [http://www.libreoffice.org/get-help/ Support] and [http://www.libreoffice.org/get-help/documentation/ documentation] is free from our large, dedicated community of users, contributors and developers. [http://www.libreoffice.org/get-involved/ You, too, can also get involved!]''<br />
<br />
==LibreOffice in Arch Linux==<br />
Official support for [[OpenOffice.org]] was dropped in favor of LibreOffice. See [https://mailman.archlinux.org/pipermail/arch-general/2011-March/018819.html Dropping Oracle OpenOffice (arch-general)].<br />
<br />
LibreOffice is the "Document Foundation" fork, located in the extra repository, which includes enhancements and features.<br />
<br />
==Installation==<br />
===Stable version===<br />
Ensure that the fonts {{Pkg|ttf-dejavu}} and {{Pkg|artwiz-fonts}} are installed before continuing, otherwise LibreOffice will display rectangles instead of text.<br />
<br />
Download and install the base for stable and/or beta and/or devel:<br />
# pacman -S libreoffice <br />
Since version 3.4.2rc1, LibreOffice has been split. The install will give you a menu prompting for which components to install. As the language pack for en-US is no longer included by default, you will need to install at least 1 language pack. The default language is Afrikaans (because it is alphabetically the first provider of libreoffice-langpack), the previous default (en-US) is at number 24:<br />
{{bc|<nowiki><br />
[user@home ~]# pacman -S libreoffice<br />
:: There are 12 members in group libreoffice:<br />
:: Repository extra<br />
1) libreoffice-base 2) libreoffice-calc 3) libreoffice-common<br />
4) libreoffice-draw 5) libreoffice-gnome 6) libreoffice-impress<br />
7) libreoffice-kde4 8) libreoffice-math<br />
9) libreoffice-postgresql-connector 10) libreoffice-sdk<br />
11) libreoffice-sdk-doc 12) libreoffice-writer<br />
<br />
Enter a selection (default=all): <br />
resolving dependencies...<br />
:: There are 108 providers available for libreoffice-langpack:<br />
:: Repository extra<br />
1) libreoffice-af 2) libreoffice-am 3) libreoffice-ar 4) libreoffice-as<br />
5) libreoffice-ast 6) libreoffice-be 7) libreoffice-bg 8) libreoffice-bn<br />
9) libreoffice-bn-IN 10) libreoffice-bo 11) libreoffice-br<br />
12) libreoffice-brx 13) libreoffice-bs 14) libreoffice-ca<br />
15) libreoffice-ca-XV 16) libreoffice-cs 17) libreoffice-cy<br />
18) libreoffice-da 19) libreoffice-de 20) libreoffice-dgo<br />
21) libreoffice-dz 22) libreoffice-el 23) libreoffice-en-GB<br />
24) libreoffice-en-US 25) libreoffice-en-ZA 26) libreoffice-eo<br />
27) libreoffice-es 28) libreoffice-et 29) libreoffice-eu<br />
30) libreoffice-fa 31) libreoffice-fi 32) libreoffice-fr<br />
33) libreoffice-ga 34) libreoffice-gd 35) libreoffice-gl<br />
36) libreoffice-gu 37) libreoffice-he 38) libreoffice-hi<br />
39) libreoffice-hr 40) libreoffice-hu 41) libreoffice-id<br />
42) libreoffice-is 43) libreoffice-it 44) libreoffice-ja<br />
45) libreoffice-ka 46) libreoffice-kk 47) libreoffice-km<br />
48) libreoffice-kn 49) libreoffice-ko 50) libreoffice-kok<br />
51) libreoffice-ks 52) libreoffice-ku 53) libreoffice-lb<br />
54) libreoffice-lo 55) libreoffice-lt 56) libreoffice-lv<br />
57) libreoffice-mai 58) libreoffice-mk 59) libreoffice-ml<br />
60) libreoffice-mn 61) libreoffice-mni 62) libreoffice-mr<br />
63) libreoffice-my 64) libreoffice-nb 65) libreoffice-ne<br />
66) libreoffice-nl 67) libreoffice-nn 68) libreoffice-nso<br />
69) libreoffice-oc 70) libreoffice-om 71) libreoffice-or<br />
72) libreoffice-pa-IN 73) libreoffice-pl 74) libreoffice-pt<br />
75) libreoffice-pt-BR 76) libreoffice-ro 77) libreoffice-ru<br />
78) libreoffice-rw 79) libreoffice-sa-IN 80) libreoffice-sat<br />
81) libreoffice-sd 82) libreoffice-sh 83) libreoffice-si<br />
84) libreoffice-sk 85) libreoffice-sl 86) libreoffice-sq<br />
87) libreoffice-sr 88) libreoffice-ss 89) libreoffice-st<br />
90) libreoffice-sv 91) libreoffice-sw-TZ 92) libreoffice-ta<br />
93) libreoffice-te 94) libreoffice-tg 95) libreoffice-th<br />
96) libreoffice-tn 97) libreoffice-tr 98) libreoffice-ts<br />
99) libreoffice-tt 100) libreoffice-ug 101) libreoffice-uk<br />
102) libreoffice-uz 103) libreoffice-ve 104) libreoffice-vi<br />
105) libreoffice-xh 106) libreoffice-zh-CN 107) libreoffice-zh-TW<br />
108) libreoffice-zu<br />
<br />
Enter a number (default=1):<br />
</nowiki>}}<br />
{{Note|A common mistake is to install {{Pkg|libreoffice-uk}}, which is the Ukrainian language pack, instead of {{Pkg|libreoffice-en-GB}}.}}<br />
Alternatively, you can install it this way:<br />
# pacman -S libreoffice-{en-US,common,base,calc,draw,impress,math,writer,gnome,kde4,sdk,sdk-doc}<br />
<br />
{{Note|Both ways work and you need {{Pkg|libreoffice-kde4}} or {{Pkg|libreoffice-gnome}} only if you care about qt or gtk visual integration - see Theme section below.}}<br />
<br />
Check the recommended optional dependencies pacman suggests. E.g. install a Java Runtime Environment (optional, highly recommended). See: [[Java]]. You will need {{Pkg|hsqldb-java}} to use Libreoffice Base.<br />
<br />
==Theme==<br />
For Qt integration, [[pacman|install]] the package {{Pkg|libreoffice-kde4}}.<br />
<br />
For GTK integration, [[pacman|install]] the package {{Pkg|libreoffice-gnome}}.<br />
<br />
Even if you are not running one of these desktop environments and thus do not need to "integrate" with them, you may still wish to install these packages so that libreoffice will use non-default gtk or qt themes. For example, libreoffice on e17 uses the default "ugly" (aka "win95") theme; installing libreoffice-gnome will allow you to select a more pleasant gtk theme.<br />
<br />
As of LibreOffice version 3.5.x it tries to magically autodetect your desktop UI using the following magic if proper libs will be found:<br />
gtk3 -> gtk2 -> kde4 -> generic<br />
<br />
To force the use of a certain VCL UI interface use one of this:<br />
SAL_USE_VCLPLUGIN=gen lowriter<br />
SAL_USE_VCLPLUGIN=kde4 lowriter <br />
SAL_USE_VCLPLUGIN=gtk lowriter <br />
SAL_USE_VCLPLUGIN=gtk3 lowriter<br />
<br />
The new gtk3 UI is still marked upstream as experimental and will only be available if you enable "experimental features" in LibO main configuration dialog.<br />
<br />
However, if it looks like it's using Windows 98 icons, go to tools -> options -> accessibility and uncheck "Automatically detect high contrast mode of the system."<br />
<br />
Libreoffice 4.x series is able to use Firefox personas.<br />
Enter Libreoffice options and choose "Personalization", "Select Personas", then paste the URL of your favourite one. A convenient button in the dialog box lets you open the browser.<br />
<br />
==Extension management==<br />
<br />
Arch is shipping some additional extensions. We currently ship these extensions: pdfimport presentation-minimizer presenter-screen report-builder wiki-publisher ct2n hunart numbertext oooblogger typo watch-window diagram. You can install them with pacman:<br />
<br />
# pacman -S libreoffice-extension-nlpsolver libreoffice-extension-foo ...<br />
<br />
Check the built-in LibreOffice Extension manager or [http://libreplanet.org/wiki/Group:OpenOfficeExtensions/List Get extensions Online] if you want to install more extensions.<br />
<br />
==Language Aids==<br />
===Spell checking===<br />
For spell checking, you will need {{Pkg|hunspell}} and a language dictionary for hunspell (like {{Pkg|hunspell-en}} for English, {{Pkg|hunspell-de}} for German, etc).<br />
<br />
===Hyphenation rules===<br />
For hyphenation rules, you will need {{Pkg|hyphen}} and a language hyphen rule set ({{Pkg|hyphen-en}} for English, {{Pkg|hyphen-de}} for German, etc).<br />
<br />
===Thesaurus===<br />
For the thesaurus option, you will need {{Pkg|libmythes}} and a mythes language thesaurus (like {{Pkg|mythes-en}} for English, {{Pkg|mythes-de}} for German, etc).<br />
<br />
===Grammar checking===<br />
For grammar checking, you will need to install an extension such as LanguageTool, which can be found in the [[Arch User Repository|AUR]]: {{AUR|libreoffice-extension-languagetool}} or the [http://www.languagetool.org/ LanguageTool Website].<br />
<br />
Other grammar tools can also be found on the [http://libreplanet.org/wiki/Group:OpenOfficeExtensions/List LibreOffice Extension Page] or [http://lingucomponent.openoffice.org/grammar.html OpenOffice's Website]. Not all OpenOffice extensions are guaranteed to work with LibreOffice.<br />
<br />
{{Note|Languagetool uses java and may slow down or briefly hang LibreOffice, particularly while opening documents. Fortunately this is usually only when initially opening a document and is usually not apparent otherwise.<br />
<br />
Openjdk6 seems to get the better results than openjdk7 with LanguageTool, although this is unconfirmed.}}<br />
<br />
==Installing Macros==<br />
If you intend to use macros, you must have a JRE enabled, use of a JRE is default behaviour. But disabling it [[LibreOffice#Speed_up_LibreOffice|speeds up the program]].<br />
<br />
The default path for macros in Arch Linux is different from most Linux distributions. Its location is<br />
~/.config/libreoffice/4/user/Scripts/<br />
<br />
==Running LibreOffice==<br />
<br />
If you want to run a specific module of LibreOffice (instead of the LibreOffice default Startcenter ({{ic|/usr/bin/soffice}} is still included for fallback reasons)), use the following script front-ends:<br />
<br />
;Writer (Word processor): {{ic|/usr/bin/libreoffice --writer}} or {{ic|/usr/bin/soffice --writer}}<br />
<br />
;Calc (Spreadsheet editor): {{ic|/usr/bin/libreoffice --calc}}<br />
<br />
;Impress (Presentation editor): {{ic|/usr/bin/libreoffice --impress}}<br />
<br />
;Draw (Vector graphics editor): {{ic|/usr/bin/libreoffice --draw}}<br />
<br />
;Math (Formula Editor): {{ic|/usr/bin/libreoffice --math}}<br />
<br />
;Base (Database front-end): {{ic|/usr/bin/libreoffice --base}}<br />
<br />
==Speed up LibreOffice==<br />
Some settings may improve LibreOffice's loading time and responsiveness. However, some also increase RAM usage, so use them carefully. They can all be accessed under ''Tools > Options''.<br />
*Under ''Memory'':<br />
**Reduce the number of Undo steps to a figure lower than 100, to something like 20 or 30 steps.<br />
**Under Graphics cache, set Use for LibreOffice to 128 MB (up from the original 20MB).<br />
**Set Memory per object to 20MB (up from the default 5MB).<br />
**If you use LibreOffice often, check LibreOffice Quickstarter.<br />
*Under ''Advanced'', uncheck Use a Java runtime environment.<br />
{{Note|For a list of functionality written in Java only, see: https://wiki.documentfoundation.org/Development/Java}}<br />
<br />
==Troubleshooting==<br />
=== Font substitution ===<br />
These settings can be changed in the LibreOffice options. From the drop-down menu, select ''Tools > Options > LibreOffice > Fonts''. Check the box that says ''Apply Replacement Table''. Type {{ic|Andale Sans UI}} in the font box and choose your desired font for the ''Replace with'' option. When done, click the ''checkmark''. Then choose the ''Always'' and ''Screen only'' options in the box below. Click OK.<br />
You will then need to go to ''Tools > Options > LibreOffice > View'', and uncheck "Use system font for user interface". If you use a non-antialised font, such as Arial, you will also need to uncheck "Screen font antialiasing" before menu fonts render correctly.<br />
<br />
=== Microsoft Fonts ===<br />
Official Microsoft fonts are useful to prevent pagination problems. Check the [[MS_Fonts]] wiki page.<br />
<br />
=== Anti-aliasing ===<br />
Execute<br />
$ echo "Xft.lcdfilter: lcddefault" | xrdb -merge<br />
<br />
To make the change persistent, add {{ic|Xft.lcdfilter: lcddefault}} to your {{ic|~/.Xresources}} file, and make sure to run {{ic|xrdb -merge ~/.Xresources}}. [https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/271283/comments/19]. See [[X resources]] for more details.<br />
<br />
If this does not work, you can also try adding {{ic|Xft.lcdfilter: lcddefault}} to your {{ic|~/.Xdefaults}}. If you do not have this file, you will have to create it.<br />
<br />
=== Hanging when using NFS shares ===<br />
If LibreOffice hangs when trying to open or save a document located on a NFS share, try prepending the following lines with a {{ic|#}} in {{ic|/usr/lib/libreoffice/program/soffice}}:<br />
# file locking now enabled by default<br />
SAL_ENABLE_FILE_LOCKING=1<br />
export SAL_ENABLE_FILE_LOCKING<br />
<br />
To avoid overwriting on update you can copy {{ic|/usr/lib/libreoffice/program/soffice}} in {{ic|/usr/local/bin}}. Original post [http://www.crazysquirrel.com/computing/debian/bugs/openoffice-over-nfs.jspx here].<br />
<br />
{{Note|Only NFSv3 is affected. NFSv4 works well with LibreOffice.}}<br />
<br />
=== Fixing Java Framework Error ===<br />
You may get the following error when you try to run LibreOffice. <br />
<br />
[Java framework] Error in function createSettingsDocument (elements.cxx).<br />
javaldx failed!<br />
<br />
If so, give yourself ownership of {{ic|~/.config/}} like so: <br />
sudo chown -vR username:users ~/.config<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=93168 Post on Arch Linux Forums]<br />
<br />
=== LibreOffice does not detect my certificates ===<br />
<br />
If you cannot see the certificates when trying to sign a document, you will need to have the certificates configured in Mozilla Firefox (or Thunderbird). If after that LibreOffice still does not show them, set the {{ic|MOZILLA_CERTIFICATE_FOLDER}} environment variable to point to your Mozilla Firefox (or Thunderbird) folder.<br />
export MOZILLA_CERTIFICATE_FOLDER=$HOME/.mozilla/firefox/XXXXXX.default/<br />
<br />
[http://wiki.services.openoffice.org/wiki/Certificate_Detection Certificate Detection]<br />
<br />
=== Run .pps files in edit mode (without slideshow) ===<br />
The only solution is to rename .pps file in .ppt<br />
<br />
Add the following script to your home directory and use it to open every .pps file. Very useful to open .pps files received by email without the need to save them.<br />
<br />
#!/bin/bash<br />
<br />
f=`mktemp`<br />
<br />
cp "$1" "${f}.ppt" && libreoffice "${f}.ppt" && rm -f "${f}.ppt"<br />
<br />
=== Bibliography problems ===<br />
If Writer crashes on attempting to access Tools -> Bibliography Database, with the following error:<br />
com::sun::star::loader::CannotActivateFactoryException<br />
Install {{pkg|libreoffice-base}} as this is a workaround to a known bug, purportedly [http://cgit.freedesktop.org/libreoffice/core/commit/?id=1889c1af41650576a29c587a0b2cdeaf0d297587 fixed]</div>Brando56894https://wiki.archlinux.org/index.php?title=VirtualBox&diff=254909VirtualBox2013-04-22T16:34:33Z<p>Brando56894: /* USB subsystem is not working on the host or guest */</p>
<hr />
<div>[[Category:Emulators]]<br />
[[Category:Virtualization]]<br />
[[cs:VirtualBox]]<br />
[[de: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 />
{{Article summary start}}<br />
{{Article summary text|This article is about basic usage of VirtualBox, including running the VirtualBox software within an Arch ''host'', and running an Arch ''guest'' inside a VirtualBox virtual machine.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|VirtualBox|https://www.virtualbox.org}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|VirtualBox Extras}}<br />
{{Article summary wiki|PhpVirtualBox}}<br />
{{Article summary wiki|VirtualBox Arch Linux Guest On Physical Drive}}<br />
{{Article summary wiki|Advanced VirtualBox Networking}}<br />
{{Article summary wiki|Installing Arch Linux from VirtualBox}}<br />
{{Article summary wiki|Moving an existing install into (or out of) a virtual machine}}<br />
{{Article summary end}}<br />
<br />
'''VirtualBox''' is a virtual PC emulator like [[VMware]]. It is in constant development and new features are implemented all the time. e.g. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a [[Qt]] GUI interface, as well as headless and [[Wikipedia:SDL|SDL]] command line tools for managing and running virtual machines. It includes ''guest additions'' for some guest operating systems, which integrate functions of the guest and host systems, including sharing files, the clipboard, video acceleration and a “seamless” window integration mode.<br />
<br />
{{Wikipedia|VirtualBox}}<br />
<br />
== Installation on host ==<br />
<br />
The basic GPL-licensed VirtualBox suite can be [[pacman|installed]] with the {{Pkg|virtualbox}} package, found in the [[official repositories]].<br />
<br />
The {{pkg|virtualbox-host-modules}} package, which contains the precompiled modules for the stock archlinux kernel, should be installed with it. If you are using the {{pkg|linux-lts}} kernel you should also install the {{pkg|virtualbox-host-modules-lts}} package. For custom kernels, read [[#Hosts running a custom kernel|the section below]].<br />
<br />
In order to use the graphical interface, based on [[Qt]] ({{ic|VirtualBox}} command), you will also need to install the {{Pkg|qt4}} package. This is not required for the simpler SDL-only GUI ({{ic|VBoxSDL}} command) nor for the {{ic|VBoxHeadless}} command.<br />
<br />
=== Hosts running a custom kernel ===<br />
<br />
VirtualBox works just fine with custom kernels such as [[Linux-ck]] ''without'' the need to keep any of the official ARCH kernel packages on the system. The trick to keeping pacman from bringing down the ARCH kernel packages is to install virtualbox with the {{Pkg|virtualbox-host-dkms}} package, which contains the source for the virtualbox kernel modules. See {{Bug|26721}} for further explanations.<br />
<br />
Once {{Pkg|virtualbox-host-dkms}} is installed, simply generate the kernel modules for your custom kernel by running:<br />
# dkms install vboxhost/<virtualbox-host-source version> -k <your custom kernel's version>/<your architecture><br />
<br />
Which for the lazy is the command:<br />
# dkms install vboxhost/$(pacman -Q virtualbox|awk {'print $2'}|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')<br />
<br />
and load it:<br />
# modprobe vboxdrv<br />
<br />
To load/compile virtualbox modules automatically at startup you can enable {{ic|dkms.service}}:<br />
# systemctl enable dkms.service<br />
<br />
==== Automatic re-compilation of the virtualbox host modules with every update of any kernel====<br />
<br />
This is possible thanks to {{AUR|vboxhost-hook}} from the [[AUR]]. In '''vboxhost-hook''', the 'automatic re-compilation' functionality is done by a '''vboxhost hook''' on [[mkinitcpio]] after forcing to update the {{Pkg|linux-headers}} package. You will need to add 'vboxhost' to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}, as well as 'linux-headers' and your custom kernel(s) headers to the SyncFirst array in {{ic|/etc/pacman.conf}} for this to work.<br />
<br />
{{Warning|The SyncFirst option is no longer available as of pacman 4.1. Use<br />
<br />
$ pacman -Sy linux-headers && pacman -Su<br />
<br />
instead to manually cause linux-headers to be updated first. See [https://mailman.archlinux.org/pipermail/arch-general/2013-April/033297.html This explanation].}}<br />
<br />
The hook will call the '''dkms''' command to update the virtualbox host modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. vboxhost hook will tell you if anything goes wrong.}}<br />
<br />
== Setup ==<br />
<br />
Add the desired username to the '''vboxusers''' [[group]]. Everything may work fine without this step but shared folders and possibly some other optional stuff require it to work. The new group does not automatically apply to existing sessions; the user has to log in again or start a new environment with a command like {{Ic|newgrp}} or {{Ic|sudo -u ''username'' -s}}.<br />
<br />
# gpasswd -a ''username'' vboxusers<br />
<br />
=== Loading Kernel Modules ===<br />
VirtualBox running on Linux uses its own [[kernel modules]], including a mandatory module named '''vboxdrv''', which must be loaded before 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 />
<br />
# modprobe vboxdrv<br />
<br />
To load the VirtualBox driver at startup, create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/[[Kernel_modules#Loading|modules-load.d]]}} that contains all modules that should be loaded:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxdrv}}<br />
<br />
{{Note|You may need to update the kernel modules db in order to avoid 'no such file or directory' error when loading vboxdrv. Run: {{ic|depmod -a}}.}}<br />
<br />
To start the VirtualBox graphical manager:<br />
<br />
$ VirtualBox<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 as the {{pkg|net-tools}} package.<br />
<br />
=== Guest additions disc ===<br />
<br />
The {{Pkg|virtualbox}} package also suggests installing {{Pkg|virtualbox-guest-iso}} on the host (Arch Linux) running VirtualBox. It is a disc image that can be used to install the guest additions onto guest systems. Make it available to the (running) guest by going to Devices and clicking "Install Guest Additions... Host+D". Then run the guest additions installation from inside the guest.<br />
<br />
=== Booting a live disc ===<br />
<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512&nbsp;MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
=== Starting virtual machines with a service ===<br />
<br />
See [[Systemd/Services#VirtualBox virtual machines]] for details on how to setup a systemd service for each virtual machine.<br />
<br />
=== Advanced setup ===<br />
<br />
See [[VirtualBox Extras]] for advanced configuration.<br />
<br />
== Arch Linux guests ==<br />
<br />
Installing Arch under VirtualBox is straightforward, and additions should be installed through pacman (not through "Install Guest Additions" in VirtualBox, or from a mounted ISO image).<br />
<br />
=== Install the Guest Additions ===<br />
<br />
Install the {{Pkg|virtualbox-guest-utils}} package. Manually load the modules with:<br />
<br />
# modprobe -a vboxguest vboxsf vboxvideo<br />
<br />
Create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with these lines:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxguest<br />
vboxsf<br />
vboxvideo}}<br />
<br />
=== Automatic re-compilation of the VirtualBox guest modules with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|vboxguest-hook}} from the [[AUR]]. In '''vboxguest-hook''', the 'automatic re-compilation' functionality is done by a '''vboxguest hook''' on [[mkinitcpio]] after forcing to update the {{pkg|linux-headers}} package. You will need to add {{ic|vboxguest}} to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}. You may need to manually recreate the initramfs after an upgrade of the {{pkg|linux-headers}} package.<br />
<br />
The hook will call the {{ic|dkms}} command to update the VirtualBox guest modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality, it is '''important''' to look at the installation process of the {{pkg|linux}} (or any other kernel) package. vboxguest hook will tell you if anything goes wrong.}}<br />
<br />
=== Start the sharing services ===<br />
After installing {{Pkg|virtualbox-guest-utils}} above, you should start {{ic|VBoxClient-all}} to start services for sharing the clipboard, resizing the screen, etc.<br />
* If you are running something that launches {{Ic|/etc/xdg/autostart/vboxclient.desktop}}, such as GNOME or KDE, then nothing needs to be done. <br />
* If you use {{Ic|.xinitrc}} to launch things instead, you must add the following to your {{Ic|.xinitrc}} before launching your WM.<br />
<br />
# VBoxClient-all &<br />
<br />
=== Using USB webcam / microphone ===<br />
<br />
{{Note|You will need to have VirtualBox extension pack installed before following the steps below. See [[VirtualBox_Extras#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 {{keypress|+}} 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 {{Keypress|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 {{keypress|F12}} right after starting virtual machine. It comes in handy when using rEFInd + EFISTUB, for example.}}<br />
<br />
== Shared Folders as Arch Linux Guest ==<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. Creating a shared folder from the VirtualBox program in the host locates that folder in {{Ic|/media/sf_''SHAREDFOLDERNAME''}}. At this time an additional step is needed to have that folder created in the Arch Guest because Arch use a package for Guest Additions. To create and access this shared folder from the Arch Guest, this must also be done at the command line after installing the Guest Additions package(s) from pacman:<br />
<br />
# groupadd vboxsf<br />
# gpasswd -a $USER vboxsf<br />
<br />
If you wish, a symbolic link may be made to another folder in your home directory for easy access. As an example, if a shared folder named "Dropbox" was created in the VirtualBox program on the host machine, then /media/sf_Dropbox is automatically created in the guest so this could be done:<br />
<br />
$ ln -s /media/sf_Dropbox/* ~/dropbox<br />
<br />
The .run script provided in the Guest Additions iso does this for you, however, Arch does not recommend using that script so this step must be done manually. The instructions for it were found here: (pastebin: [http://pastebin.com/6cUE3kjF]) .<br />
<br />
If shared folders are not auto-mounted, try [https://bbs.archlinux.org/viewtopic.php?id=70780 manually mount] or read the next section.<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 mountpoints 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 />
=== Synchronise guest date with host ===<br />
<br />
To keep sync date and time, make sure you have {{Pkg|virtualbox-guest-utils}} installed in your host (see [[#Install the Guest Additions|previous section]]). Then run<br />
# systemctl enable vboxservice.service<br />
<br />
To enable the service for next boot. To start immediately, run<br />
# systemctl start vboxservice.service<br />
<br />
You also need run this daemon in order to use auto-mounting feature of shared folders that are mentioned above.<br />
<br />
== Troubleshooting ==<br />
=== VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) ===<br />
This can occur if a VM is exited ungracefully. The solution to unlock the VM is trivial:<br />
VBoxManage controlvm nArch poweroff<br />
<br />
=== USB subsystem is not working on the host or guest ===<br />
<br />
Sometimes the USB subsystem is not auto-detected resulting in an error or in a not visible USB drive on the host, even when the user is in the '''vboxusers''' group. See this topic [https://bbs.archlinux.org/viewtopic.php?id=125785] for details.<br />
<br />
USB subsystem will work if you add<br />
<br />
VBOX_USB=usbfs<br />
<br />
to {{Ic|~/.bashrc}} and reboot your system or open a new bash instance.<br />
<br />
Also make sure that your user is a member of the '''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. It's possible to load these kernel modules manually with<br />
<br />
# modprobe -a vboxnetadp vboxnetflt<br />
<br />
To load them automatically at boot, add a new line for each module to {{ic|/etc/modules-load.d/virtualbox.conf}}:<br />
<br />
vboxdrv<br />
vboxnetadp<br />
vboxnetflt<br />
<br />
{{Note|These used to be added to the {{ic|MODULES}} array in {{ic|/etc/rc.conf}}. This is now deprecated.}}<br />
<br />
More information in [https://bbs.archlinux.org/viewtopic.php?id=130581 this] topic.<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}} add the following key to the Virtual Windows XP registry:<br />
<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. {{Keypress|Host+F}} to redraw/enter full screen).<br />
<br />
=== Mounting .vdi Images ===<br />
<br />
This just work with '''static''' size vdi images! '''Dynamic size won't''' be easy mountable! First we need one information from your .vdi image:<br />
<br />
$ VBoxManage internalcommands dumphdinfo Arch_64min.vdi |grep offData<br />
Header: offBlocks=4096 offData=69632<br />
<br />
Now, '''add to your''' {{ic|offData}} 32256. e.g. 32256 + 69632 = 101888<br />
<br />
Now you can mount your vdi image:<br />
<br />
# mount -t ext4 -o rw,noatime,noexec,loop,offset=101888 Arch_64min.vdi /mnt/<br />
<br />
=== Startup problems because of mount failures ===<br />
<br />
If you experience problems in a [[systemd]] setup after a kernel upgrade, you should start the system with {{ic|1=init=/bin/bash}} (if the emergency shell does not work for you).<br />
<br />
root=/dev/mapper/vg_main-lv_root ro vga=792 resume=/dev/mapper/vg_main-lv_swap init=/bin/bash<br />
<br />
Then mount the ''root''-filesystem with write access:<br />
<br />
# mount / -o remount,rw<br />
<br />
Change {{ic|/etc/fstab}} according to [[#Shared Folders as Arch Linux Guest]]. Then exec systemd within the Bash shell:<br />
<br />
# exec /bin/systemd<br />
<br />
=== Copy&Paste not working on Arch Linux Guest ===<br />
<br />
Since updating {{ic|virtualbox-guest-additions}} to version {{ic|4.2.0-2}} copy&paste from Host OS to Arch Linux Guest stopped working. It seems to be due to {{ic|VBoxClient-all}} requiring ''root'' access. In previous versions adding ''VBoxClient-all &'' to ''~/.xinitrc'' was sufficient to make copy&paste work. Update ''~/.xinitrc'' to match {{ic|sudo VBoxClient-all &}} and add the line {{ic|, NOPASSWD: /usr/bin/VBoxClient-all}} to your username in the sudoers file and restart X. It should all work again. The line in the sudoers file should look similar to this:<br />
<br />
# Allow sudo for user 'you' and let him run VBoxClient-all without requiring a password<br />
you ALL = PASSWD: ALL, NOPASSWD: /usr/bin/VBoxClient-all<br />
<br />
{{Note|Use {{ic|visudo}} to edit the sudoers file. This will check for syntax errors when saving.}}<br />
<br />
=== Use Serial port in guest OS ===<br />
Check you permission in 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 you user in '''uucp''' group.<br />
# gpasswd -a YOURUSER uucp <br />
and relogon.<br />
<br />
=== Abort on resume ===<br />
There is a known bug that causes abort on resume: https://www.virtualbox.org/ticket/11289. The workaround is simple: always use Host+q or the menu to close the VM.<br />
<br />
== External links ==<br />
<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>Brando56894https://wiki.archlinux.org/index.php?title=VirtualBox&diff=254908VirtualBox2013-04-22T16:34:16Z<p>Brando56894: /* USB subsystem is not working on the host or guest */</p>
<hr />
<div>[[Category:Emulators]]<br />
[[Category:Virtualization]]<br />
[[cs:VirtualBox]]<br />
[[de: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 />
{{Article summary start}}<br />
{{Article summary text|This article is about basic usage of VirtualBox, including running the VirtualBox software within an Arch ''host'', and running an Arch ''guest'' inside a VirtualBox virtual machine.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|VirtualBox|https://www.virtualbox.org}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|VirtualBox Extras}}<br />
{{Article summary wiki|PhpVirtualBox}}<br />
{{Article summary wiki|VirtualBox Arch Linux Guest On Physical Drive}}<br />
{{Article summary wiki|Advanced VirtualBox Networking}}<br />
{{Article summary wiki|Installing Arch Linux from VirtualBox}}<br />
{{Article summary wiki|Moving an existing install into (or out of) a virtual machine}}<br />
{{Article summary end}}<br />
<br />
'''VirtualBox''' is a virtual PC emulator like [[VMware]]. It is in constant development and new features are implemented all the time. e.g. version 2.2 introduced OpenGL 3D acceleration support for Linux and Solaris guests. It has a [[Qt]] GUI interface, as well as headless and [[Wikipedia:SDL|SDL]] command line tools for managing and running virtual machines. It includes ''guest additions'' for some guest operating systems, which integrate functions of the guest and host systems, including sharing files, the clipboard, video acceleration and a “seamless” window integration mode.<br />
<br />
{{Wikipedia|VirtualBox}}<br />
<br />
== Installation on host ==<br />
<br />
The basic GPL-licensed VirtualBox suite can be [[pacman|installed]] with the {{Pkg|virtualbox}} package, found in the [[official repositories]].<br />
<br />
The {{pkg|virtualbox-host-modules}} package, which contains the precompiled modules for the stock archlinux kernel, should be installed with it. If you are using the {{pkg|linux-lts}} kernel you should also install the {{pkg|virtualbox-host-modules-lts}} package. For custom kernels, read [[#Hosts running a custom kernel|the section below]].<br />
<br />
In order to use the graphical interface, based on [[Qt]] ({{ic|VirtualBox}} command), you will also need to install the {{Pkg|qt4}} package. This is not required for the simpler SDL-only GUI ({{ic|VBoxSDL}} command) nor for the {{ic|VBoxHeadless}} command.<br />
<br />
=== Hosts running a custom kernel ===<br />
<br />
VirtualBox works just fine with custom kernels such as [[Linux-ck]] ''without'' the need to keep any of the official ARCH kernel packages on the system. The trick to keeping pacman from bringing down the ARCH kernel packages is to install virtualbox with the {{Pkg|virtualbox-host-dkms}} package, which contains the source for the virtualbox kernel modules. See {{Bug|26721}} for further explanations.<br />
<br />
Once {{Pkg|virtualbox-host-dkms}} is installed, simply generate the kernel modules for your custom kernel by running:<br />
# dkms install vboxhost/<virtualbox-host-source version> -k <your custom kernel's version>/<your architecture><br />
<br />
Which for the lazy is the command:<br />
# dkms install vboxhost/$(pacman -Q virtualbox|awk {'print $2'}|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')<br />
<br />
and load it:<br />
# modprobe vboxdrv<br />
<br />
To load/compile virtualbox modules automatically at startup you can enable {{ic|dkms.service}}:<br />
# systemctl enable dkms.service<br />
<br />
==== Automatic re-compilation of the virtualbox host modules with every update of any kernel====<br />
<br />
This is possible thanks to {{AUR|vboxhost-hook}} from the [[AUR]]. In '''vboxhost-hook''', the 'automatic re-compilation' functionality is done by a '''vboxhost hook''' on [[mkinitcpio]] after forcing to update the {{Pkg|linux-headers}} package. You will need to add 'vboxhost' to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}, as well as 'linux-headers' and your custom kernel(s) headers to the SyncFirst array in {{ic|/etc/pacman.conf}} for this to work.<br />
<br />
{{Warning|The SyncFirst option is no longer available as of pacman 4.1. Use<br />
<br />
$ pacman -Sy linux-headers && pacman -Su<br />
<br />
instead to manually cause linux-headers to be updated first. See [https://mailman.archlinux.org/pipermail/arch-general/2013-April/033297.html This explanation].}}<br />
<br />
The hook will call the '''dkms''' command to update the virtualbox host modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. vboxhost hook will tell you if anything goes wrong.}}<br />
<br />
== Setup ==<br />
<br />
Add the desired username to the '''vboxusers''' [[group]]. Everything may work fine without this step but shared folders and possibly some other optional stuff require it to work. The new group does not automatically apply to existing sessions; the user has to log in again or start a new environment with a command like {{Ic|newgrp}} or {{Ic|sudo -u ''username'' -s}}.<br />
<br />
# gpasswd -a ''username'' vboxusers<br />
<br />
=== Loading Kernel Modules ===<br />
VirtualBox running on Linux uses its own [[kernel modules]], including a mandatory module named '''vboxdrv''', which must be loaded before 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 />
<br />
# modprobe vboxdrv<br />
<br />
To load the VirtualBox driver at startup, create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/[[Kernel_modules#Loading|modules-load.d]]}} that contains all modules that should be loaded:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxdrv}}<br />
<br />
{{Note|You may need to update the kernel modules db in order to avoid 'no such file or directory' error when loading vboxdrv. Run: {{ic|depmod -a}}.}}<br />
<br />
To start the VirtualBox graphical manager:<br />
<br />
$ VirtualBox<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 as the {{pkg|net-tools}} package.<br />
<br />
=== Guest additions disc ===<br />
<br />
The {{Pkg|virtualbox}} package also suggests installing {{Pkg|virtualbox-guest-iso}} on the host (Arch Linux) running VirtualBox. It is a disc image that can be used to install the guest additions onto guest systems. Make it available to the (running) guest by going to Devices and clicking "Install Guest Additions... Host+D". Then run the guest additions installation from inside the guest.<br />
<br />
=== Booting a live disc ===<br />
<br />
Click the 'New' button to create a new virtual environment. Name it appropriately and select Operating System type and version. Select base memory size (note: most operating systems will need at least 512&nbsp;MB to function properly). Create a new hard disk image (a hard disk image is a file that will contain the operating system's filesystem and files).<br />
<br />
When the new image has been created, click 'Settings', then CD/DVD-ROM, check 'Mount CD/DVD Drive' then select an ISO image.<br />
<br />
=== Starting virtual machines with a service ===<br />
<br />
See [[Systemd/Services#VirtualBox virtual machines]] for details on how to setup a systemd service for each virtual machine.<br />
<br />
=== Advanced setup ===<br />
<br />
See [[VirtualBox Extras]] for advanced configuration.<br />
<br />
== Arch Linux guests ==<br />
<br />
Installing Arch under VirtualBox is straightforward, and additions should be installed through pacman (not through "Install Guest Additions" in VirtualBox, or from a mounted ISO image).<br />
<br />
=== Install the Guest Additions ===<br />
<br />
Install the {{Pkg|virtualbox-guest-utils}} package. Manually load the modules with:<br />
<br />
# modprobe -a vboxguest vboxsf vboxvideo<br />
<br />
Create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with these lines:<br />
<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxguest<br />
vboxsf<br />
vboxvideo}}<br />
<br />
=== Automatic re-compilation of the VirtualBox guest modules with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|vboxguest-hook}} from the [[AUR]]. In '''vboxguest-hook''', the 'automatic re-compilation' functionality is done by a '''vboxguest hook''' on [[mkinitcpio]] after forcing to update the {{pkg|linux-headers}} package. You will need to add {{ic|vboxguest}} to the HOOKS array in {{ic|/etc/mkinitcpio.conf}}. You may need to manually recreate the initramfs after an upgrade of the {{pkg|linux-headers}} package.<br />
<br />
The hook will call the {{ic|dkms}} command to update the VirtualBox guest modules for the version of your new kernel.<br />
<br />
{{Note|If you are using this functionality, it is '''important''' to look at the installation process of the {{pkg|linux}} (or any other kernel) package. vboxguest hook will tell you if anything goes wrong.}}<br />
<br />
=== Start the sharing services ===<br />
After installing {{Pkg|virtualbox-guest-utils}} above, you should start {{ic|VBoxClient-all}} to start services for sharing the clipboard, resizing the screen, etc.<br />
* If you are running something that launches {{Ic|/etc/xdg/autostart/vboxclient.desktop}}, such as GNOME or KDE, then nothing needs to be done. <br />
* If you use {{Ic|.xinitrc}} to launch things instead, you must add the following to your {{Ic|.xinitrc}} before launching your WM.<br />
<br />
# VBoxClient-all &<br />
<br />
=== Using USB webcam / microphone ===<br />
<br />
{{Note|You will need to have VirtualBox extension pack installed before following the steps below. See [[VirtualBox_Extras#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 {{keypress|+}} 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 {{Keypress|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 {{keypress|F12}} right after starting virtual machine. It comes in handy when using rEFInd + EFISTUB, for example.}}<br />
<br />
== Shared Folders as Arch Linux Guest ==<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. Creating a shared folder from the VirtualBox program in the host locates that folder in {{Ic|/media/sf_''SHAREDFOLDERNAME''}}. At this time an additional step is needed to have that folder created in the Arch Guest because Arch use a package for Guest Additions. To create and access this shared folder from the Arch Guest, this must also be done at the command line after installing the Guest Additions package(s) from pacman:<br />
<br />
# groupadd vboxsf<br />
# gpasswd -a $USER vboxsf<br />
<br />
If you wish, a symbolic link may be made to another folder in your home directory for easy access. As an example, if a shared folder named "Dropbox" was created in the VirtualBox program on the host machine, then /media/sf_Dropbox is automatically created in the guest so this could be done:<br />
<br />
$ ln -s /media/sf_Dropbox/* ~/dropbox<br />
<br />
The .run script provided in the Guest Additions iso does this for you, however, Arch does not recommend using that script so this step must be done manually. The instructions for it were found here: (pastebin: [http://pastebin.com/6cUE3kjF]) .<br />
<br />
If shared folders are not auto-mounted, try [https://bbs.archlinux.org/viewtopic.php?id=70780 manually mount] or read the next section.<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 mountpoints 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 />
=== Synchronise guest date with host ===<br />
<br />
To keep sync date and time, make sure you have {{Pkg|virtualbox-guest-utils}} installed in your host (see [[#Install the Guest Additions|previous section]]). Then run<br />
# systemctl enable vboxservice.service<br />
<br />
To enable the service for next boot. To start immediately, run<br />
# systemctl start vboxservice.service<br />
<br />
You also need run this daemon in order to use auto-mounting feature of shared folders that are mentioned above.<br />
<br />
== Troubleshooting ==<br />
=== VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) ===<br />
This can occur if a VM is exited ungracefully. The solution to unlock the VM is trivial:<br />
VBoxManage controlvm nArch poweroff<br />
<br />
=== USB subsystem is not working on the host or guest ===<br />
<br />
Sometimes the USB subsystem is not auto-detected resulting in an error or in a not visible USB drive on the host, even when the user is in the '''vboxusers''' group. See this topic [https://bbs.archlinux.org/viewtopic.php?id=125785] for details.<br />
<br />
USB subsystem will work if you add<br />
<br />
VBOX_USB=usbfs<br />
<br />
to {{Ic|~/.bashrc}} and reboot your system or open a new bash instance.<br />
<br />
Also make sure that your user is a member of the '''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. It's possible to load these kernel modules manually with<br />
<br />
# modprobe -a vboxnetadp vboxnetflt<br />
<br />
To load them automatically at boot, add a new line for each module to {{ic|/etc/modules-load.d/virtualbox.conf}}:<br />
<br />
vboxdrv<br />
vboxnetadp<br />
vboxnetflt<br />
<br />
{{Note|These used to be added to the {{ic|MODULES}} array in {{ic|/etc/rc.conf}}. This is now deprecated.}}<br />
<br />
More information in [https://bbs.archlinux.org/viewtopic.php?id=130581 this] topic.<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}} add the following key to the Virtual Windows XP registry:<br />
<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. {{Keypress|Host+F}} to redraw/enter full screen).<br />
<br />
=== Mounting .vdi Images ===<br />
<br />
This just work with '''static''' size vdi images! '''Dynamic size won't''' be easy mountable! First we need one information from your .vdi image:<br />
<br />
$ VBoxManage internalcommands dumphdinfo Arch_64min.vdi |grep offData<br />
Header: offBlocks=4096 offData=69632<br />
<br />
Now, '''add to your''' {{ic|offData}} 32256. e.g. 32256 + 69632 = 101888<br />
<br />
Now you can mount your vdi image:<br />
<br />
# mount -t ext4 -o rw,noatime,noexec,loop,offset=101888 Arch_64min.vdi /mnt/<br />
<br />
=== Startup problems because of mount failures ===<br />
<br />
If you experience problems in a [[systemd]] setup after a kernel upgrade, you should start the system with {{ic|1=init=/bin/bash}} (if the emergency shell does not work for you).<br />
<br />
root=/dev/mapper/vg_main-lv_root ro vga=792 resume=/dev/mapper/vg_main-lv_swap init=/bin/bash<br />
<br />
Then mount the ''root''-filesystem with write access:<br />
<br />
# mount / -o remount,rw<br />
<br />
Change {{ic|/etc/fstab}} according to [[#Shared Folders as Arch Linux Guest]]. Then exec systemd within the Bash shell:<br />
<br />
# exec /bin/systemd<br />
<br />
=== Copy&Paste not working on Arch Linux Guest ===<br />
<br />
Since updating {{ic|virtualbox-guest-additions}} to version {{ic|4.2.0-2}} copy&paste from Host OS to Arch Linux Guest stopped working. It seems to be due to {{ic|VBoxClient-all}} requiring ''root'' access. In previous versions adding ''VBoxClient-all &'' to ''~/.xinitrc'' was sufficient to make copy&paste work. Update ''~/.xinitrc'' to match {{ic|sudo VBoxClient-all &}} and add the line {{ic|, NOPASSWD: /usr/bin/VBoxClient-all}} to your username in the sudoers file and restart X. It should all work again. The line in the sudoers file should look similar to this:<br />
<br />
# Allow sudo for user 'you' and let him run VBoxClient-all without requiring a password<br />
you ALL = PASSWD: ALL, NOPASSWD: /usr/bin/VBoxClient-all<br />
<br />
{{Note|Use {{ic|visudo}} to edit the sudoers file. This will check for syntax errors when saving.}}<br />
<br />
=== Use Serial port in guest OS ===<br />
Check you permission in 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 you user in '''uucp''' group.<br />
# gpasswd -a YOURUSER uucp <br />
and relogon.<br />
<br />
=== Abort on resume ===<br />
There is a known bug that causes abort on resume: https://www.virtualbox.org/ticket/11289. The workaround is simple: always use Host+q or the menu to close the VM.<br />
<br />
== External links ==<br />
<br />
* [http://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]</div>Brando56894https://wiki.archlinux.org/index.php?title=Samba&diff=254430Samba2013-04-17T17:17:46Z<p>Brando56894: /* Add Share to /etc/fstab */</p>
<hr />
<div>[[Category:Networking]]<br />
[[cs:Samba]]<br />
[[de:Samba]]<br />
[[da:Samba]]<br />
[[es:Samba]]<br />
[[fr:Samba]]<br />
[[it:Samba]]<br />
[[ru:Samba]]<br />
[[sr:Samba]]<br />
[[tr:Samba]]<br />
[[zh-CN:Samba]]<br />
[[zh-TW:Samba]]<br />
[[ja:Samba]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user stick close to the following directions.<br />
<br />
==Required packages==<br />
===Server===<br />
To share files with Samba, install {{Pkg|samba}}, from the [[Official Repositories]].<br />
<br />
===Client===<br />
Only {{Pkg|smbclient}} is required to access files from a Samba/SMB/CIFS server. It is also available from the Official Repositories.<br />
<br />
==Server configuration==<br />
The {{ic|/etc/samba/smb.conf}} file must be created before starting the service. Once that is set up, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
As root, copy the default Samba configuration file to {{ic|/etc/samba/smb.conf}}:<br />
{{bc|# cp /etc/samba/smb.conf.default /etc/samba/smb.conf}}<br />
<br />
===Creating a share===<br />
Edit {{ic|/etc/samba/smb.conf}}, scroll down to the '''Share Definitions''' section. The default configuration automatically creates a share for each user's home directory. It also creates a share for printers by default.<br />
<br />
There are a number of commented sample configurations included. More information about available options for shared resources can be found in {{ic|man smb.conf}}. [http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html Here] is the on-line version.<br />
<br />
=== Creating user share path ===<br />
This marks the named objects for automatic export to the environment of subsequently executed commands:<br />
{{bc|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"<br />
# export USERSHARES_GROUP="sambashare"</nowiki>}}<br />
This creates the usershares directory in var/lib/samba:<br />
{{bc|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}<br />
This makes the group sambashare:<br />
{{bc|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}<br />
This changes the owner of the directory and group you just created to root:<br />
{{bc|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}<br />
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:<br />
{{bc|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}<br />
Set the following variable in {{ic|smb.conf}} configuration file: <br />
{{hc|/etc/samba/smb.conf|2=...<br />
[global]<br />
usershare path = /var/lib/samba/usershares<br />
usershare max shares = 100<br />
usershare allow guests = yes<br />
usershare owner only = False<br />
...<br />
}}<br />
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your user:<br />
{{bc|# usermod -a -G ${USERSHARES_GROUP} your_username}}<br />
<br />
Restart Samba<br />
<br />
Log out and log back in. You should now be able to configure your samba share using GUI. For example, in [[Thunar]] you can right click on any directory and share it on the network.<br />
When the error {{ic|You are not the owner of the folder}} appears, simply try to reboot the system.<br />
<br />
===Adding a user===<br />
To log into a Samba share, a samba user is needed. The user '''must''' already have a [[Users and Groups|Linux user account]] with the same name on the server, otherwise running the next command will fail:<br />
# pdbedit -a -u <user><br />
<br />
{{Note|As of version 3.4.0, smbpasswd is no longer used by default. Existing smbpasswd databases can be [[Samba/Troubleshooting#Changes_in_Samba_version_3.4.0|converted to the new format]]}}<br />
<br />
=== Web-based configuration (SWAT)===<br />
'''SWAT''' (Samba Web Administration Tool) is a facility that is part of the Samba suite. Whether or not to use this tool remains a matter of personal preference. It does allow for quick configuration and has context-sensitive help for each {{ic|smb.conf}} parameter. SWAT also provides an interface for monitoring of current state of connection(s), and allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, be warned that SWAT will completely replace {{ic|/etc/samba/smb.conf}} with a fully optimized file that has been stripped of all comments, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install {{Pkg|xinetd}}, available in the [[Official Repositories]].<br />
<br />
Edit {{ic|/etc/xinetd.d/swat}}. To enable SWAT, change the {{ic|1=disable = yes}} line to {{ic|1=disable = no}}.<br />
<br />
{{hc|/etc/xinetd.d/swat|<nowiki><br />
service swat<br />
{<br />
type = UNLISTED<br />
protocol = tcp<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}</nowiki>}}<br />
<br />
Alternatively, add an entry for swat to {{ic|/etc/services}} and omit the first 3 lines of the configuration.<br />
<br />
Then start the "xinetd" [[Daemons|daemon]].<br />
<br />
The web interface can be accessed on port 901 by default:<br />
{{ic|http://localhost:901/}}<br />
<br />
{{Note|An all-encompasing [[Webmin]] tool is also available, and the SWAT module can be loaded there.}}<br />
<br />
=== Starting the service ===<br />
Start/enable Samba via the '''smbd''' and '''nmbd''' [[daemon]]s.<br />
<br />
==Client configuration==<br />
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods. The graphical manner is limited since most lightweight Desktop Environments do not have a native way to facilitate accessing these shared resources.<br />
<br />
There are two parts to share access. First is the underlying file system mechanism, and second is the interface which allows the user to select to mount shared resources. Some environments have the first part built into them.<br />
<br />
===Manual mounting===<br />
Install {{pkg|smbclient}} from the [[Official Repositories]].<br />
<br />
To list public shares on a server:<br />
{{bc|$ smbclient -L <hostname> -U%}}<br />
<br />
Create a mount point for the share:<br />
{{bc|# mkdir /mnt/MOUNTPOINT}}<br />
<br />
Mount the share using the {{ic|mount.cifs}} type. Not all the options listed below are needed or desirable (ie. {{ic|password}}).<br />
{{bc|# <nowiki>mount -t cifs //SERVER/SHARENAME /mnt/MOUNTPOINT -o user=USERNAME,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP</nowiki>}}<br />
{{ic|'''SERVER'''}}<br />
:The Windows system name.<br />
{{ic|'''SHARENAME'''}}<br />
:The shared directory.<br />
{{ic|'''MOUNTPOINT'''}}<br />
:The local directory where the share will be mounted.<br />
{{ic|'''-o <nowiki>[options]</nowiki>'''}}<br />
:See {{ic|man mount.cifs}} for more information:<br />
{{Note|Abstain from using a trailing '''/'''. {{ic|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
====Add Share to /etc/fstab====<br />
The simplest way to add an fstab entry is something like this:<br />
{{hc|/etc/fstab|<nowiki><br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
However, storing passwords in a world readable file is not recommended! A safer method would be to use a credentials file. As an example, create a file and {{ic|chmod 600 <filename>}} so only the owning user can read and write to it. It should contain the following information:<br />
{{hc|/path/to/credentials/sambacreds|<nowiki><br />
username=USERNAME<br />
password=PASSWORD</nowiki>}}<br />
and the line in your fstab should look something like this:<br />
{{hc|/etc/fstab|<nowiki><br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,username=USER,credentials=/path/to/credentials/sambacreds,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
If using '''systemd''' (modern installations), one can utilize the '''comment=systemd.automount''' option, which speeds up service boot by a few seconds. Also, one can map current user and group to make life a bit easier, utilizing '''uid''' and '''gid''' options ('''warning:''' using the uid and gid options may cause input ouput errors in programs that try to fetch data from network drives):<br />
{{hc|/etc/fstab|<nowiki>//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,credentials=/path/to/smbcredentials,comment=systemd.automount,uid=USERNAME,gid=USERGROUP 0 0</nowiki>}}<br />
<br />
====User mounting====<br />
{{hc|/etc/fstab|<nowiki>//SERVER/SHARENAME /mnt/MOUNTPOINT cifs users,noauto,credentials=/path/to/smbcredentials,workgroup=WORKGROUP,ip=SERVERIP 0 0</nowiki>}}<br />
{{note|Note: The option is user'''s''' (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it as long as the mount point resides in a directory controllable by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[Samba#smbnetfs|smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
===Automatic Mounting===<br />
There are several ways to easily browse shared resources:<br />
====smbnetfs====<br />
Install {{pkg|smbnetfs}}, from the [[Official Repositories]].<br />
<br />
Add the following line to {{ic|/etc/fuse.conf}}:<br />
{{bc|user_allow_other}}<br />
and load the {{ic|fuse}} [[kernel module]]:<br />
{{bc|# modprobe fuse}}<br />
<br />
If a username and a password are required to access some of the shared folders, edit /etc/smbnetfs/.smb/smbnetfs.conf and uncomment the line starting with "auth":<br />
<br />
{{hc|/etc/smbnetfs/.smb/smbnetfs.conf|<br />
auth "hostname" "username" "password"<br />
}}<br />
<br />
Make sure to {{ic|chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf}}, and any include files for smbnetfs to work correctly.<br />
<br />
===== Daemon =====<br />
Start and enable the '''smbnetfs''' [[daemon]].<br />
<br />
====fusesmb====<br />
{{Note|1=Because {{ic|smbclient 3.2.X}} is malfunctioning with {{ic|fusesmb}}, revert to using older versions if necessary. See the [https://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
# Install {{AUR|fusesmb}}, available in the [[Arch User Repository]].<br />
# Create a mount point: {{ic|# mkdir /mnt/fusesmb}}<br />
# Load {{ic|fuse}} [[kernel module]].<br />
# Mount the shares: {{bc|# fusesmb -o allow_other /mnt/fusesmb}}<br />
<br />
====autofs====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
===File Manager Configuration===<br />
====Nautilus====<br />
In order to access samba shares through Nautilus, install the {{pkg|gvfs-smb}} package, available in the [[Official Repositories]].<br />
<br />
Press {{keypress|Ctrl+L}} and enter {{ic|smb://servername/share}} in the location bar to access your share.<br />
<br />
The mounted share is likely to be present at {{ic|/run/user/<your UID>/gvfs}} in the filesystem.<br />
<br />
====Thunar and pcmanfm====<br />
For access using Thunar or pcmanfm, install {{pkg|gvfs-smb}}, available in the Official Repositories. <br />
<br />
Go to {{ic|smb://servername/share}}, to access your share.<br />
<br />
====KDE====<br />
KDE, has the ability to browse Samba shares built in. Therefore do not need any additional packages. However, for a GUI in the KDE System Settings, install the {{pkg|kdenetwork-filesharing}} package from the [[Official Repositories]]<br />
<br />
====Other Graphical Environments====<br />
There are a number of useful programs, but they may need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
* {{pkg|pyneighborhood}} is available in the [[Official Repositories]].<br />
* LinNeighborhood, RUmba, xffm-samba plugin for Xffm are not available in the official repositories or the [[AUR]]. As they are not officially (or even unofficially supported), they may be obsolete and may not work at all.<br />
<br />
==See also==<br />
* [[{{FULLPAGENAME}}/Tips and tricks|Tips and tricks]] - A dedicated page for alternate configurations and suggestions.<br />
* [[{{FULLPAGENAME}}/Troubleshooting|Troubleshooting]] - A dedicated page for solving common (or not so common) issues.<br />
* [http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]<br />
* [http://www.samba.org/ Official Samba site]</div>Brando56894https://wiki.archlinux.org/index.php?title=Improving_performance&diff=97839Improving performance2010-02-22T06:43:00Z<p>Brando56894: /* Compressing /usr */</p>
<hr />
<div>[[Category: Other desktop user's resources (English)]]<br />
[[Category: HOWTOs (English)]]<br />
This article is a retrospective analysis and basic rundown about gaining performance in Arch Linux.<br />
<br />
==The basics==<br />
<br />
===Know your system===<br />
The best way to tune a system is to target the bottlenecks, that is the subsystems that limit the overall speed. They usually can be identified by knowing the specifications of the system, but there is some basic indications:<br />
* If the computer becomes slow when big applications, like openoffice and firefox, are running at the same time, then there is a good chance the amount of RAM is insuficient. To verify available RAM, use this command, and check for the line beginning with -/+buffers:<br />
$ free -m<br />
* If boot time is really slow, and if applications take a lot of time to load the first time they are launched, but run fine afterwards, then the hard drive is probably too slow. The speed of a hard drive can be mesured using the hdparm command:<br />
$ hdparm -t /dev/harddrive<br />
This is only the pure read speed of the hard drive, and is not a valid benchmark, but a value superior to 40mb/s can be considered decent on an average system.<br />
* If the CPU load is consistently high even when RAM is available, then lowering CPU usage should be a priority. CPU load can be monitored in many ways, like using the top command:<br />
$ top<br />
* If the only applications lagging are the ones using direct rendering, meaning they use the graphic card, like video players and games, then improving the graphic performance should help. To verify this, try running this command for 20 seconds:<br />
$ glxgears<br />
This also isn't a valid benchmark, but a value of 300fps or less can be considered very low on an average system. If that is the case, then maybe direct rendering simply isn't enabled. This is indicated by the glxinfo command:<br />
$ glxinfo | grep direct<br />
<br />
===The first thing to do===<br />
The simplest and most efficient way of improving overall performance is to run less and lighter applications. This can be achieved by:<br />
* Changing the desktop environment to a lighter one. Good choices are [[LXDE]], [[Xfce]], or a standalone window manager like [[Openbox]].<br />
* Using lightweight applications. See [[Lightweight Software]] and the Light and Fast Applications Awards threads in the forum: [http://bbs.archlinux.org/viewtopic.php?id=41168 2007], [http://bbs.archlinux.org/viewtopic.php?id=67951 2008] and [http://bbs.archlinux.org/viewtopic.php?id=78490 2009].<br />
* Removing unnecessary daemons in rc.conf.<br />
<br />
===Compromise===<br />
Almost all tuning brings drawbacks. Lighter applications usually come with less features and some tweaks may make a system unstable, or simply require time to implement and maintain. This page tries to highlight those drawbacks, but the final judgment rests on the user.<br />
<br />
===Benchmarking===<br />
The effects of optimization are often difficult to judge. They can however be mesured by [[benchmarking]] tools<br />
<br />
==Storage devices==<br />
===Choosing and tuning your file-system===<br />
Choosing the best file-system for a specific system is very important because each has its own strenghts. The [[Beginner's Guide#Filesystem Types|beginner's guide]] provides a short summary of the most popular ones. You can also find relevant articles [http://wiki.archlinux.org/index.php/Category:File_systems_%28English%29 here].<br />
====Summary====<br />
This is a very rough, probably controvertial summary of the main characteristics of each filesystem, considering an average desktop usage. Please take these lightly.<br />
*XFS: Excellent speed with average and large files. Low speed with small ones.<br />
*Reiserfs: Excellent speed, mainly small files.<br />
*Ext3: Average speed, stability, can be accessed from windows.<br />
*Ext4: Good speed, stability.<br />
*JFS: Good speed, low CPU usage.<br />
*Btrfs: Performance varies from release to release, but speed seems to be good. Still considered as unstable.<br />
<br />
====Mount options====<br />
Mount options offer an easy way to improve speed without reformatting. They can be set using the mount command:<br />
$ mount -o option1,option2 /dev/partition /mnt/partition<br />
To set them permanently, you can modify /etc/fstab to make the relevant line look like this:<br />
/dev/partition /mnt/partition partitiontype option1,option2 0 0<br />
A couple of mount options improving performance on almost all file-systems is {{Codeline|noatime,nodiratime}}. In rare cases, for example if you use mutt, it can cause minor problems. You can instead use the {{Codeline|relatime}} option.<br />
<br />
====Ext3====<br />
See [[Ext3 Filesystem Tips]].<br />
<br />
====JFS====<br />
See [[JFS Filesystem#Optimizations| JFS Filesystem]].<br />
<br />
====XFS====<br />
For optimal speed, create an XFS file-system with:<br />
$ mkfs.xfs -l internal,size=128m -d agcount=2 /dev/thetargetpartition<br />
An XFS specific mount option that may increase performance is {{Codeline|<nowiki>logbufs=8</nowiki>}}. As its speed when dealing with small files is poor, you should definitely consider using [[Maximizing Performance#Pacman-cage|pacman-cage]]. For defragmentation, see [[Defragmentation XFS]].<br />
<br />
====Reiserfs====<br />
The {{Codeline|<nowiki>data=writeback</nowiki>}} mount option improves speed, but may corrupt data during power loss. The {{Codeline|notail}} mount option inscreases the space used by the filesystem by about 5%, but also improves overall speed. You can also reduce disk load by putting the journal and data on separate drives. This is be done when creating the filesystem: <br />
$ mkreiserfs –j /dev/hda1 /dev/hdb1<br />
Replace /dev/hda1 with the partition reserved for the journal, and /dev/hdb1 with the partition for data.<br />
<br />
====BTRFS====<br />
Btrfs is a new filesystem offering online defragmentation, optimized mode for SSDs, writable snapshots, changing size of partition without dataloss and many other features. Btrfs is still in active development, and is avaliable in the kernel (marked experimental). See more info on the [http://btrfs.wiki.kernel.org/index.php/Main_Page Btrfs homepage].<br />
<br />
===Compressing /usr===<br />
A way to speed up reading from the hard drive is to compress the data, because there is less data to be read. It must however be decompressed, which means a greater CPU load. Some filesystems support transparent compression, most notably btrfs and reiserfs4, but their compression ratio is limited by the 4k block size. A good alternative is to compress /usr in a squashfs file, with a 64k block size, as instructed in this [http://forums.gentoo.org/viewtopic-t-646289.html Gentoo forums thread]. Squashfs is already in the kernel, and aufs2 is in the extra repository, so no kernel compilation is needed if using the stock kernel. What this tutorial does is basically to compress the /usr folder into a compressed squashfs file-system, then mounts it with aufs. A lot of space is saved, usually two thirds of the original size of /usr, and applications load faster. However, each time an application is installed or reinstalled, it is written uncompressed, so /usr must be re-compressed periodically. A [http://bbs.archlinux.org/viewtopic.php?pid=714052 bash script] has been created that will automate this process since the tutorial is meant for Gentoo and some options don't correlate to what they should be in Arch.<br />
<br />
===Tuning for an SSD===<br />
This [http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/ tutorial] has some very simple tricks to fully harness the power of an SSD and to reduce disk read/write cycles to prolong its life. See also [[Tuning Arch for Speed#Compcache|compcache]].<br />
<br />
==CPU==<br />
The only way to directly improve CPU speed is overclocking. As it is a complicated and risky task, it is not recommended for anyone except experts. The best way to overclock is through the BIOS. When purchasing your system, keep in mind that most Intel chip-sets are notorious for disabling the capacity to overclock.<br />
<br />
Another way to improve CPU performance is to use Con Kolivas' desktop-centric kernel patchset, which, among other things, replaces the Completely Fair Scheduler(CFS) with the Brain Fuck Scheduler(BFS). To install from the AUR using [[yaourt]]:<br />
<br />
$ yaourt -S kernel26-ck<br />
<br />
{{Warning| Currently (20 Dec 2009) you must comment out line 5 and uncomment line 6 of the pkgbuild for the install to work correctly.}}<br />
<br />
Or for just BFS:<br />
<br />
$ yaourt -S kernel26-bfs<br />
<br />
{{Note|BFS/CK are designed for desktop/laptop use and not servers. They provide low latency and work well for 16 CPUs or less. Also, Con Kolivas suggests setting HZ to 1000. For more information, see the [http://ck.kolivas.org/patches/bfs/bfs-faq.txt BFS FAQ] and [http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.32/2.6.32-ck1/patches/ ck patches].}}<br />
<br />
===Verynice===<br />
[http://thermal.cnde.iastate.edu/~sdh4/verynice/ Verynice] is a daemon, available on [http://aur.archlinux.org/packages.php?ID=6403 AUR], for dynamically adjusting the nice levels of executables. The nice level represent the priority of the executable when allocating CPU resources. Simply define executables for which responsiveness is important, like X or multimedia applications, as ''goodexe'' in {{filename|/etc/verynice.conf}}. Similarly, CPU-hungry executables running in the background, like make, can be defined as ''badexe''. This prioritisation greatly improves system responsiveness under heavy load.<br />
<br />
==Network==<br />
See relevant section in [[General Recommendations#Networking|General Recomendations]].<br />
<br />
==Graphics==<br />
<br />
===Xorg.conf configuration===<br />
Graphic performance heavily depends on the settings in {{Filename|/etc/X11/xorg.conf}}. There are tutorials for [[Nvidia]], [[ATI]] and [[Intel]] cards. Improper settings may stop Xorg from working, so caution is advised.<br />
<br />
===Driconf===<br />
Driconf is a small utility that allows you to change the direct rendering settings for open source drivers. Enabling HyperZ can drastically improve performance.<br />
<br />
===GPU Overclocking===<br />
Overclocking a graphics card is typically more expedient than with a CPU, since there are readily accessible software packages which allow for on-the-fly GPU clock adjustments. For ATI users, get [http://aur.archlinux.org/packages.php?ID=2128 rovclock], and Nvidia users should get nvclock in the extra repository. <br />
<br />
The changes can be made permanent by running the appropriate command after X boots, for example by adding it to {{Filename|~/.xinitrc}}. A safer approach would be to only apply the overclocked settings when needed.<br />
<br />
==RAM and swap==<br />
<br />
===Swappiness===<br />
The swappiness represent how much the kernel prefers swap to RAM. Setting it to a very low value, meaning the kernel will almost always use RAM, is known to improve responsiveness on many systems. To do that, simply add those line to {{Filename|/etc/sysctl.conf}}:<br />
vm.swappiness=1<br />
vm.vfs_cache_pressure=50<br />
<br />
===Compcache===<br />
[http://code.google.com/p/compcache/ Compcache] is a kernel module that creates a swap into the RAM and compresses it. That means that part of the RAM can hold much more information, but uses more CPU. Still, is it much quicker than a hard drive swap. If a system often falls back to swap, this could improve responsiveness. Compcache is available on [http://aur.archlinux.org/packages.php?ID=19248 AUR], should be added to the DAEMONS array, and needs to be recompiled after each kernel upgrade. It is also possible tell compcache to fall back on the hard drive swap when full. This is also a good way to reduce disk read/write cycles on SSDs.<br />
<br />
===Mounting /tmp to RAM===<br />
This will make your system a tiny bit faster, but will take up some of your RAM. It also reduces disk read/write cycles, and is therefore a good choice if using an SSD or if you have RAM to spare. Simply add this line to {{Filename|/etc/fstab}} and reboot:<br />
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0<br />
<br />
===Using the graphic card's RAM===<br />
In the unlikely case that you have very little RAM and a surplus of video RAM, you can use the latter as swap. See [[Swap on video ram]].<br />
<br />
==Boot time==<br />
You can find tutorials with good tips [[Tweaking for a faster boot time|here]] and [[Speedup boot|here]].<br />
<br />
===Suspend to ram===<br />
The best way to reduce boot time is not booting at all. Consider [[Suspend to RAM|suspending your system to ram]] instead.<br />
<br />
===Kernel boot options===<br />
Some boot options can decrease kernel boot time. The fastboot option usually can take off one second or so. If you see a message saying "Waiting 8s for device XXX" at boot, adding {{Codeline|<nowiki>rootdelay=1</nowiki>}} can reduce the waiting time, but be careful, as it may break the booting process. Those options are set in {{Filename|/boot/grub/menu.lst}} or {{Filename|/etc/lilo.conf}}, depending on which bootloader you use.<br />
<br />
===Custom kernel===<br />
Compiling a custom kernel will reduce boot time and memory usage, but can be long, complicated and even painful. It usually is not worth the effort, but can be very interesting and a great learning experience. If you really know what you are doing, start [[Kernel Compilation|here]].<br />
<br />
==Application-specific tips==<br />
===Firefox===<br />
The [[Firefox]] article offers good tips; most notably [[Firefox#Speed up rendering by disabling pango |disabling pango]], [[Firefox#Speed-Up Firefox by Defragmenting the Profile's SQLite Databases|cleaning the sqlite database]], and using [[Firefox#Firefox customized for Speed|firefox-pgo]]. See also: [[Speed-up Firefox using tmpfs]], and [[Firefox Tips and Tweaks#Turning off anti-phishing to speedup Firefox|Turning off anti-phishing]].<br />
Many other tips can be found on this [http://www.ubuntu-inside.me/2009/07/howto-optimize-firefox-and-benchmarking.html blog].<br />
<br />
===Gcc/Makepkg===<br />
See [[Ccache]].<br />
<br />
===Mkinitcpio===<br />
User josh_ from the forum as made impressive changes to the mkinitcpio script, making it two or three times faster. While waiting for these changes to be implemented, you can get them [http://bbs.archlinux.org/viewtopic.php?id=79898 here].<br />
<br />
===OpenOffice===<br />
See [[OpenOffice#Speed up OpenOffice|Speed up OpenOffice]].<br />
<br />
===Pacman===<br />
See [[Improve Pacman Performance]].<br />
<br />
===SSH===<br />
See [[SSH#Speed up SSH|Speed up SSH]].</div>Brando56894