nyuuzyou/wikis huggingface dataset:
Running Alpine Linux As a QEMU networked Guest

To get networking running correctly, you can use the tun/tap interface, which then becomes a real interface. The key is to define the virtual network interface on the correct virtual vlan, and the correct ifup script.
You need 2 net commands on the command line interface, one for the host:
 -net tap,vlan=[somenumber],ifname=[host if],script=[some script]
one for the guest
 
 -net nic,vlan=[samenumber]
So to have a single NIC on the qemu virtual system that is connected to tap0 on the physical host:
 qemu -net tap,vlan=0,ifname=tap0,script=./qemu-ifup -net nic,vlan0 \
 -boot d -cdrom alpine*.iso}}
To create a qemu guest with more than one nic, just repeat the -net commands
 qemu -net tap,vlan=0,ifname=tap0,script=./qemu-ifup -net nic,vlan0 \
 -net tap,vlan=0,ifname=tap1,script=./qemu-ifup -net nic,vlan0 \
 -net tap,vlan=0,ifname=tap2,script=./qemu-ifup -net nic,vlan0 \
 -boot d -cdrom alpine*.iso}}
Now your alpine guest will have 3 NICs, mapped to tap0, tap1, and tap2 respectively.
What's actually happening is you are effectively creating a point-to-point tunnel, with the phys tap0 device being one endpoint, and the virtual box's eth0 being on the other point of the tunnel.
So you need to assign ip addresses to BOTH sides of the tunnel. The qemu-ifup script is what does that for the host. Here's an example:
#!/bin/sh
case $1 in
 tun0 | tap0 )
 sudo /sbin/ip addr add 192.168.1.100/24 dev $1
 sudo /sbin/ip link set $1 up
 ;;
 tap1 | tun1 )
 sudo /sbin/ip addr add 192.168.2.100/24 dev $1
 sudo /sbin/ip link set $1 up
 ;;
 tap2 | tun2 )
 sudo /sbin/ip addr add 192.168.3.100/24 dev $1
 sudo /sbin/ip link set $1 up
 ;;
 esac
In your alpinebox, create an interfaces file like this:
iface eth0 inet static
 address 192.168.1.1
 netmask 255.255.255.0
 gateway 192.168.1.100
iface eth1 inet static
 address 192.168.2.1
 netmask 255.255.255.0
iface eth0 inet static
 address 192.168.3.1
 netmask 255.255.255.0
If on your host you now add a MASQUERADE rule for tap0 to your host's default nic, and you turn on ip_forward on your host, you can now do svn updates, surf, run tranmission, etc right from your qemu guest.
Category:Virtualization
Running Alpine in Live mode in QEMU

To just give Alpine Linux a try in diskless mode, qemu can be used to boot the .iso file without any need for a virtual HDD image or further configuration.
=== Letting the .iso image load an apkovl ===
This works by mounting a persistent filesystem under /media and selecting it to store the apkovl and the apkcache.
Preparing a KVM with a virtual drive:
And inside the KVM (running Alpine Linux):
fdisk /dev/vda #creating a partition
mkdosfs /dev/vda1
mkdir -p /media/vda1
echo "/dev/vda1 /media/vda1 vfat rw 0 0" >> /etc/fstab
mount -a
setup-alpine # (select vda1 for saving configs)
lbu commit
The next reboot then loads the generated apkovl and apkcache found on /dev/vda1 -- completely running-from-ram based on the latest official ISO.
Category:Virtualization
Running Alpine in a Docker Container

Some things you might want to know if you're running Alpine in a Docker container.
== using mkinitfs ==
By default mkinitfs will use the running kernel to build the initfs. Since your Docker container is under some other kernel you need to specify this manually.
Alpine 3.11 and later:1
apk add linux-lts
Alpine 3.10 and earlier:
apk add linux-vanilla
cat /usr/share/kernel/vanilla/kernel.release
mkinitfs 4.19.41-0-vanilla
mkinitfs `cat /usr/share/kernel/vanilla/kernel.release`
== See also ==
* Docker
Category:Virtualization
== References ==
# Natanael Copa, "vanilla: remove linux-vanilla. replaced by linux-lts," Alpine Linux aports repository, commit eba4f554, 12 Dec 2019, (https://git.alpinelinux.org/aports/commit/?h=3.11-stable&id=eba4f554cc53325bb37f0cca97a5dfd024582271 accessed 19 May 2022).
S390x

= Installation guide =
Visit: S390x/Installation
= Docker with Alpine =
Running Alpine s390x containers on Docker: S390x/Docker
= Known Issues =
S390x/Known_Issues
= Tips =
On a default Alpine installation, some firmware packages () will get installed. On s390x, most of these are not needed.
In order to remove them, install the package by running:
= See Also =
* LVFS - Linux Vendor Firmware Service
category:s390x
S390x/Docker

== Running Alpine containers on Docker on Alpine s390x ==
After installing Alpine on s390x, Docker needs to be installed first by adding the community respository:
:For stable release, run:
:# echo http://dl-cdn.alpinelinux.org/alpine/latest-stable/community >> /etc/apk/repositories
:For rolling release, run:
:# echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
Install Docker:
Start Docker service:
Enable the Docker service to auto start on next boot:
Run Alpine s390x container:
== Running Alpine containers on Docker on other s390x distros ==
Run:
category:S390x
S390x/Known Issues

When running the 3.9 netboot installer, you might face this problem mostly z/VM hypervisor (common among architectures without a RTC clock like armhf, aarch64, s390x) :
Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] busybox
 \* service ntpd added to runlevel default
 \* Starting busybox ntpd ... [ ok ]
ssl_client: mirrors.alpinelinux.org: ocsp verify failed: ocsp response not current
wget: error getting response: Connection reset by peer
r) Add random from the above list
f) Detect and add fastest mirror from above list
e) Edit /etc/apk/repositories with text editor
Enter mirror number (1-0) or URL to add (or r/f/e/done) [f]: 
This is because the clocksource on s390x was not detected. There is a pull request to make this work (should be available in the 3.9.1 release):
https://github.com/alpinelinux/aports/pull/6183
https://github.com/alpinelinux/aports/pull/6184
In the meantime, to overcome this problem, you need to update the system time, either manullay using date command or using NTP then start the installer as shown below:
# setup-interfaces
# setup-dns
# service networking start
# ntpd -qn -p pool.ntp.org
# setup-alpine
category:S390x
SDDM

SDDM, or Simple Desktop Display Manager, is a display manager for Xorg and Wayland aiming to be fast, simple and beautiful. It is the recommended display manager for the KDE Plasma and LXQt desktop environments.
This page outlines the basic installation of SDDM, as well as some configuration options.
== Installation ==
Begin by installing the package:
Test the service to see if it launches and works, then enable the service to launch at boot:
(if it works)
== Configuration ==
Under KDE, the appearance configuration tool can take care of some settings.
Manual configuration is possible too.
=== Themes ===
Themes for SDDM are located in .
Users can set the theme in 
Many themes can be found on GitHub under the the sddm-theme topic.
Copy a new theme folder to and activate it by changing Current= to the name of the folder.
==== Example ====
Given a folder containing a theme, my-new-theme.
Test your theme:
If it looks as desire, copy it to the system themes folder:
Edit the configuration file in :
=== Face icon / Avatar ===
The default (fallback) theme, as well as other themes, can show an avatar on the login screen.
This avatar can be set by renaming the desired image to 
== See also ==
* SDDM Wiki
* sddm.conf options
* SDDM - Archwiki
Category:Desktop
Category:Display Managers
Category:Wayland
SLiM

SLiM is a Simple Login Manager (also known as a display manager) which is lightweight and simple to configure.
== Installation ==
Simply add the package with: 
Install any desktop of your choice.
== Configure & Test ==
The SLiM configuration file is at and it is heavily commented, so I'll not add any info about it here unless asked to (in the discussion function for instance). Before making any changes it is recommended to backup the default configuration file with:
Then you can modify and easily copy the default configuration back if you run into trouble:
To immediately test slim, do and you should be presented with a login screen, branded for Alpine linux!
Login with your normal user credentials (avoid using a desktop as root) and you should reach your desktop.
Once you've tested it works, start SLiM at the default runlevel:
== Extra Login Commands ==
When on the SLiM login screen, you can use:
* exit as a username to return to a shell prompt
* reboot as a username and the root password to reboot the machine
* halt as a username and the root password to power down the machine
== Themes ==
Simply add the package with:
All theme which are available on your system are located at /usr/share/slim/themes
You need to modify /etc/slim.conf to change the theme:
Search for current_theme and choose one of the available themes.
== Troubleshooting ==
If you are using a .xinitrc file (usually located at ~/.xinitrc, slim will read from this and you will need to ensure you have a line to execute your desktop environment. This is usually the last line of the file. For example:
....
exec startxfce4
if you are using an Xfce, or:
....
exec gnome-session
if using GNOME.
If you don't do this, or you make a mistake with your typing, you'll probably get an error like failed to execute login command
== See also ==
* SLiM Homepage
* SLiM Manual
* Arch Linux wiki entry
Category:Desktop
Category:Display Managers
SQLol

SQLol is a SQL injection playground which allows you to exploit and detect SQL injection flaws.
== Install lighttpd, PHP, and MySql ==
Install extra packages:
== Installing and configuring SQLol ==
Create a folder named 
Switch to the folder and download the source files
Rename the folder
Change the folder permissions
Create a symlink to the folder
== Configuration and start MySQL ==
== SQLol configuration ==
Please add the MySQL configuration details to the SQLol config file
Browse to http://WEBSERVER_IP_ADDRESS/sqlol .
Category:SQL Category:Security
Samba Roaming Profiles

Setting up Samba AD Server with Roaming Profiles is not very hard. But some changes are different than other tutorials. 
# Setup Samba using this page: Setting up a samba-ad-dc
# Create a directory to store the roaming profiles: mkdir -p /srv/samba/Profiles/
# This is where my (jhjacobs81) journey differs from the average tutorial online. I had to use the following command: chown root:users /srv/samba/Profiles/
This was the only way so far i could get it to work. other tutorials speak of setfacl and so, but this doesn't exist in Alpine. I will edit this page as i learn more.
edit: it apears to exist in the acl package.
Sandbox:How to write a HOWTO

This material is proposed for deletion ... dl.cgi no longer on alpinelinux.org; *.xdelta files no longer present either AFAIK
(note: this is a sandbox page and this is just a preview of what an RfD would look like)
(Discuss)Make sure no other pages link here and check the page's history before deleting.
For those having a slow connection, it is possible to download a smaller differential file that contains only the new Alpine version changes. You can then use the downloaded xdelta file to update your previous Alpine release iso file to the new one. You will still need to download the new iso checksum file and test the integrity of the newly built iso file. For xdelta to work you should have the three files on the same directory level, i.e.: alpine-1.10.3-1.10.4.xdelta, alpine-1.10.3-x86.iso and the alpine-1.10.4-x86.iso.sha1 
 
 wget –c http://www.alpinelinux.org/cgi-bin/dl.cgi/v1.10/releases/alpine-1.10.3-1.10.4.xdelta
 wget http://dev.alpinelinux.org/alpine/v1.9/iso/alpine-1.10.4-x86.iso.sha1
Make sure you have xdelta3 installed and build the new iso
 apk add xdelta3
 xdelta3 -d alpine-1.10.3-1.10.4.xdelta
If checking the integrity of the file shows: alpine-1.10.4-x86.iso: OK then you are ready to continue.
Saving time with Hardware Clock

= Install Hardware =
I used a PiFace Real Time Clock. After installing the CR1220 battery and correctly mounting on the board, see manual for that.
= Install Software =
Add the modules from the kernel
== /etc/modules ==
Add these modules so they're loaded on boot. You can modprobe each one individually if you don't want to reboot.
== /media/mmcblk0p1/config.txt ==
You will need to mount this as read-write
Add these two parameters to the bottom
Then you will need to reboot.
== Binding the hardware clock device ==
You will want to make sure the device is created when hwclock starts, if it isn't already created. To the bottom of add this:
For the time being this is necessary but in the future when issue 1032 you should be able to just add
to 
== Starting hwclock on boot ==
The hwclock service needs to be started for the hardware clock device to actually do anything. Check if hwclock has been started by running this command:
If it outputs
 hwclock [ started ]
hwclock has already started. Otherwise start it manually and add it to the default init.d runlevel, so that it starts at boot time:
If you are running Alpine Linux in the diskless mode (non-persistent root filesystem), save the configuration by:
Category:Hardware
Category:System Administration
Category:Raspberry
Saving time with Software Clock

OpenRC has it's own method for saving the clock called "swclock", that's what I went with. Normally swclock simply changes a symlink ie /sbin/openrc-run -> /sbin/openrc when it saves the time.
However this when restored will have the time that the package was put together, because Alpine Linux unpacks packages on boot, then moves the provisioned configs from apkprov. You will need to make these changes to specify a file.
== /etc/init.d/swclock ==
--- swclock.old
+++ swclock
@@ -3,6 +3,7 @@
 # Released under the 2-clause BSD license.
 
 description="Sets the local clock to the mtime of a given file."
+clock_file=${clock_file:-/etc/rc.conf}
 
 depend()
 {
@@ -17,7 +18,7 @@
 {
 	ebegin "Setting the local clock based on last shutdown time"
 	if ! swclock 2> /dev/null; then
-	swclock --warn /sbin/openrc-run
+	swclock --warn $clock_file
 	fi
 	eend $?
 }
@@ -25,6 +26,6 @@
 stop()
 {
 	ebegin "Saving the shutdown time"
-	swclock --save
+	swclock --save $clock_file
 	eend $?
 }
== /etc/conf.d/swclock ==
clock_file="/etc/swclock_saved_time"
Then touch the file:
and finally add swclock to the boot run level
You will also need to include the new init script in your apkprov, otherwise it will be overwritten with the one from the OpenRC package.
Category:System Administration
Seafile: setting up your own private cloud

===Seafile===
Seafile is like ownCloud, but with client side encryption. There are clients for Linux, Windows, OSX, Android, IOS and web. Seahub is the web interface but for some other functions (like setup, management, etc.) seafile needs seahub.
===Installation===
Currently seafile, seahub and some of their dependencies are still in testing, so you will need to add testing to your repo.
install everything (highly recommended)
install only seafile-server (not recommended, unless you know what you are doing)
===Setup===
Using the default instance
check the options in
 /etc/conf.d/seahub
Using non default instance
 export SEA_USER=clouduser
 export SEA_INSTANCE=mycloud
 sudo -u $SEA_USER mkdir /var/lib/seafile/"$SEA_INSTANCE"
 sudo -u $SEA_USER mkdir /var/lib/seafile/"$SEA_INSTANCE"/seafile-server
 sudo cp -aR /usr/share/seafile/scripts /var/lib/seafile/"$SEA_INSTANCE"
 sudo cp -u $SEA_USER -aR /usr/share/seahub /var/lib/seafile/"$SEA_INSTANCE"/seafile-server
 cd /var/lib/seafile/"$SEA_INSTANCE"
 sudo -u $SEA_USER seafile-admin setup
 sudo -u $SEA_USER seafile-admin create-admin
make init.d script and conf.d
 cd /etc/init.d/
 sudo ln -s seafile seafile."$SEA_INSTANCE"
 sudo ln -s seahub seahub."$SEA_INSTANCE"
 cd /etc/conf.d/
 sudo cp seafile seafile."$SEA_INSTANCE"
 sudo cp seahub seahub."$SEA_INSTANCE"
change user and group and check options in
 /etc/conf.d/seafile
 /etc/conf.d/seahub
===Starting===
with seahub
seafile server only
or append ."$SEA_INSTANCE" if you are using a non default instance.
Category:Server
Seat manager

A seat manager mediates access to input and output devices such as keyboards and monitors. Wayland requires a seat manager. Alpine Linux provides two different seat managers:
* seatd: a minimal seat management daemon.
* elogind: login manager extracted from systemd.
== Input and video groups ==
Some instructions mention the need for the input and video groups. This is in most cases incorrect and insecure! The seat manager already provides the necessary permissions. 
Due to issue there is currently 1 exception: If you aren't using elogind and need PipeWire to access a webcam you need the video group.
== See Also ==
* seatd: what is a seat
* void docs: Session and Seat Management
* Seat Management
Category:Desktop
Seatd

Seatd is a seat management daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. Seat management takes care of mediating access to shared devices (graphics, input), without requiring the applications needing access to be root.
When using elogind, seatd is not required and viceversa. Don't add both to auto-start.
== Installation ==
If you are already logged in as a $USER, you will need to relogin.
== Configuration ==
Seatd is the light weight solution for sway and other Wayland compositors compared to elogind. When using seatd, few mandatory steps are to be performed.
=== Configure XDG_RUNTIME_DIR ===
Set the variable XDG_RUNTIME_DIR. This step is required for all Wayland compositors. 
=== Environment variables ===
Additional environment variables needs to be set for all Wayland compositors to work properly with seatd:
* XDG_SESSION_TYPE=wayland
* LIBSEAT_BACKEND=seatd
* XDG_CURRENT_DESKTOP=sway
The variable XDG_CURRENT_DESKTOP must be suitably adjusted for other Compositors.
=== Seatd and Sway ===
When using seatd, sway must be started with above Environment variables and D-Bus as shown below:
Ensure that your shell reads and executes the if condition in . Sway can also be launched with a wrapper script with seatd. If using elogind, then none of the above code snippets are required. 
== See Also ==
* seatd documentation
* sway wiki
Category:Desktop
Category:Seat_manager
Category:Wayland
Sending SMS using gnokii

__NOTOC__
In this tutorial we are using to send SMS
== Prerequisites ==
This doc is documented and tested based on Alpine Linux 2.7, but it might work for earlier versions too.<BR>
You will also need some sort of modem that can send SMS (e.g. a USB dongle with a SIM-card).
== Install ==
* Install required package(s)
 
* Create missing folders
 
* Physically attach a SMS capable modem to the host
== Configure ==
* Add the following content to '/etc/gnokiirc'
 
[global]
port = /dev/ttyUSB0
model = AT
connection = serial
use_locking = yes
serial_baudrate = 115200
smsc_timeout = 30
[gnokiid]
binddir = /usr/bin/
[logging]
debug = off
rlpdebug = off
xdebug = off
 
* Verify if the configuration works as expected
 
 
== Sending SMS ==
* Now send a SMS
 
 
Category:Software
Setting Up Apache with PHP

== Installing Apache + PHP ==
Enable the repositories:
<nowiki>
cat > /etc/apk/repositories << EOF
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
EOF
apk update
</nowiki>
Add the main packages with the command:
If you get an exception like unsatisfible dependency use the above command like this:
then
or just change in the original command.
The php"$phpverx"-apache2 will be "5" or "7" depending of the alpine version installed, since alpine 3.9 there's only the php7 packages.
== Testing ==
Move to the directory where your site will reside:
And create an index.php file to test if everything is ok:
Add the following lines in the file:
<?php
phpinfo();
?>
That done, let us start apache2 web server:
Now access: http://<ip_address> and if everything is ok you will see the PHP info page.
== Ending ==
Finally let us set up apache2 to start on operating system startup:
Now you can create your PHP site and host in this directory.
== Note ==
This is the easiest way to setup Apache with PHP support, but it's the most inefficient (resource wise) setup, please refer to Apache with php-fpm
Category:Web Server
Category:PHP
Setting Up Fprobe And Ntop

Goal: Setup fprobe as a NetFlow probe on an Alpine Linux router, and then ntop as a collector/analyzer on another machine. 
Assumptions: Eth0 on router will be monitored, 192.168.0.1 is router interface on LAN side, 192.168.0.100 is ntop host, and port 2055 will be used for fprobe.
== Router setup ==
Install packages:
Edit /etc/conf.d/fprobe (adjust lines shown below as needed - leave rest of config file as is):
 IFACE=eth0
 FLOW_VER=7
 LOCALIP=192.168.0.1
 REMOTEIP=192.168.0.100
 PORT=2055
Start fprobe.
== Ntop host setup ==
Add package:
Edit /etc/conf.d/ntop (adjust path to ntop cache as needed):
 NTOP_OPTS="-P /var/cache/ntop --http-server 3000 --https-server 0 --interface eth0"
Make needed directory:
 mkdir /var/cache/ntop
Generate ntop password:
Start ntop:
Open ntop web interface by browsing to http://192.168.0.100:3000.
Enable NetFlow plugin from the Plugins menu. 
Create NetFlow device with proper options:
 Local Collector UDP Port: 2055
 Virtual NetFlow Interface Network Address: 192.168.0.100/255.255.255.0
 Flow Aggregation (set as desired, bu TCP/UDP Port is a good choice)
 Enable Session Handling: Yes
 Debug: Off
Check after a minute or two that flows are being processed by going to the Summary -> Traffic menu option and making sure data is present for the collector port and rrd graphs are being generated.
In case have trouble creating password, you can delete previous databases and recreate again:
If receive error regarding font not found you can add ttf fonts:
== Notes ==
* To monitor 2 interfaces (gre1 given as example), copy /etc/init.d/fprobe to /etc/init.d/fprobe.gre1, edit BIN= line to point to /usr/sbin/fprobe.gre. Copy /etc/conf.d/fprobe to /etc/conf.d/fprobe.gre and change interface line to IP on gre interface and port line to 2056. Finally, softlink /usr/sbin/fprobe.gre to /usr/sbin/fprobe.
* If there isn't data present, make sure firewall on both router and ntop host have port 2055 (and possibly 2056) open from the router to the ntop host.
* If you have a high-volume router that you are monitoring, you may end up hitting a folder limit for your rrd interfaces directory(max of 32 000) depending on how you have flows being processed/parsed. It may be necessary to schedule a cron job to clear out the cache periodically and restart ntop after deleting the older folders.
Category:Networking
Category:Monitoring
Setting the timezone

Timezone can easily be configured with the setup-timezone script.
The approach below is only convenient for systems that need frequent timezone changes, potentially while offline.
= Manual configuration=
Timezone data files are provided by te package. The current timezone is defined in the file. To change the timezone, make this file a link to another timezone data file. For example:
 apk add 
 ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
Category:System Administration
Setting up LVM on GPT-labeled disks

Category:Storage
This document describes how to set up a system booting from a logical volume in Alpine using lvm2 and GPT-labeled disks.
Begin by booting from Alpine installation media in the usual way. Log in as `root`, run `setup-alpine`, and answer `none` when asked to choose a disk.
=== Partitioning ===
We need to install some tools:
Now we can create the partition table:
 unit MiB
 mkpart 1 1 256
 name 1 boot
 set 1 legacy_boot on
 mkpart 2 256 100%
 set 2 lvm on
Now, exit `parted` and reboot to force a reread of the partition table (for some reason, `partprobe` doesn't work here). (Or, instead of rebooting, maybe try running `mdev -s`.)
=== LVM Creation ===
Once you've rebooted, run through `setup-alpine` again.
Install some more necessary tools:
Create a PV, VG, and a LV for the root partition:
Create file systems:
Mount the file systems:
Now you can run `setup-disk` to install Alpine:
Finally, install `syslinux` (note that we are installing to `/dev/sda`, *not* `/dev/sda1`):
Reboot and enjoy your new Alpine installation!