<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gray+wolf</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gray+wolf"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Gray_wolf"/>
	<updated>2026-05-03T01:36:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26107</id>
		<title>Cgit</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26107"/>
		<updated>2024-01-02T17:40:42Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://git.zx2c4.com/cgit/ cgit] is a fast web-interface (CGI) for git written in the C programming language. It makes it possible for potential contributors to track and view project source code from the web instead of through a git client.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
{{Note|It is very recommendable that you already have a directory with an active .git working in your server. If you don&#039;t have one, install [[gitolite]] or a similar program before going further.}}&lt;br /&gt;
Install the package that contains cgit and git.&lt;br /&gt;
{{Cmd|apk add cgit git}}&lt;br /&gt;
&lt;br /&gt;
Open up /etc/cgitrc with your favorite editor, in this case is vim.&lt;br /&gt;
{{Cmd|vim /etc/cgitrc}}&lt;br /&gt;
&lt;br /&gt;
If you want to show an specific repository your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
repo.path=/var/lib/git/repositories/YOUR_GIT_REPO.git/&lt;br /&gt;
repo.url=CUSTOM_GIT_URL&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you want to scan and show all the repositories you have, your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
scan-path=/var/lib/git/repositories/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Run cgit using spawn-fcgi and fcgiwrap ===&lt;br /&gt;
Create a new service by doing a symbolic link.&lt;br /&gt;
{{Cmd|ln -s spawn-fcgi /etc/init.d/spawn-fcgi.cgit}}&lt;br /&gt;
{{Note|You should also modify the file and add -f after ${FCGI_PROGRAM} on line 99.  Otherwise you will have no log and problems will be impossible to debug.}}&lt;br /&gt;
Create a configuration file called spawn-fcgi.cgit in /etc/conf.d/ ; the service will run fcgiwrap automatically everytime is called. It should look exactly like this:&lt;br /&gt;
{{Cat|/etc/conf.d/spawn-fcgi.cgit|&amp;lt;nowiki&amp;gt;FCGI_PORT=1234&lt;br /&gt;
FCGI_PROGRAM=/usr/bin/fcgiwrap&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|You should consider using unix domain sockets instead.}}&lt;br /&gt;
Start the newly created service.&lt;br /&gt;
{{Cmd|rc-service spawn-fcgi.cgit start}}&lt;br /&gt;
&lt;br /&gt;
== Run cgit with a web service ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Lighttpd to work with cgit ===&lt;br /&gt;
Install the package that contains lighttpd if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add lighttpd}}&lt;br /&gt;
&lt;br /&gt;
Create a cgit.conf file into the lighttpd directory with the following content:&lt;br /&gt;
{{Cat|/etc/lighttpd/cgit.conf|&amp;lt;nowiki&amp;gt;server.modules += (&amp;quot;mod_redirect&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_alias&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_cgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_fastcgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_rewrite&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
var.webapps  = &amp;quot;/usr/share/webapps/&amp;quot;&lt;br /&gt;
$HTTP[&amp;quot;url&amp;quot;] =~ &amp;quot;^/cgit&amp;quot; {&lt;br /&gt;
    server.document-root = webapps&lt;br /&gt;
    server.indexfiles = (&amp;quot;cgit.cgi&amp;quot;)&lt;br /&gt;
    cgi.assign = (&amp;quot;cgit.cgi&amp;quot; =&amp;gt; &amp;quot;&amp;quot;)&lt;br /&gt;
    mimetype.assign = ( &amp;quot;.css&amp;quot; =&amp;gt; &amp;quot;text/css&amp;quot; )&lt;br /&gt;
}&lt;br /&gt;
url.redirect = (&lt;br /&gt;
    &amp;quot;^/git/(.*)$&amp;quot; =&amp;gt; &amp;quot;/cgit/cgit.cgi/$1&amp;quot;,&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Finally, add the following line to the lighttpd.conf file:&lt;br /&gt;
{{Cat|/etc/lighttpd/lighttpd.conf|&amp;lt;nowiki&amp;gt;include &amp;quot;cgit.conf&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Restart the lighttpd service.&lt;br /&gt;
{{Cmd|rc-service lighttpd restart}}&lt;br /&gt;
&lt;br /&gt;
=== Configure NGINX to work with cgit pointing to a subdomain ===&lt;br /&gt;
&lt;br /&gt;
Install the package that contains NGINX if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add nginx}}&lt;br /&gt;
&lt;br /&gt;
Create a custom configuration in the NGINX&#039;s conf.d directory.&lt;br /&gt;
{{Cmd|vim /etc/nginx/conf.d/git.your_domain.com.conf}}&lt;br /&gt;
&lt;br /&gt;
The file should look something like this:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/nginx/conf.d/git.your_domain.com.conf|&amp;lt;nowiki&amp;gt;server {&lt;br /&gt;
    server_name git.your_domain.com;&lt;br /&gt;
    root /usr/share/webapps/cgit;&lt;br /&gt;
    try_files $uri @cgit;&lt;br /&gt;
    location @cgit {&lt;br /&gt;
        include fastcgi_params;&lt;br /&gt;
        fastcgi_pass localhost:1234;&lt;br /&gt;
        fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi;&lt;br /&gt;
        fastcgi_param PATH_INFO $uri;&lt;br /&gt;
        fastcgi_param QUERY_STRING $args;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Restart the NGINX service.&lt;br /&gt;
{{Cmd|rc-service nginx restart}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26106</id>
		<title>Cgit</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26106"/>
		<updated>2024-01-02T17:39:11Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://git.zx2c4.com/cgit/ cgit] is a fast web-interface (CGI) for git written in the C programming language. It makes it possible for potential contributors to track and view project source code from the web instead of through a git client.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
{{Note|It is very recommendable that you already have a directory with an active .git working in your server. If you don&#039;t have one, install [[gitolite]] or a similar program before going further.}}&lt;br /&gt;
Install the package that contains cgit and git.&lt;br /&gt;
{{Cmd|apk add cgit git}}&lt;br /&gt;
&lt;br /&gt;
Open up /etc/cgitrc with your favorite editor, in this case is vim.&lt;br /&gt;
{{Cmd|vim /etc/cgitrc}}&lt;br /&gt;
&lt;br /&gt;
If you want to show an specific repository your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
repo.path=/var/lib/git/repositories/YOUR_GIT_REPO.git/&lt;br /&gt;
repo.url=CUSTOM_GIT_URL&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you want to scan and show all the repositories you have, your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
scan-path=/var/lib/git/repositories/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Run cgit using spawn-fcgi and fcgiwrap ===&lt;br /&gt;
Create a new service by doing a symbolic link.&lt;br /&gt;
{{Cmd|ln -s spawn-fcgi /etc/init.d/spawn-fcgi.cgit}}&lt;br /&gt;
{{Note|You should also modify the file and add -f after ${FCGI_PROGRAM} on line 99.  Otherwise you will have no log and problems will be impossible to debug.}}&lt;br /&gt;
Create a configuration file called spawn-fcgi.cgit in /etc/conf.d/ ; the service will run fcgiwrap automatically everytime is called. It should look exactly like this:&lt;br /&gt;
{{Cat|/etc/conf.d/spawn-fcgi.cgit|&amp;lt;nowiki&amp;gt;FCGI_PORT=1234&lt;br /&gt;
FCGI_PROGRAM=/usr/bin/fcgiwrap&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|You should consider using unix domain sockets instead.}}&lt;br /&gt;
Start the newly created service.&lt;br /&gt;
{{Cmd|rc-service spawn-fcgi.cgit start}}&lt;br /&gt;
&lt;br /&gt;
== Run cgit with a web service ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Lighttpd to work with cgit ===&lt;br /&gt;
Install the package that contains lighttpd if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add lighttpd}}&lt;br /&gt;
&lt;br /&gt;
Create a cgit.conf file into the lighttpd directory with the following content:&lt;br /&gt;
{{Cat|/etc/lighttpd/cgit.conf|&amp;lt;nowiki&amp;gt;server.modules += (&amp;quot;mod_redirect&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_alias&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_cgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_fastcgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_rewrite&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
var.webapps  = &amp;quot;/usr/share/webapps/&amp;quot;&lt;br /&gt;
$HTTP[&amp;quot;url&amp;quot;] =~ &amp;quot;^/cgit&amp;quot; {&lt;br /&gt;
    server.document-root = webapps&lt;br /&gt;
    server.indexfiles = (&amp;quot;cgit.cgi&amp;quot;)&lt;br /&gt;
    cgi.assign = (&amp;quot;cgit.cgi&amp;quot; =&amp;gt; &amp;quot;&amp;quot;)&lt;br /&gt;
    mimetype.assign = ( &amp;quot;.css&amp;quot; =&amp;gt; &amp;quot;text/css&amp;quot; )&lt;br /&gt;
}&lt;br /&gt;
url.redirect = (&lt;br /&gt;
    &amp;quot;^/git/(.*)$&amp;quot; =&amp;gt; &amp;quot;/cgit/cgit.cgi/$1&amp;quot;,&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Finally, add the following line to the lighttpd.conf file:&lt;br /&gt;
{{Cat|/etc/lighttpd/lighttpd.conf|&amp;lt;nowiki&amp;gt;include &amp;quot;cgit.conf&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Restart the lighttpd service.&lt;br /&gt;
{{Cmd|rc-service lighttpd restart}}&lt;br /&gt;
&lt;br /&gt;
=== Configure NGINX to work with cgit pointing to a subdomain ===&lt;br /&gt;
&lt;br /&gt;
Install the package that contains NGINX if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add nginx}}&lt;br /&gt;
&lt;br /&gt;
Create a custom configuration in the NGINX&#039;s conf.d directory.&lt;br /&gt;
{{Cmd|vim /etc/nginx/conf.d/git.your_domain.com.conf}}&lt;br /&gt;
&lt;br /&gt;
The file should look something like this:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/nginx/conf.d/git.your_domain.com.conf|&amp;lt;nowiki&amp;gt;server {&lt;br /&gt;
    server_name git.your_domain.com;&lt;br /&gt;
    root /usr/share/webapps/cgit;&lt;br /&gt;
    try_files $uri @cgit;&lt;br /&gt;
    location @cgit {&lt;br /&gt;
        include fastcgi_params;&lt;br /&gt;
        fastcgi_pass localhost:1234;&lt;br /&gt;
        fastcgi_param SCRIPT_FILE $document_root/cgit.cgi;&lt;br /&gt;
        fastcgi_param PATH_INFO $uri;&lt;br /&gt;
        fastcgi_param QUERY_STRING $args;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Restart the NGINX service.&lt;br /&gt;
{{Cmd|rc-service nginx restart}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26105</id>
		<title>Cgit</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Cgit&amp;diff=26105"/>
		<updated>2024-01-02T17:38:21Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://git.zx2c4.com/cgit/ cgit] is a fast web-interface (CGI) for git written in the C programming language. It makes it possible for potential contributors to track and view project source code from the web instead of through a git client.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
{{Note|It is very recommendable that you already have a directory with an active .git working in your server. If you don&#039;t have one, install [[gitolite]] or a similar program before going further.}}&lt;br /&gt;
Install the package that contains cgit and git.&lt;br /&gt;
{{Cmd|apk add cgit git}}&lt;br /&gt;
&lt;br /&gt;
Open up /etc/cgitrc with your favorite editor, in this case is vim.&lt;br /&gt;
{{Cmd|vim /etc/cgitrc}}&lt;br /&gt;
&lt;br /&gt;
If you want to show an specific repository your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
repo.path=/var/lib/git/repositories/YOUR_GIT_REPO.git/&lt;br /&gt;
repo.url=CUSTOM_GIT_URL&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you want to scan and show all the repositories you have, your configuration should look something like this:&lt;br /&gt;
{{Cat|/etc/cgitrc|&amp;lt;nowiki&amp;gt;virtual-root=/&lt;br /&gt;
scan-path=/var/lib/git/repositories/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Run cgit using spawn-fcgi and fcgiwrap ===&lt;br /&gt;
Create a new service by doing a symbolic link.&lt;br /&gt;
{{Cmd|ln -s spawn-fcgi /etc/init.d/spawn-fcgi.cgit}}&lt;br /&gt;
{{Note|You should also modify the file and add -f after ${FCGI_PROGRAM} on line 99.  Otherwise you will have no log and problems will be impossible to debug.}}&lt;br /&gt;
Create a configuration file called spawn-fcgi.cgit in /etc/conf.d/ ; the service will run fcgiwrap automatically everytime is called. It should look exactly like this:&lt;br /&gt;
{{Cat|/etc/conf.d/spawn-fcgi.cgit|&amp;lt;nowiki&amp;gt;FCGI_PORT=1234&lt;br /&gt;
FCGI_PROGRAM=/usr/bin/fcgiwrap&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Start the newly created service.&lt;br /&gt;
{{Cmd|rc-service spawn-fcgi.cgit start}}&lt;br /&gt;
&lt;br /&gt;
== Run cgit with a web service ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Lighttpd to work with cgit ===&lt;br /&gt;
Install the package that contains lighttpd if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add lighttpd}}&lt;br /&gt;
&lt;br /&gt;
Create a cgit.conf file into the lighttpd directory with the following content:&lt;br /&gt;
{{Cat|/etc/lighttpd/cgit.conf|&amp;lt;nowiki&amp;gt;server.modules += (&amp;quot;mod_redirect&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_alias&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_cgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_fastcgi&amp;quot;,&lt;br /&gt;
                  &amp;quot;mod_rewrite&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
var.webapps  = &amp;quot;/usr/share/webapps/&amp;quot;&lt;br /&gt;
$HTTP[&amp;quot;url&amp;quot;] =~ &amp;quot;^/cgit&amp;quot; {&lt;br /&gt;
    server.document-root = webapps&lt;br /&gt;
    server.indexfiles = (&amp;quot;cgit.cgi&amp;quot;)&lt;br /&gt;
    cgi.assign = (&amp;quot;cgit.cgi&amp;quot; =&amp;gt; &amp;quot;&amp;quot;)&lt;br /&gt;
    mimetype.assign = ( &amp;quot;.css&amp;quot; =&amp;gt; &amp;quot;text/css&amp;quot; )&lt;br /&gt;
}&lt;br /&gt;
url.redirect = (&lt;br /&gt;
    &amp;quot;^/git/(.*)$&amp;quot; =&amp;gt; &amp;quot;/cgit/cgit.cgi/$1&amp;quot;,&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Finally, add the following line to the lighttpd.conf file:&lt;br /&gt;
{{Cat|/etc/lighttpd/lighttpd.conf|&amp;lt;nowiki&amp;gt;include &amp;quot;cgit.conf&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Restart the lighttpd service.&lt;br /&gt;
{{Cmd|rc-service lighttpd restart}}&lt;br /&gt;
&lt;br /&gt;
=== Configure NGINX to work with cgit pointing to a subdomain ===&lt;br /&gt;
&lt;br /&gt;
Install the package that contains NGINX if you haven&#039;t already.&lt;br /&gt;
{{Cmd|apk add nginx}}&lt;br /&gt;
&lt;br /&gt;
Create a custom configuration in the NGINX&#039;s conf.d directory.&lt;br /&gt;
{{Cmd|vim /etc/nginx/conf.d/git.your_domain.com.conf}}&lt;br /&gt;
&lt;br /&gt;
The file should look something like this:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/nginx/conf.d/git.your_domain.com.conf|&amp;lt;nowiki&amp;gt;server {&lt;br /&gt;
    server_name git.your_domain.com;&lt;br /&gt;
    root /usr/share/webapps/cgit;&lt;br /&gt;
    try_files $uri @cgit;&lt;br /&gt;
    location @cgit {&lt;br /&gt;
        include fastcgi_params;&lt;br /&gt;
        fastcgi_pass localhost:1234;&lt;br /&gt;
        fastcgi_param SCRIPT_FILE $document_root/cgit.cgi;&lt;br /&gt;
        fastcgi_param PATH_INFO $uri;&lt;br /&gt;
        fastcgi_param QUERY_STRING $args;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
Restart the NGINX service.&lt;br /&gt;
{{Cmd|rc-service nginx restart}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_in_QEMU&amp;diff=21625</id>
		<title>Install Alpine in QEMU</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_in_QEMU&amp;diff=21625"/>
		<updated>2022-02-27T23:22:07Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before You Start==&lt;br /&gt;
&lt;br /&gt;
* Download the [http://alpinelinux.org/downloads latest Alpine image].&lt;br /&gt;
* Install QEMU on your system (e.g. &amp;lt;code&amp;gt;sudo apt install qemu&amp;lt;/code&amp;gt; on Ubuntu, &amp;lt;code&amp;gt;yum -y install qemu&amp;lt;/code&amp;gt; on Fedora)&lt;br /&gt;
&lt;br /&gt;
If you are using alpine linux, you will like need to install:&lt;br /&gt;
&lt;br /&gt;
  # apk add qemu qemu-img qemu-system-x86_64 qemu-ui-gtk&lt;br /&gt;
&lt;br /&gt;
==Create the Virtual Machine==&lt;br /&gt;
&lt;br /&gt;
Create a disk image if you want to install Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|qemu-img create -f qcow2 alpine.qcow2 8G}}&lt;br /&gt;
&lt;br /&gt;
The following command starts QEMU with the Alpine ISO image as CDROM, the default network configuration, 512MB RAM, the disk image that was created in the previous step, and CDROM as the boot device.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-standard-3.10.2-x86_64.iso -hda alpine.qcow2 -display gtk -enable-kvm}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Remove option &amp;lt;code&amp;gt;-enable-kvm&amp;lt;/code&amp;gt; if your hardware does support this.}}&lt;br /&gt;
&lt;br /&gt;
Log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; (no password) and run: {{Cmd|setup-alpine}}&lt;br /&gt;
Follow the [[Alpine_setup_scripts#setup-alpine|setup-alpine installation steps]].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;poweroff&amp;lt;/code&amp;gt; to shut down the machine.&lt;br /&gt;
&lt;br /&gt;
== Booting the Virtual Machine ==&lt;br /&gt;
After the installation, QEMU can be started from disk image (&amp;lt;code&amp;gt;-boot c&amp;lt;/code&amp;gt;) without CDROM.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|qemu-system-x86_64 -m 512 -nic user -hda alpine.qcow2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_in_QEMU&amp;diff=21624</id>
		<title>Install Alpine in QEMU</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_in_QEMU&amp;diff=21624"/>
		<updated>2022-02-27T22:54:19Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: /* Before You Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before You Start==&lt;br /&gt;
&lt;br /&gt;
* Download the [http://alpinelinux.org/downloads latest Alpine image].&lt;br /&gt;
* Install QEMU on your system (e.g. &amp;lt;code&amp;gt;sudo apt install qemu&amp;lt;/code&amp;gt; on Ubuntu, &amp;lt;code&amp;gt;yum -y install qemu&amp;lt;/code&amp;gt; on Fedora)&lt;br /&gt;
&lt;br /&gt;
If you are using alpine linux, you will like need to install:&lt;br /&gt;
&lt;br /&gt;
  # apk add qemu qemu-img qemu-system-x86_64 qemu-ui-gtk&lt;br /&gt;
&lt;br /&gt;
==Create the Virtual Machine==&lt;br /&gt;
&lt;br /&gt;
Create a disk image if you want to install Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|qemu-img create -f qcow2 alpine.qcow2 8G}}&lt;br /&gt;
&lt;br /&gt;
The following command starts QEMU with the Alpine ISO image as CDROM, the default network configuration, 512MB RAM, the disk image that was created in the previous step, and CDROM as the boot device.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-standard-3.10.2-x86_64.iso -hda alpine.qcow2}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Add option &amp;lt;code&amp;gt;-enable-kvm&amp;lt;/code&amp;gt; if your hardware support this.}}&lt;br /&gt;
&lt;br /&gt;
Log in as &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; (no password) and run: {{Cmd|setup-alpine}}&lt;br /&gt;
Follow the [[Alpine_setup_scripts#setup-alpine|setup-alpine installation steps]].&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;poweroff&amp;lt;/code&amp;gt; to shut down the machine.&lt;br /&gt;
&lt;br /&gt;
== Booting the Virtual Machine ==&lt;br /&gt;
After the installation, QEMU can be started from disk image (&amp;lt;code&amp;gt;-boot c&amp;lt;/code&amp;gt;) without CDROM.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|qemu-system-x86_64 -m 512 -nic user -hda alpine.qcow2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Relay_email_to_gmail_(msmtp,_mailx,_sendmail&amp;diff=21610</id>
		<title>Relay email to gmail (msmtp, mailx, sendmail</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Relay_email_to_gmail_(msmtp,_mailx,_sendmail&amp;diff=21610"/>
		<updated>2022-02-20T14:10:04Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
If you&#039;re running an alpine from stick and need a way for your program to alert you through a standard gmail account&lt;br /&gt;
&lt;br /&gt;
== Install msmtp ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apk add msmtp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
Create a global configuration, &amp;quot;/etc/msmtprc&amp;quot; with content&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set default values for all following accounts.&lt;br /&gt;
defaults&lt;br /&gt;
auth           on&lt;br /&gt;
tls            on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
syslog         on&lt;br /&gt;
&lt;br /&gt;
# Gmail&lt;br /&gt;
account        gmail&lt;br /&gt;
host           smtp.gmail.com&lt;br /&gt;
port           587&lt;br /&gt;
from           &amp;lt;your email&amp;gt;&lt;br /&gt;
user           &amp;lt;your gmail account&amp;gt;&lt;br /&gt;
password       &amp;lt;your password&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Set a default account&lt;br /&gt;
account default : gmail&lt;br /&gt;
aliases        /etc/aliases&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{note|Please note I&#039;ve used the &#039;&#039;&#039;syslog on&#039;&#039;&#039; to send msmtp log to syslog, yet you can use the &#039;&#039;&#039;logfile    &amp;lt;log_file_path&amp;gt;&#039;&#039;&#039; if you prefer to log to a file }}&lt;br /&gt;
{{note|Please note the aliases &#039;&#039;&#039;/etc/aliases&#039;&#039;&#039;, this will help for mail/sendmail to redirect email to local user (like root) to an external email }}&lt;br /&gt;
&lt;br /&gt;
== Sendmail alias ==&lt;br /&gt;
By default alpine comes with busybox sendmail, msmtp can act as a sendmail alternative including syntax and option, there I create a local.d script to overwrite the busybox link to msmtp.&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;quot;/etc/local.d/msmtp-sendmail.start&amp;quot; with below content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
ln -sf /usr/bin/msmtp /usr/bin/sendmail&lt;br /&gt;
ln -sf /usr/bin/msmtp /usr/sbin/sendmail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo chmod +x /etc/local.d/msmtp-sendmail.start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and run it first time through&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo /etc/local.d/msmtp-sendmail.start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mailx and aliases ==&lt;br /&gt;
Install mailx for program that uses mail (like apcupsd for monitoring UPS events)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apk add mailx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an &amp;quot;/etc/aliases&amp;quot; file with content:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root: &amp;lt;your external email where all email to root will be sent&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default: &amp;lt;default email&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Test an email, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -e &amp;quot;Subject: Do you love alpine?\nYes, I do!\n&amp;quot; | msmtp root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{note|&#039;&#039;&#039;root&#039;&#039;&#039; only work if you&#039;ve setup /etc/aliases, otherwise put any email adress you can check instead of root}}&lt;br /&gt;
&lt;br /&gt;
== Saving the configuration ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo lbu ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hope it helps.&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:Mail]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=21605</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=21605"/>
		<updated>2022-02-16T15:00:04Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
Podman can be installed via `podman` package in the community repository.&lt;br /&gt;
&lt;br /&gt;
  # apk add podman&lt;br /&gt;
&lt;br /&gt;
To run podman you&#039;ll need to enable the cgroups service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].&lt;br /&gt;
&lt;br /&gt;
  # rc-update add cgroups&lt;br /&gt;
  # rc-service cgroups start&lt;br /&gt;
&lt;br /&gt;
You might need to restart your machine for this to work properly.&lt;br /&gt;
&lt;br /&gt;
If you are running on top of btrfs, consider setting storage driver to btrfs:&lt;br /&gt;
&lt;br /&gt;
  +   $ cat /etc/containers/storage.conf | grep &#039;driver =&#039;&lt;br /&gt;
  driver = &amp;quot;btrfs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For rootless support (replace &amp;lt;USER&amp;gt; with your username):&lt;br /&gt;
&lt;br /&gt;
  # modprobe tun&lt;br /&gt;
  # echo tun &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
  # echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subuid&lt;br /&gt;
  # echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subgid&lt;br /&gt;
&lt;br /&gt;
Run an example container to verify everything works:&lt;br /&gt;
&lt;br /&gt;
  $ podman run --rm hello-world&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=21604</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Podman&amp;diff=21604"/>
		<updated>2022-02-16T14:59:39Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: Update for podman on 3.15&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
Podman can be installed via `podman` package in the community repository.&lt;br /&gt;
&lt;br /&gt;
  # apk add podman&lt;br /&gt;
&lt;br /&gt;
To run podman you&#039;ll need to enable the cgroups service, consider enabling [[OpenRC#cgroups v2|cgroups v2]].&lt;br /&gt;
&lt;br /&gt;
  # rc-update add cgroups&lt;br /&gt;
  # rc-service cgroups start&lt;br /&gt;
&lt;br /&gt;
You might need to restart your machine for this to work properly.&lt;br /&gt;
&lt;br /&gt;
If you are running on top of btrfs, consider setting driver to btrfs:&lt;br /&gt;
&lt;br /&gt;
  +   $ cat /etc/containers/storage.conf | grep &#039;driver =&#039;&lt;br /&gt;
  driver = &amp;quot;btrfs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For rootless support (replace &amp;lt;USER&amp;gt; with your username):&lt;br /&gt;
&lt;br /&gt;
  # modprobe tun&lt;br /&gt;
  # echo tun &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
  # echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subuid&lt;br /&gt;
  # echo &amp;lt;USER&amp;gt;:100000:65536 &amp;gt;/etc/subgid&lt;br /&gt;
&lt;br /&gt;
Run an example container to verify everything works:&lt;br /&gt;
&lt;br /&gt;
  $ podman run --rm hello-world&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=OpenRC&amp;diff=21603</id>
		<title>OpenRC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=OpenRC&amp;diff=21603"/>
		<updated>2022-02-16T14:53:14Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Quick-Start Information ==&lt;br /&gt;
Alpine Linux uses [https://wiki.gentoo.org/wiki/OpenRC OpenRC] for its init system.&lt;br /&gt;
&lt;br /&gt;
The following commands are available to manage the init system:&lt;br /&gt;
* Basics:&lt;br /&gt;
 {{Cmd|rc-update add &amp;lt;service&amp;gt; &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
 {{Cmd|rc-update del &amp;lt;service&amp;gt; &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
 {{Cmd|rc-service &amp;lt;service&amp;gt; &amp;lt;start stop restart&amp;gt; # ⇔ /etc/init.d/service &amp;lt;start stop restart&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* To check services and their set runlevels:&lt;br /&gt;
 {{Cmd|rc-status}}&lt;br /&gt;
&lt;br /&gt;
* To change to a different runlevel:&lt;br /&gt;
 {{Cmd|rc &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Reboot/Halt/Poweroff: (And their equivalent from traditional GNU/Linux systems)&lt;br /&gt;
 {{Cmd|reboot   # ⇔ shutdown now -r}}&lt;br /&gt;
 {{Cmd|halt     # ⇔ shutdown now -H}}&lt;br /&gt;
 {{Cmd|poweroff # ⇔ shutdown now -P}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Prior to Alpine Linux 2.0.0, you might need to use the following commands instead: &#039;&#039;rc_add, rc_delete,&#039;&#039; and &#039;&#039;rc_status&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
== Available Runlevels ==&lt;br /&gt;
The available runlevels are:&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; - Used if no runlevel is specified. (This is generally the runlevel you want to add services to.)&lt;br /&gt;
* &#039;&#039;&#039;hotplugged&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;manual&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The special runlevels are:&lt;br /&gt;
* &#039;&#039;&#039;sysinit&#039;&#039;&#039; - Brings up system specific stuff such as &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; and optionally &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt; for Linux based systems. It also mounts &amp;lt;code&amp;gt;/lib/rc/init.d&amp;lt;/code&amp;gt; as a ramdisk using tmpfs where available unless &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; is mounted rw at boot. &amp;lt;code&amp;gt;&#039;&#039;&#039;rc&#039;&#039;&#039;&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;/lib/rc/init.d&amp;lt;/code&amp;gt; to hold state information about the services it runs. sysinit always runs when the host first starts and should not be run again.&lt;br /&gt;
* &#039;&#039;&#039;boot&#039;&#039;&#039; - Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here.&lt;br /&gt;
* &#039;&#039;&#039;single&#039;&#039;&#039; - Stops all services except for those in the sysinit runlevel.&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039; - Changes to the shutdown runlevel and then reboots the host.&lt;br /&gt;
* &#039;&#039;&#039;shutdown&#039;&#039;&#039; - Changes to the shutdown runlevel and then halts the host.&lt;br /&gt;
&lt;br /&gt;
== rc-update usage ==&lt;br /&gt;
 Usage: rc-update [options] add service &amp;lt;runlevel&amp;gt;&lt;br /&gt;
        rc-update [options] del service &amp;lt;runlevel&amp;gt;&lt;br /&gt;
        rc-update [options] show&lt;br /&gt;
 &lt;br /&gt;
 Options: [suChqv]&lt;br /&gt;
   -s, --stack                       Stack a runlevel instead of a service&lt;br /&gt;
   -u, --update                      Force an update of the dependency tree&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc-status usage ==&lt;br /&gt;
 Usage: rc-status [options] [runlevel1] [runlevel2] ...&lt;br /&gt;
 &lt;br /&gt;
 Options: [aclrsuChqv]&lt;br /&gt;
   -a, --all                         Show services from all run levels&lt;br /&gt;
   -c, --crashed                     Show crashed services&lt;br /&gt;
   -l, --list                        Show list of run levels&lt;br /&gt;
   -r, --runlevel                    Show the name of the current runlevel&lt;br /&gt;
   -s, --servicelist                 Show service list&lt;br /&gt;
   -u, --unused                      Show services not assigned to any runlevel&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc-service usage ==&lt;br /&gt;
 Usage: rc-service [options]&lt;br /&gt;
 &lt;br /&gt;
 Options: [e:ilr:ChqVv]&lt;br /&gt;
   -e, --exists &amp;lt;arg&amp;gt;                tests if the service exists or not&lt;br /&gt;
   -i, --ifexists                    if the service exists then run the command&lt;br /&gt;
   -l, --list                        list all available services&lt;br /&gt;
   -r, --resolve &amp;lt;arg&amp;gt;               resolve the service name to an init script&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -V, --version                     Display software version&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc usage ==&lt;br /&gt;
 Usage: rc [options]&lt;br /&gt;
 &lt;br /&gt;
 Options: [a:o:s:SChqVv]&lt;br /&gt;
   -a, --applet &amp;lt;arg&amp;gt;                runs the applet specified by the next argument&lt;br /&gt;
   -o, --override &amp;lt;arg&amp;gt;              override the next runlevel to change into&lt;br /&gt;
                                     when leaving single user or boot runlevels&lt;br /&gt;
   -s, --service &amp;lt;arg&amp;gt;               runs the service specified with the rest&lt;br /&gt;
                                     of the arguments&lt;br /&gt;
   -S, --sys                         output the RC system type, if any&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -V, --version                     Display software version&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== cgroups v2 ==&lt;br /&gt;
&lt;br /&gt;
You can enable cgroups v2 by editing /etc/rc.conf and setting rc_cgroup_mode to unified.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=OpenRC&amp;diff=21602</id>
		<title>OpenRC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=OpenRC&amp;diff=21602"/>
		<updated>2022-02-16T14:53:00Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Quick-Start Information ==&lt;br /&gt;
Alpine Linux uses [https://wiki.gentoo.org/wiki/OpenRC OpenRC] for its init system.&lt;br /&gt;
&lt;br /&gt;
The following commands are available to manage the init system:&lt;br /&gt;
* Basics:&lt;br /&gt;
 {{Cmd|rc-update add &amp;lt;service&amp;gt; &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
 {{Cmd|rc-update del &amp;lt;service&amp;gt; &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
 {{Cmd|rc-service &amp;lt;service&amp;gt; &amp;lt;start stop restart&amp;gt; # ⇔ /etc/init.d/service &amp;lt;start stop restart&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* To check services and their set runlevels:&lt;br /&gt;
 {{Cmd|rc-status}}&lt;br /&gt;
&lt;br /&gt;
* To change to a different runlevel:&lt;br /&gt;
 {{Cmd|rc &amp;lt;runlevel&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Reboot/Halt/Poweroff: (And their equivalent from traditional GNU/Linux systems)&lt;br /&gt;
 {{Cmd|reboot   # ⇔ shutdown now -r}}&lt;br /&gt;
 {{Cmd|halt     # ⇔ shutdown now -H}}&lt;br /&gt;
 {{Cmd|poweroff # ⇔ shutdown now -P}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Prior to Alpine Linux 2.0.0, you might need to use the following commands instead: &#039;&#039;rc_add, rc_delete,&#039;&#039; and &#039;&#039;rc_status&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
== Available Runlevels ==&lt;br /&gt;
The available runlevels are:&lt;br /&gt;
* &#039;&#039;&#039;default&#039;&#039;&#039; - Used if no runlevel is specified. (This is generally the runlevel you want to add services to.)&lt;br /&gt;
* &#039;&#039;&#039;hotplugged&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;manual&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The special runlevels are:&lt;br /&gt;
* &#039;&#039;&#039;sysinit&#039;&#039;&#039; - Brings up system specific stuff such as &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; and optionally &amp;lt;code&amp;gt;/sys&amp;lt;/code&amp;gt; for Linux based systems. It also mounts &amp;lt;code&amp;gt;/lib/rc/init.d&amp;lt;/code&amp;gt; as a ramdisk using tmpfs where available unless &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; is mounted rw at boot. &amp;lt;code&amp;gt;&#039;&#039;&#039;rc&#039;&#039;&#039;&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;/lib/rc/init.d&amp;lt;/code&amp;gt; to hold state information about the services it runs. sysinit always runs when the host first starts and should not be run again.&lt;br /&gt;
* &#039;&#039;&#039;boot&#039;&#039;&#039; - Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here.&lt;br /&gt;
* &#039;&#039;&#039;single&#039;&#039;&#039; - Stops all services except for those in the sysinit runlevel.&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039; - Changes to the shutdown runlevel and then reboots the host.&lt;br /&gt;
* &#039;&#039;&#039;shutdown&#039;&#039;&#039; - Changes to the shutdown runlevel and then halts the host.&lt;br /&gt;
&lt;br /&gt;
== rc-update usage ==&lt;br /&gt;
 Usage: rc-update [options] add service &amp;lt;runlevel&amp;gt;&lt;br /&gt;
        rc-update [options] del service &amp;lt;runlevel&amp;gt;&lt;br /&gt;
        rc-update [options] show&lt;br /&gt;
 &lt;br /&gt;
 Options: [suChqv]&lt;br /&gt;
   -s, --stack                       Stack a runlevel instead of a service&lt;br /&gt;
   -u, --update                      Force an update of the dependency tree&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc-status usage ==&lt;br /&gt;
 Usage: rc-status [options] [runlevel1] [runlevel2] ...&lt;br /&gt;
 &lt;br /&gt;
 Options: [aclrsuChqv]&lt;br /&gt;
   -a, --all                         Show services from all run levels&lt;br /&gt;
   -c, --crashed                     Show crashed services&lt;br /&gt;
   -l, --list                        Show list of run levels&lt;br /&gt;
   -r, --runlevel                    Show the name of the current runlevel&lt;br /&gt;
   -s, --servicelist                 Show service list&lt;br /&gt;
   -u, --unused                      Show services not assigned to any runlevel&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc-service usage ==&lt;br /&gt;
 Usage: rc-service [options]&lt;br /&gt;
 &lt;br /&gt;
 Options: [e:ilr:ChqVv]&lt;br /&gt;
   -e, --exists &amp;lt;arg&amp;gt;                tests if the service exists or not&lt;br /&gt;
   -i, --ifexists                    if the service exists then run the command&lt;br /&gt;
   -l, --list                        list all available services&lt;br /&gt;
   -r, --resolve &amp;lt;arg&amp;gt;               resolve the service name to an init script&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -V, --version                     Display software version&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== rc usage ==&lt;br /&gt;
 Usage: rc [options]&lt;br /&gt;
 &lt;br /&gt;
 Options: [a:o:s:SChqVv]&lt;br /&gt;
   -a, --applet &amp;lt;arg&amp;gt;                runs the applet specified by the next argument&lt;br /&gt;
   -o, --override &amp;lt;arg&amp;gt;              override the next runlevel to change into&lt;br /&gt;
                                     when leaving single user or boot runlevels&lt;br /&gt;
   -s, --service &amp;lt;arg&amp;gt;               runs the service specified with the rest&lt;br /&gt;
                                     of the arguments&lt;br /&gt;
   -S, --sys                         output the RC system type, if any&lt;br /&gt;
   -h, --help                        Display this help output&lt;br /&gt;
   -C, --nocolor                     Disable color output&lt;br /&gt;
   -V, --version                     Display software version&lt;br /&gt;
   -v, --verbose                     Run verbosely&lt;br /&gt;
   -q, --quiet                       Run quietly&lt;br /&gt;
&lt;br /&gt;
== cgroups v2 ==&lt;br /&gt;
&lt;br /&gt;
By can enable cgroups v2 by editing /etc/rc.conf and setting rc_cgroup_mode to unified.&lt;br /&gt;
&lt;br /&gt;
[[Category:Booting]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=20065</id>
		<title>LXC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=20065"/>
		<updated>2021-08-08T00:25:29Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: Update for lxc-download, alpine template is not package by default (anymore?)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://linuxcontainers.org/ Linux Containers (LXC)] provides containers similar to BSD Jails, Linux VServers and Solaris Zones. It gives the impression of virtualization, but shares the kernel and resources with the &amp;quot;host&amp;quot;. You can use lxc directly or through [[LXD]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Install the required packages:&lt;br /&gt;
{{Cmd|apk add lxc bridge lxcfs lxc-download xz}}&lt;br /&gt;
&lt;br /&gt;
If you want to create containers other than Alpine, you&#039;ll need lxc-templates:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add lxc-templates}}&lt;br /&gt;
&lt;br /&gt;
== Upgrading from 2.x ==&lt;br /&gt;
&lt;br /&gt;
Starting with Alpine 3.9, we ship LXC version 3.1.&lt;br /&gt;
LXC 3.x has major changes which can and will break your current setup.&lt;br /&gt;
LXC 3.x will NOT ship with legacy container templates. Check your current container configs to see if you have any includes pointing to files that don&#039;t exist (shipped by legacy templates).&lt;br /&gt;
For example if you use Alpine containers created with the Alpine template, you&#039;ll need to install:&lt;br /&gt;
&lt;br /&gt;
 apk add lxc-templates-legacy-alpine&lt;br /&gt;
&lt;br /&gt;
Also make sure you convert your LXC config files to the new 2.x format (this is now required).&lt;br /&gt;
&lt;br /&gt;
 lxc-update-config -c /var/lib/lxc/container-name/config&lt;br /&gt;
&lt;br /&gt;
Make sure you have removed &#039;&#039;&#039;cgroup_enable&#039;&#039;&#039; from your cmdline as this will fail to mount cgroups and fail LXC service.&lt;br /&gt;
&lt;br /&gt;
== Prepare network on host ==&lt;br /&gt;
Set up a [[bridge]] on the host. Example &#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto br0&lt;br /&gt;
iface br0 inet dhcp&lt;br /&gt;
    bridge-ports eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a network configuration template for the guests, &#039;&#039;/etc/lxc/default.conf&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.net.0.type = veth&lt;br /&gt;
lxc.net.0.link = br0&lt;br /&gt;
lxc.net.0.flags = up&lt;br /&gt;
lxc.net.0.hwaddr = fe:xx:xx:xx:xx:xx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grsecurity restrictions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: As of Alpine version 3.8, we no longer ship grsecurity and it should not be used in lxc setup.&lt;br /&gt;
&lt;br /&gt;
Some restrictions will be applied when using a grsecurity kernel (Alpine Linux default kernel).&lt;br /&gt;
The most notable is the use of lxc-attach which will not be allowed because of GRKERNSEC_CHROOT_CAPS.&lt;br /&gt;
To solve this, we will have to disable the grsec restriction by creating a sysctl profile for lxc.&lt;br /&gt;
Create the following file &#039;&#039;/etc/sysctl.d/10-lxc.conf&#039;&#039; and add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
kernel.grsecurity.chroot_caps = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few other restrictions that can prevent proper container operation. &lt;br /&gt;
When things do not work as expected, check the kernel log with dmesg to see if grsec prevented things from happening.&lt;br /&gt;
&lt;br /&gt;
Other possible restrictions are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
kernel.grsecurity.chroot_deny_chroot = 0&lt;br /&gt;
kernel.grsecurity.chroot_deny_mount = 0&lt;br /&gt;
kernel.grsecurity.chroot_deny_mknod = 0&lt;br /&gt;
kernel.grsecurity.chroot_deny_chmod = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you finish creating your new sysctl profile, you can apply it by restarting sysctl service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-service sysctl restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Always consult the [https://en.wikibooks.org/wiki/Grsecurity/Appendix/Grsecurity_and_PaX_Configuration_Options Grsecurity documentation] before applying these settings.&lt;br /&gt;
&lt;br /&gt;
== Create a guest ==&lt;br /&gt;
&lt;br /&gt;
=== Picking from the list ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest1 -f /etc/lxc/default.conf -t download}}&lt;br /&gt;
&lt;br /&gt;
And just pick from the list. lxc-download and xz can be uninstalled after you are done.&lt;br /&gt;
&lt;br /&gt;
=== Alpine Template ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest1 -f /etc/lxc/default.conf -t alpine}}&lt;br /&gt;
&lt;br /&gt;
This will create a &#039;&#039;/var/lib/lxc/guest1&#039;&#039; directory with a &#039;&#039;config&#039;&#039; file and a &#039;&#039;rootfs&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
Note: by default, the alpine template &#039;&#039;&#039;does not have networking service on&#039;&#039;&#039;, you will need to add it using lxc-console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If running on x64 compatible hardware, it is possible to create a 32bit guest:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest1 -f /etc/lxc/default.conf -t alpine -- --arch x86}}&lt;br /&gt;
&lt;br /&gt;
=== Debian template ===&lt;br /&gt;
&lt;br /&gt;
In order to create a debian template container you&#039;ll need to install some packages:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add debootstrap rsync}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to turn off some grsecurity chroot options otherwise the debootstrap will fail:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_caps&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_chroot&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_mount&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_mknod&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_chmod&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Remember to turn them back on, or simply reboot.&lt;br /&gt;
&lt;br /&gt;
Now you can run:&lt;br /&gt;
{{Cmd|SUITE{{=}}wheezy lxc-create -n guest1 -f /etc/lxc/default.conf -t debian}}&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu template ===&lt;br /&gt;
&lt;br /&gt;
In order to create an ubuntu template container, you&#039;ll need to turn off some grsecurity chroot options:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_caps&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_chroot&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_mount&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_mknod&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/kernel/grsecurity/chroot_deny_chmod&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Remember to turn them back on, or simply reboot.&lt;br /&gt;
&lt;br /&gt;
Now you can run (replace %MIRROR% with the actual hostname, for example: http://us.archive.ubuntu.com/ubuntu/)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest2 -f /etc/lxc/default.conf -t ubuntu -- -r xenial -a amd64 -u user --password secretpassword --mirror $MIRROR  }}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Be sure to set systemd_container to yes in /etc/conf.d/lxc.CONTAINER.  Otherwise, most functionality will be broken}}&lt;br /&gt;
&lt;br /&gt;
=== Unprivileged LXC images (Alpine / Debian / Ubuntu / Centos etc..) ===&lt;br /&gt;
&lt;br /&gt;
To enable unprivileged containers, one must create a uidgid map:&lt;br /&gt;
&lt;br /&gt;
 echo root:1000000:65536 | tee -a /etc/subuid &lt;br /&gt;
 echo root:1000000:65536 | tee -a /etc/subgid&lt;br /&gt;
&lt;br /&gt;
This creates a uid and gid map for the root user starting at 1000000 with a size of 65536.&lt;br /&gt;
&lt;br /&gt;
To configure containers to use this mapping, add the following lines to the configuration:&lt;br /&gt;
&lt;br /&gt;
 lxc.idmap = u 0 1000000 65536&lt;br /&gt;
 lxc.idmap = g 0 1000000 65536&lt;br /&gt;
&lt;br /&gt;
This can be in the global or container-specific configuration.&lt;br /&gt;
&lt;br /&gt;
To create an unprivileged lxc container, you need to use the download template. The download template must be installed:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add gnupg xz lxc-download&lt;br /&gt;
lxc-create -n container-name -t download}}&lt;br /&gt;
choose the Distribution | Release | Architecture.&lt;br /&gt;
&lt;br /&gt;
To be able to log in to a Debian container, you currently need to:&lt;br /&gt;
{{Cmd|rm /lib/systemd/system/container-getty\@.service}}&lt;br /&gt;
&lt;br /&gt;
You can also [http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_jessie/sid_installationers remove Systemd from the container].&lt;br /&gt;
&lt;br /&gt;
== Starting/Stopping the guest ==&lt;br /&gt;
&lt;br /&gt;
First, you should enable the cgroup script:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add cgroups}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to reboot, you can start the service by running&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service cgroups start}}&lt;br /&gt;
&lt;br /&gt;
Create a symlink to the &#039;&#039;/etc/init.d/lxc&#039;&#039; script for your guest.&lt;br /&gt;
{{Cmd|ln -s lxc /etc/init.d/lxc.guest1}}&lt;br /&gt;
&lt;br /&gt;
You can start your guest with:&lt;br /&gt;
{{Cmd|/etc/init.d/lxc.guest1 start}}&lt;br /&gt;
&lt;br /&gt;
Stop it with:&lt;br /&gt;
{{Cmd|/etc/init.d/lxc.guest1 stop}}&lt;br /&gt;
&lt;br /&gt;
Make it autostart at boot-up with:&lt;br /&gt;
{{Cmd| rc-update add lxc.guest1}}&lt;br /&gt;
&lt;br /&gt;
You can add to the container config: &amp;lt;code&amp;gt;lxc.start.auto = 1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add lxc}}&lt;br /&gt;
&lt;br /&gt;
to autostart containers with the lxc service only.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the guest ==&lt;br /&gt;
By default, sshd is not installed. You&#039;ll have to attach to the container or connect to the virtual console. This is done with:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-attach -n guest1}}&lt;br /&gt;
&lt;br /&gt;
Type exit to detach from the container again (please check the grsec notes above)&lt;br /&gt;
&lt;br /&gt;
== Connect to virtual console ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-console -n guest1}}&lt;br /&gt;
&lt;br /&gt;
To disconnect, press {{key|Ctrl}}+{{key|a}} {{key|q}}&lt;br /&gt;
&lt;br /&gt;
== Deleting a guest ==&lt;br /&gt;
Make sure the guest is stopped, then run:&lt;br /&gt;
{{Cmd|lxc-destroy -n guest1}}&lt;br /&gt;
This will erase everything, without asking any questions. It is equivalent to: {{Cmd|rm -r /var/lib/lxc/guest1}}&lt;br /&gt;
&lt;br /&gt;
== Advanced ==&lt;br /&gt;
&lt;br /&gt;
=== Creating a LXC container without modifying your network interfaces ===&lt;br /&gt;
&lt;br /&gt;
The problem with bridging is that the interface you bridge gets replaced with your new bridge interface.&lt;br /&gt;
Let&#039;s say you have interface eth0 that you want to bridge. Your eth0 interface gets replaced with the br0 interface that you create. It also means that the interface you use needs to be placed into promiscuous mode to catch all the traffic that could de destined to the other side of the bridge, which may not be what you want.&lt;br /&gt;
&lt;br /&gt;
The solution is to create a dummy network interface, bridge that, and set up NAT so that traffic out of your bridge interface gets pushed through the interface of your choice.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s create that dummy interface (thanks to ncopa for talking me out of macvlan and pointing out the dummy interface kernel module)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|modprobe dummy}}&lt;br /&gt;
&lt;br /&gt;
This will create a dummy interface called dummy0 on your host. To create this interface on every boot, append &amp;quot;dummy&amp;quot; to /etc/modules:&lt;br /&gt;
&lt;br /&gt;
Now we will create a bridge called br0&lt;br /&gt;
&lt;br /&gt;
{{Cmd |brctl addbr br0&lt;br /&gt;
brctl setfd br0 0 }}&lt;br /&gt;
&lt;br /&gt;
and then make that dummy interface one end of the bridge&lt;br /&gt;
&lt;br /&gt;
{{Cmd | brctl addif br0 dummy0 }}&lt;br /&gt;
&lt;br /&gt;
Next, let&#039;s give that bridged interface a reason to exist:&lt;br /&gt;
&lt;br /&gt;
{{ Cmd | ifconfig br0 192.168.1.1 netmask 255.255.255.0 up}}&lt;br /&gt;
&lt;br /&gt;
Create a file for your container. Let&#039;s say /etc/lxc/bridgenat.conf, with the following settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.net.0.type = veth&lt;br /&gt;
lxc.net.0.flags = up&lt;br /&gt;
lxc.net.0.link = br0&lt;br /&gt;
lxc.net.0.name = eth1&lt;br /&gt;
lxc.net.0.ipv4.address = 192.168.1.2/24 192.168.1.255&lt;br /&gt;
lxc.net.0.ipv4.gateway = 192.168.1.1&lt;br /&gt;
lxc.net.0.veth.pair = veth-if-0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and build your container with that file:&lt;br /&gt;
&lt;br /&gt;
{{ Cmd | lxc-create -n alpine -f /etc/lxc/bridgenat.conf -t alpine }}&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping your container from your host, and your host from your container.&lt;br /&gt;
&lt;br /&gt;
Your container needs to know where to push traffic that isn&#039;t within it&#039;s subnet. To do so, we tell the container to route through the bridge interface, br0&lt;br /&gt;
From inside the container run&lt;br /&gt;
&lt;br /&gt;
{{ Cmd | route add default gw 192.168.1.1 }}&lt;br /&gt;
&lt;br /&gt;
The next step is to push the traffic coming from your private subnet over br0 out through your internet facing interface, or any interface you chose&lt;br /&gt;
&lt;br /&gt;
We are messing with your IP tables here, so make sure these settings don&#039;t conflict with anything you may have already set up.&lt;br /&gt;
&lt;br /&gt;
Say eth0 was your internet facing network interface, and br0 is the name of the bridge you made earlier. We&#039;d do this:&lt;br /&gt;
&lt;br /&gt;
{{ Cmd | echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE&lt;br /&gt;
iptables --append FORWARD --in-interface br0 -j ACCEPT&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now you should be able to route through your bridge interface to the internet facing interface of your host from your container, just like at home!&lt;br /&gt;
&lt;br /&gt;
You could also have a dhcp server running on your host, and set it up to give IP addresses from your private subnet to any container that requests it, and then have one template for multiple alpine LXC containers, perfect for alpine development :)&lt;br /&gt;
&lt;br /&gt;
=== Using static IP ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using static IP, you need to configure this properly on the guest /etc/network/interfaces. To stay in line with the above example, modify &#039;&#039;/var/lib/lxc/guest1/rootfs/etc/network/interfaces&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
from&lt;br /&gt;
&lt;br /&gt;
 #auto lo&lt;br /&gt;
     iface lo inet loopback&lt;br /&gt;
 auto eth0&lt;br /&gt;
     iface eth0 inet &#039;&#039;&#039;dhcp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
to &lt;br /&gt;
&lt;br /&gt;
 #auto lo&lt;br /&gt;
     iface lo inet loopback&lt;br /&gt;
 auto eth0&lt;br /&gt;
     iface eth0 inet &#039;&#039;&#039;static&#039;&#039;&#039;&lt;br /&gt;
     address &amp;lt;lxc-container-ip&amp;gt;   # IP which the lxc container should use&lt;br /&gt;
     gateway &amp;lt;gateway-ip&amp;gt;         # IP of gateway to use, mostly same as on lxc-host&lt;br /&gt;
     netmask &amp;lt;netmask&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mem and swap ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|vim /boot/extlinux.conf}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&lt;br /&gt;
  APPEND initrd{{=}}initramfs-3.10.13-1-grsec root{{=}}UUID{{=}}7cd8789f-5659-40f8-9548-ae8f89c918ab modules{{=}}sd-mod,usb-storage,ext4 quiet cgroup_enable{{=}}memory swapaccount{{=}}1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== checkconfig ===&lt;br /&gt;
{{Cmd|lxc-checkconfig}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&lt;br /&gt;
Kernel configuration not found at /proc/config.gz; searching...&lt;br /&gt;
Kernel configuration found at /boot/config-3.10.13-1-grsec&lt;br /&gt;
--- Namespaces ---&lt;br /&gt;
Namespaces: enabled&lt;br /&gt;
Utsname namespace: enabled&lt;br /&gt;
Ipc namespace: enabled&lt;br /&gt;
Pid namespace: enabled&lt;br /&gt;
User namespace: missing&lt;br /&gt;
Network namespace: enabled&lt;br /&gt;
Multiple /dev/pts instances: enabled&lt;br /&gt;
&lt;br /&gt;
--- Control groups ---&lt;br /&gt;
Cgroup: enabled&lt;br /&gt;
Cgroup clone_children flag: enabled&lt;br /&gt;
Cgroup device: enabled&lt;br /&gt;
Cgroup sched: enabled&lt;br /&gt;
Cgroup cpu account: enabled&lt;br /&gt;
Cgroup memory controller: missing&lt;br /&gt;
Cgroup cpuset: enabled&lt;br /&gt;
&lt;br /&gt;
--- Misc ---&lt;br /&gt;
Veth pair device: enabled&lt;br /&gt;
Macvlan: enabled&lt;br /&gt;
Vlan: enabled&lt;br /&gt;
File capabilities: enabled&lt;br /&gt;
&lt;br /&gt;
Note : Before booting a new kernel, you can check its configuration&lt;br /&gt;
usage : CONFIG{{=}}/path/to/config /usr/bin/lxc-checkconfig&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== VirtualBox ===&lt;br /&gt;
&lt;br /&gt;
In order for the network to work on containers, you need to set &amp;quot;Promiscuous Mode&amp;quot; to &amp;quot;Allow All&amp;quot; in VirtualBox settings for the network adapter.&lt;br /&gt;
&lt;br /&gt;
[[File:VirtualBoxNetworkAdapter.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;br /&gt;
&lt;br /&gt;
=== postgreSQL ===&lt;br /&gt;
&lt;br /&gt;
Inside the container run: {{Cmd|chmod go+w /dev/null}} to fix {{Cmd|rc-service postgresql start}}&lt;br /&gt;
&lt;br /&gt;
=== openVPN ===&lt;br /&gt;
&lt;br /&gt;
see [[Setting_up_a_OpenVPN_server#openVPN_and_LXC]]&lt;br /&gt;
&lt;br /&gt;
== LXC 1.0 Additional information ==&lt;br /&gt;
&lt;br /&gt;
Some info regarding new features in LXC 1.0&lt;br /&gt;
 &lt;br /&gt;
https://www.stgraber.org/2013/12/20/lxc-1-0-blog-post-series/&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Howto-lxc-simple]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=18102</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=18102"/>
		<updated>2020-10-14T16:10:47Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: Rewrite to simplify and improve the document&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While Alpine Linux is often used as base image for linux containers, it can of course be also installed on bare metal machine as well. That is the focus of this document.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
= Quick Requirements =&lt;br /&gt;
&lt;br /&gt;
Nearly any hardware should run Alpine Linux but the following basic requirements are recommended:&lt;br /&gt;
&lt;br /&gt;
* At least 128MB of RAM for server without GUI, or at least 1.6GB for graphical desktop&lt;br /&gt;
* At least 1GB storage device for server without GUI, or at least 10GB for graphical desktop with web browsing&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Requirements]].&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-2-boot.png|350px|thumb|right|Installation : setup-alpine : booting process until login prompt]]&lt;br /&gt;
&lt;br /&gt;
= Installation Overview =&lt;br /&gt;
&lt;br /&gt;
The following steps are brief and intended for the common case; for complete info and other architectures, please consult the [[Alpine newbie install manual]].&lt;br /&gt;
&lt;br /&gt;
== 1. Download the installation image ==&lt;br /&gt;
&lt;br /&gt;
You need to acquire installation image, usually from [http://alpinelinux.org/downloads]. Most likely you will want the standard edition. Make sure you download the image for correct architecture.&lt;br /&gt;
&lt;br /&gt;
== 2. Create the installation medium ==&lt;br /&gt;
&lt;br /&gt;
Either you can burn the image onto CD/DVD, you use usb stick for the installation.&lt;br /&gt;
&lt;br /&gt;
Under linux, you can use the dd for that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;dd if=&amp;lt;source iso&amp;gt; of=&amp;lt;target device&amp;gt; bs=4M; sync&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that the device &#039;&#039;&#039;does not&#039;&#039;&#039; include partition number, so example from my machine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;dd if=~/Downloads/alpine-standard-3.10.2-x86_64.iso of=/dev/sdb bs=4M&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target device &#039;&#039;&#039;will be erased&#039;&#039;&#039;, so make sure you use something without any data you do not&lt;br /&gt;
want to lose.&lt;br /&gt;
&lt;br /&gt;
== 3. Boot and install process ==&lt;br /&gt;
&lt;br /&gt;
Log in as the user &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and execute [[Alpine_setup_scripts#setup-alpine|setup-alpine]] and answer all the questions asked. Quick step-by-step walkthrough (go read [[Alpine_setup_scripts#setup-alpine|setup-alpine]] for more in-depth explanation):&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Installation : setup-alpine : complete process single install]]&lt;br /&gt;
&lt;br /&gt;
===== Keyboard layout and variant =====&lt;br /&gt;
&lt;br /&gt;
As you would expect, this is keyboard layout you want. If you are not sure, answering &amp;lt;code&amp;gt;us&amp;lt;/code&amp;gt; to both layout and variant will get you started and you can change it later.&lt;br /&gt;
&lt;br /&gt;
===== System hostname =====&lt;br /&gt;
&lt;br /&gt;
Pick the name of your computer, while not mandatory, something unique if prefered. Or you can just use &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; if you do not care.&lt;br /&gt;
&lt;br /&gt;
===== Network configuratinon =====&lt;br /&gt;
&lt;br /&gt;
You will be asked &#039;&#039;which&#039;&#039; network interface you want to configure, if you are not sure, picking the offered default would likely work. Once selected, you will be asked &amp;lt;code&amp;gt;Ip address for XXX?&amp;lt;/code&amp;gt;, you can either assign an IP address or write &amp;lt;code&amp;gt;dhcp&amp;lt;/code&amp;gt;, which will mean take configuration from the network (the &amp;lt;code&amp;gt;dhcp&amp;lt;/code&amp;gt; works great for home networks where you do not care about IP of your machine).&lt;br /&gt;
&lt;br /&gt;
Assuming you decided to configure network yourself with IP address, you will also be asked for netmask, gateway, dns domain name and dns server IP. Correct values for there are beyond the scope of this document, please refer to your network administrator for guidance instead.&lt;br /&gt;
&lt;br /&gt;
===== Password for root =====&lt;br /&gt;
&lt;br /&gt;
Well this one is obvious.&lt;br /&gt;
&lt;br /&gt;
===== Timezone =====&lt;br /&gt;
&lt;br /&gt;
For servers, it is common to use UTC, for non-server machines, your local timezone should be likely used. Notice that you can use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to list the timezone.&lt;br /&gt;
&lt;br /&gt;
===== HTTP/FTP Proxy =====&lt;br /&gt;
&lt;br /&gt;
Most likely default (&amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt;) is the correct choice.&lt;br /&gt;
&lt;br /&gt;
===== NTP client =====&lt;br /&gt;
&lt;br /&gt;
Which client to use for keeping the system clock in sync, default works for most people.&lt;br /&gt;
&lt;br /&gt;
===== Mirror =====&lt;br /&gt;
&lt;br /&gt;
Pick mirror from which to download updates, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is CDN backed by Fastly, so reasonable choice for most people.&lt;br /&gt;
&lt;br /&gt;
===== SSH server =====&lt;br /&gt;
&lt;br /&gt;
Which SSH server do you want to configure on your machine. If you know that you will &#039;&#039;&#039;not&#039;&#039;&#039; connect to your machine remotely (most laptops for example), &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; should be used. Otherwise, the default (&amp;lt;code&amp;gt;openssh&amp;lt;/code&amp;gt;) is a good pick.&lt;br /&gt;
&lt;br /&gt;
===== Disk setup =====&lt;br /&gt;
&lt;br /&gt;
Here your can pick the device to install the system on and also the mode in which it should be installed. For overview of the modes, see [[Alpine_setup_scripts#setup-modes|this]]. If you are not sure or just starting up, &amp;lt;code&amp;gt;sys&amp;lt;/code&amp;gt; is likely what you want, it is the same mode that other distributions use for installation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;All data on the chosen device will be erased!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Reboot =====&lt;br /&gt;
&lt;br /&gt;
After the script finishes installing the system, it will tell you to reboot. Note that:&lt;br /&gt;
&lt;br /&gt;
* If the configured [[Alpine_setup_scripts#sys_mode|runtime mode was &amp;quot;sys&amp;quot;]], then remove the initial installation media to boot the newly installed system.&lt;br /&gt;
* If the configured [[Alpine_setup_scripts#diskless_mode|runtime mode was &amp;quot;data&amp;quot;]], then keep the installation media inserted to boot the newly installed system.&lt;br /&gt;
&lt;br /&gt;
Then execute &amp;lt;code&amp;gt;reboot&amp;lt;/code&amp;gt; and once the machine restarts and finishes booting up, you should see login prompt of your new Alpine Linux installation.&lt;br /&gt;
&lt;br /&gt;
The installation script only installs the base operating system. Applications such as a web server, mail server, desktop environment, or web browser are not installed and &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is the only normal user. For instructions on proceeding after installation, please see [[Tutorials_and_Howtos#Post-Install|Tutorials_and_Howtos Post-Install section]].&lt;br /&gt;
&lt;br /&gt;
= Further Documentation =&lt;br /&gt;
&lt;br /&gt;
More specific instructions and instructions for other architectures or machines (e.g. ARM, RPi, etc) are defined in [[Tutorials_and_Howtos#Installation:_Use_cases|Installation:_Use_cases]]. Also see the following wiki pages for more information:&lt;br /&gt;
&lt;br /&gt;
* [[FAQ|FAQs]]&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Contribute|How to Contribute]]&lt;br /&gt;
* [[Developer Documentation]]&lt;br /&gt;
* [[Newbie Alpine Ecosystem]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://mckayemu.github.io/alpineinstalls/ More information, in Spanish]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=18101</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Installation&amp;diff=18101"/>
		<updated>2020-10-14T15:25:46Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: Fix link label and move into separate subsection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Alpine Linux can be installed as the main operating system on a physical machine (&amp;quot;bare metal&amp;quot;), including on embedded devices. For example, [https://en.wikipedia.org/wiki/PostmarketOS PostmarketOS] is a smartphone operating system based on Alpine. Another old examle are [https://www.adelielinux.org/ Adélie Linux] is a complete end-user distribution started as geento fork but using Alpine Linux software. While this use case is less common than Alpine Linux&#039;s main use as a base system for container images in systems (like Docker), this document describes how Alpine can be installed as the primary operating system for a computer.&lt;br /&gt;
&lt;br /&gt;
Alpine in fact works as a [https://en.wikipedia.org/wiki/Live_USB live system]&amp;amp;mdash;any install disk of Alpine can also be run without installing to local storage of the machine it&#039;s booted on, running directly from the install media!&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
= Quick Requirements =&lt;br /&gt;
&lt;br /&gt;
Nearly any hardware should run Alpine Linux but the following basic requirements are recommended:&lt;br /&gt;
&lt;br /&gt;
* At least 128MB of RAM for server without GUI, or at least 1.6GB for graphical desktop&lt;br /&gt;
* At least 1GB storage device for server without GUI, or at least 10GB for graphical desktop with web browsing&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Requirements]].&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-2-boot.png|350px|thumb|right|Installation : setup-alpine : booting process until login prompt]]&lt;br /&gt;
&lt;br /&gt;
= Installation Overview =&lt;br /&gt;
&lt;br /&gt;
The following steps are brief and intended for the common case; for complete info and other architectures, please consult the [[Alpine newbie install manual]].&lt;br /&gt;
&lt;br /&gt;
== 1. Download the media source ==&lt;br /&gt;
&lt;br /&gt;
The most common is to grab an ISO from [http://alpinelinux.org/downloads]. Take note of architectures in green buttons.&lt;br /&gt;
&lt;br /&gt;
== 2. Dump, burn or flash the image ==&lt;br /&gt;
&lt;br /&gt;
Dump the ISO image onto a media source like USB/SD flashing; or CD/DVD/BR disk with burning software.&lt;br /&gt;
In Linux, you can use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;dd if=&amp;lt;your iso filename&amp;gt; of=&amp;lt;your target media&amp;gt; bs=1M; sync&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, to flash a USB drive or SD card as target media install.&lt;br /&gt;
&lt;br /&gt;
== 3. Boot and install process ==&lt;br /&gt;
&lt;br /&gt;
Log in as the user &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; by typing &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and hitting &#039;&#039;enter&#039;&#039;. Then execute &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-alpine|setup-alpine]]&amp;lt;/code&amp;gt;, answering the questions and hitting &#039;&#039;enter&#039;&#039; after each:&lt;br /&gt;
&lt;br /&gt;
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Installation : setup-alpine : complete process single install]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Select keyboard layout&#039;&#039;&#039;: Choose your keyboard layout, e.g. &#039;&#039;us&#039;&#039; or &#039;&#039;es&#039;&#039;.&lt;br /&gt;
** &#039;&#039;&#039;Select variant&#039;&#039;&#039;: Choose your keyboard layout variant,  e.g. &#039;&#039;us-nodeadkeys&#039;&#039; or &#039;&#039;es-winkeys&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;Enter system hostname&#039;&#039;&#039;: Choose the name of your computer; &#039;&#039;&#039;localhost&#039;&#039;&#039; is good enough and recommended for starting.&lt;br /&gt;
* &#039;&#039;&#039;Initialize network cards&#039;&#039;&#039;: Here most people can just go with the default (just press enter).&lt;br /&gt;
** &#039;&#039;&#039;Any manual configuration&#039;&#039;&#039;: Perform other configuration if needed, otherwise just type &amp;quot;no&amp;quot; and hit enter.&lt;br /&gt;
** &#039;&#039;&#039;Select domain name&#039;&#039;&#039;: This is not commonly asked, you can just hit enter.&lt;br /&gt;
* &#039;&#039;&#039;DNS nameservers?&#039;&#039;&#039;: If asked, &amp;lt;code&amp;gt;8.8.8.8&amp;lt;/code&amp;gt; is a recommended default that will be good for most people.&lt;br /&gt;
* &#039;&#039;&#039;Changing password for root&#039;&#039;&#039;: Next a root password must be defined. Input a passphrase; what you type won&#039;t be shown on the screen.&lt;br /&gt;
** &#039;&#039;&#039;Retype password&#039;&#039;&#039;: Type the same passphrase to confirm the root password; what you type won&#039;t be shown on the screen.&lt;br /&gt;
* &#039;&#039;&#039;Which timezone to choose?&#039;&#039;&#039;: Set it to your local time zone or hit enter for &amp;lt;code&amp;gt;UTC&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Proxy chooser&#039;&#039;&#039;: Type &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; and hit enter if you&#039;re not using a proxy.&lt;br /&gt;
* &#039;&#039;&#039;Which NTP client to run?&#039;&#039;&#039;: This is for keeping the system clock in sync. The default is good enough for most people.&lt;br /&gt;
* &#039;&#039;&#039;Enter mirror number&#039;&#039;&#039;: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is a good choice for most people.&lt;br /&gt;
* &#039;&#039;&#039;Which SSH server?&#039;&#039;&#039;: An SSH server allows you to remotely manage your machine. The default is good enough for most people.&lt;br /&gt;
* &#039;&#039;&#039;Disk Setup&#039;&#039;&#039; Choose how to set up your disks.&lt;br /&gt;
** &#039;&#039;&#039;Which disks would you like to use?&#039;&#039;&#039;: Choose the disk where files will be installed. Usually &amp;lt;code&amp;gt;sda&amp;lt;/code&amp;gt; is the hard disk and &amp;lt;code&amp;gt;sdb&amp;lt;/code&amp;gt; is the USB boot or CD/DVD image.&lt;br /&gt;
** &#039;&#039;&#039;How would you like to use it?&#039;&#039;&#039;: Type &amp;quot;sys&amp;quot; and then press enter. This will cause the OS to be installed to the chosen disk&amp;amp;mdash;similar to how other distributions work.&lt;br /&gt;
&lt;br /&gt;
Take care that &#039;&#039;&#039;all data on your chosen disk will be erased&#039;&#039;&#039;. A final question will prompt you to continue. After confirming by typing &#039;y&#039; and hitting enter, you cannot turn back.&lt;br /&gt;
&lt;br /&gt;
After the script finishes installing the system, it will tell you to reboot. Note that:&lt;br /&gt;
&lt;br /&gt;
* If the configured [[Alpine_setup_scripts#sys_mode|runtime mode was &amp;quot;sys&amp;quot;]], then remove the initial installation media to boot the newly installed system.&lt;br /&gt;
* If the configured [[Alpine_setup_scripts#diskless_mode|runtime mode was &amp;quot;data&amp;quot;]], then keep the installation media inserted to boot the newly installed system.&lt;br /&gt;
&lt;br /&gt;
To reboot, type &amp;lt;code&amp;gt;reboot&amp;lt;/code&amp;gt; and hit enter. If you just wish to turn off the machine after installing, type &amp;lt;code&amp;gt;poweroff&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
= Further Documentation =&lt;br /&gt;
&lt;br /&gt;
The installation script only installs the base operating system. Applications such as a web server, mail server, desktop environment, or web browser are not installed and &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; is the only normal user. For instructions on proceeding after installation, please see [[Tutorials_and_Howtos#Post-Install|Tutorials_and_Howtos Post-Install section]].&lt;br /&gt;
&lt;br /&gt;
More specific instructions and instructions for other architectures or machines (e.g. ARM, RPi, etc) are defined in [[Tutorials_and_Howtos#Installation:_Use_cases|Installation:_Use_cases]]. Also see the following wiki pages for more information:&lt;br /&gt;
&lt;br /&gt;
* [[FAQ|FAQs]]&lt;br /&gt;
* [[Tutorials and Howtos]]&lt;br /&gt;
* [[Contribute|How to Contribute]]&lt;br /&gt;
* [[Developer Documentation]]&lt;br /&gt;
* [[Newbie Alpine Ecosystem]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://mckayemu.github.io/alpineinstalls/ More information, in Spanish]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=16728</id>
		<title>Radeon Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=16728"/>
		<updated>2019-12-22T00:14:51Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
The following instructions are for modern AMD GPU chipsets covered by the radeon driver.&lt;br /&gt;
&lt;br /&gt;
== Setup Xorg/udev ==&lt;br /&gt;
&lt;br /&gt;
# Run the &amp;lt;code&amp;gt;[[Alpine setup scripts#setup-xorg-base|setup-xorg-base]]&amp;lt;/code&amp;gt; script.&lt;br /&gt;
# Install the Xorg AMD video drivers: {{Cmd|# apk add xf86-video-ati}}&lt;br /&gt;
# For newer devices, use: {{Cmd|# apk add xf86-video-amdgpu}}&lt;br /&gt;
# Enable [[#Kernel Modesetting (KMS)]]. Specifically, the &amp;lt;code&amp;gt;fbcon&amp;lt;/code&amp;gt; module is necessary, or leaving Xorg (via &amp;lt;code&amp;gt;Ctrl+Alt+F1&amp;lt;/code&amp;gt; or quitting) will result in a black screen until the machine is power cycled. If you have already launch Xorg and don&#039;t want to experience this effect, you can &amp;lt;code&amp;gt;modprobe fbcon&amp;lt;/code&amp;gt; while Xorg is running.&lt;br /&gt;
&lt;br /&gt;
== Kernel Modesetting (KMS) ==&lt;br /&gt;
&lt;br /&gt;
To enable [[KMS]] at boot:&lt;br /&gt;
# Add the &amp;lt;code&amp;gt;radeon&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;amdgpu&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fbcon&amp;lt;/code&amp;gt; modules to {{Path|/etc/modules}}: {{Cmd|$ echo radeon &amp;gt;&amp;gt; /etc/modules&amp;lt;br /&amp;gt;$ echo fbcon &amp;gt;&amp;gt; /etc/modules}} or {{Cmd|$ echo amdgpu &amp;gt;&amp;gt; /etc/modules&amp;lt;br /&amp;gt;$ echo fbcon &amp;gt;&amp;gt; /etc/modules}}&lt;br /&gt;
# Install &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt;: {{Cmd|apk add mkinitfs}}&lt;br /&gt;
# Enable the &amp;lt;code&amp;gt;kms&amp;lt;/code&amp;gt; feature in the &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; configuration by adding it to the &amp;lt;var&amp;gt;features&amp;lt;/var&amp;gt; variable, e.g., {{cat|/etc/mkinitfs/mkinitfs.conf|features{{=}}&amp;quot;keymap cryptsetup kms ata base ide scsi usb virtio ext4&amp;quot;}}&lt;br /&gt;
# Run &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Reboot to test the configuration.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Fixing MESA-LOADER errors===&lt;br /&gt;
{{Obsolete|Alpine no longer ships with the &#039;&#039;linux-hardened&#039;&#039; kernel}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;linux-hardened&#039;&#039; kernel package places restrictions on sysfs and will prevent the MESA-LOADER from working as a normal user even if added to the video group.&lt;br /&gt;
&lt;br /&gt;
See https://bugs.alpinelinux.org/issues/7265&lt;br /&gt;
&lt;br /&gt;
Either switch to the &#039;&#039;linux-vanilla&#039;&#039; package or apply the &#039;&#039;&#039;grsec_sysfs_restrict=0&#039;&#039;&#039; kernel parameter to allow normal users to access hardware acceleration on the desktop.&lt;br /&gt;
&lt;br /&gt;
=== Fixing a frozen X11 when invoking startx ===&lt;br /&gt;
&lt;br /&gt;
You may need to set the AccelMethod to exa not glamor which is the default for the driver.&lt;br /&gt;
&lt;br /&gt;
{{cat|/etc/X11/xorg.conf|&lt;br /&gt;
  Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Option      &amp;quot;AccelMethod&amp;quot;        	&amp;quot;exa&amp;quot;&lt;br /&gt;
	Identifier  &amp;quot;Card0&amp;quot;&lt;br /&gt;
	Driver      &amp;quot;radeon&amp;quot;&lt;br /&gt;
	BusID       &amp;quot;PCI:1:0:0&amp;quot;&lt;br /&gt;
  EndSection}}&lt;br /&gt;
 &lt;br /&gt;
= =&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/ATI archlinux.org / ATI]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Xorg archlinux.org / Xorg]&lt;br /&gt;
&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Kernel_Modesetting&amp;diff=16727</id>
		<title>Kernel Modesetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Kernel_Modesetting&amp;diff=16727"/>
		<updated>2019-12-22T00:13:29Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Expand|Needs nVidia driver information}}&lt;br /&gt;
&lt;br /&gt;
; Intel&lt;br /&gt;
: See [[Intel_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; Radeon&lt;br /&gt;
: See [[Radeon_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; Nouveau&lt;br /&gt;
: See [[Nouveau_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; nVidia&lt;br /&gt;
: {{Todo|Find out how KMS works with nVidia drivers}}&lt;br /&gt;
&lt;br /&gt;
= =&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Kernel_mode_setting  Kernel mode setting] archlinux.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Kernel_Modesetting&amp;diff=16726</id>
		<title>Kernel Modesetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Kernel_Modesetting&amp;diff=16726"/>
		<updated>2019-12-22T00:10:57Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: Add links to amdgpu and nouveau wiki pages (will be done later)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Expand|Needs nVidia driver information}}&lt;br /&gt;
&lt;br /&gt;
; Intel&lt;br /&gt;
: See [[Intel_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; Amdgpu&lt;br /&gt;
: See [[Amdgpu_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; Radeon&lt;br /&gt;
: See [[Radeon_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; Nouveau&lt;br /&gt;
: See [[Nouveau_Video#Kernel_Modesetting_(KMS)]]&lt;br /&gt;
; nVidia&lt;br /&gt;
: {{Todo|Find out how KMS works with nVidia drivers}}&lt;br /&gt;
&lt;br /&gt;
= =&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Kernel_mode_setting  Kernel mode setting] archlinux.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Zero-To-Awall&amp;diff=15724</id>
		<title>Zero-To-Awall</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Zero-To-Awall&amp;diff=15724"/>
		<updated>2019-02-25T13:31:23Z</updated>

		<summary type="html">&lt;p&gt;Gray wolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Awall for dummies =&lt;br /&gt;
&lt;br /&gt;
This howto is aimed at users with no (or little) experience with iptables and other firewall frameworks (like Shorewall).&lt;br /&gt;
&lt;br /&gt;
This howto is going to be split into 5 parts.&lt;br /&gt;
&lt;br /&gt;
# Defining our base json file which holds our zones and base policies.&lt;br /&gt;
# Creating service policies.&lt;br /&gt;
# Using aliases and custom services.&lt;br /&gt;
# Enabling and testing policies.&lt;br /&gt;
# Finishing up and making it start (at boot)&lt;br /&gt;
&lt;br /&gt;
NOTE: please be aware that all configuration files are stored as JSON files. JSON is not a human friendly standard, &lt;br /&gt;
for instance it does not support comments so you will have to move them outside of the json structure.&lt;br /&gt;
Beginners should use a decent text editor with JSON highlight support which will make your life easier.&lt;br /&gt;
Since recent versions of [[Alpine Wall|awall]] it is also possible to use yaml instead of json but this is out of the scope of this howto.&lt;br /&gt;
&lt;br /&gt;
== Base policies ==&lt;br /&gt;
&lt;br /&gt;
Creating zones depends on the function of your firewall. Is it installed on a endpoint (server) or will it act as a router and filter/forward.&lt;br /&gt;
For this howto we assume you are going to setup a router and use NAT to forward services (ports) to different hosts on your network.&lt;br /&gt;
&lt;br /&gt;
For each interface on router we will setup a zone and assign it a zone name. We do this by creating the following file: /etc/awall/private/base.json&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Base zones and policies&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;zone&amp;quot;: {&lt;br /&gt;
    &amp;quot;WAN&amp;quot;: { &amp;quot;iface&amp;quot;: &amp;quot;eth0&amp;quot; },&lt;br /&gt;
    &amp;quot;LAN&amp;quot;: { &amp;quot;iface&amp;quot;: &amp;quot;eth1&amp;quot; },&lt;br /&gt;
    &amp;quot;VPN&amp;quot;: { &amp;quot;iface&amp;quot;: &amp;quot;tun+&amp;quot; }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;policy&amp;quot;: [&lt;br /&gt;
     { &amp;quot;in&amp;quot;: &amp;quot;VPN&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;out&amp;quot;: &amp;quot;VPN&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;in&amp;quot;: &amp;quot;LAN&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;out&amp;quot;: &amp;quot;LAN&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;in&amp;quot;: &amp;quot;_fw&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;in&amp;quot;: &amp;quot;_fw&amp;quot;, &amp;quot;out&amp;quot;:  &amp;quot;WAN&amp;quot; , &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot; },&lt;br /&gt;
     { &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;, &amp;quot;action&amp;quot;: &amp;quot;drop&amp;quot; }&lt;br /&gt;
  ],&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;snat&amp;quot;: [ { &amp;quot;out&amp;quot;: &amp;quot;WAN&amp;quot; } ],&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;clamp-mss&amp;quot;: [ { &amp;quot;out&amp;quot;: &amp;quot;WAN&amp;quot; } ]&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets break this down into sections&lt;br /&gt;
&lt;br /&gt;
=== description ===&lt;br /&gt;
&lt;br /&gt;
The description is here just for reference and will be used by &amp;lt;code&amp;gt;awall list&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== zone ===&lt;br /&gt;
&lt;br /&gt;
This is where our zones are defined. Zones are defined based on a interface and assigned a name to be used in your policies.&lt;br /&gt;
In our example you can see that we have two real interfaces eth0 and eth1 and one or more virtual interfaces tun+ (the plus sign stands for any digit like tun0 tun1 and so on). In case you are installing awall on an endpoint (a server) then you will most probably not have the eth1 interfaces and can leave it out. In our example the tun+ interface is added as it is very commonly used like when using openvpn.&lt;br /&gt;
&lt;br /&gt;
=== policy ===&lt;br /&gt;
&lt;br /&gt;
These are our main policies. It will tell our firewall what to do with when a packet enters or leaves from one of the zones (interfaces).&lt;br /&gt;
You will notice a special &amp;lt;code&amp;gt;_fw&amp;lt;/code&amp;gt; name which means the internal firewall (the local machine) which means the packet does not leave the firewall via another interface but should be send to one of the local services.&lt;br /&gt;
You can see that we by default do not filter any package coming from or going to our VPN zone/interface. You could instead change the default action to drop all packets and create separate policies to allow specific traffic but this is out of the scope of this howto.&lt;br /&gt;
&lt;br /&gt;
=== snat ===&lt;br /&gt;
&lt;br /&gt;
Apply source nat for outgoing packets. This is only needed if your firewall acts as a router and traffic behind the router needs a modified source address (translate from local ip to public ip).&lt;br /&gt;
&lt;br /&gt;
=== clamp-mss ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/alpinelinux/awall#mss-clamping-rules&lt;br /&gt;
&lt;br /&gt;
== Service policies ==&lt;br /&gt;
&lt;br /&gt;
Now that we have the base firewall in place we can start to define specific policies so our services will be reachable from the outside world.\&lt;br /&gt;
By default we are blocking all traffic coming in on our WAN interface (action=drop). The first thing we want to open is our SSH port/service. To do this we need to create a new policy inside the &amp;quot;optional&amp;quot; directory.&lt;br /&gt;
You could be wondering why the optional name, thats is because mandatory policies are stored in &amp;lt;code&amp;gt;/usr/share/awall/mandatory&amp;lt;/code&amp;gt; and not to be touched and our optional policies can be enabled/disabled on the run.&lt;br /&gt;
&lt;br /&gt;
=== SSH service ===&lt;br /&gt;
&lt;br /&gt;
To add our SSH policies we create a new file: /etc/awall/optional/ssh.json&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Allow rate-limited SSH on WAN&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;filter&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;,&lt;br /&gt;
      &amp;quot;out&amp;quot;: &amp;quot;_fw&amp;quot;,&lt;br /&gt;
      &amp;quot;service&amp;quot;: &amp;quot;ssh&amp;quot;,&lt;br /&gt;
      &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot;,&lt;br /&gt;
      &amp;quot;conn-limit&amp;quot;: { &amp;quot;count&amp;quot;: 3, &amp;quot;interval&amp;quot;: 20 }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== description ====&lt;br /&gt;
&lt;br /&gt;
This is similar for any policy&lt;br /&gt;
&lt;br /&gt;
==== Filter ====&lt;br /&gt;
&lt;br /&gt;
This is the actual filter that is currently set to drop the packets arriving or leaving the interface.&lt;br /&gt;
&lt;br /&gt;
===== in =====&lt;br /&gt;
&lt;br /&gt;
The interface the packets arrive on, in this case its the WAN interface.&lt;br /&gt;
&lt;br /&gt;
===== out =====&lt;br /&gt;
&lt;br /&gt;
The interface the packets leave on, in this case its _fw which means it does not leave our firewall/device and is targeted at our local SSH service.&lt;br /&gt;
&lt;br /&gt;
===== service =====&lt;br /&gt;
&lt;br /&gt;
This is the service definition provided by awall or a custom service which we will discuss later on.&lt;br /&gt;
&lt;br /&gt;
===== action =====&lt;br /&gt;
&lt;br /&gt;
The action on the packet, this inverts the default action of drop and accepts the packets.&lt;br /&gt;
&lt;br /&gt;
===== conn-limit =====&lt;br /&gt;
&lt;br /&gt;
This is a special feature of our firewall/iptables to allow only a certain amount of packets in a certain amount of time. For more information please check our awall manual.&lt;br /&gt;
&lt;br /&gt;
=== SSH to another Host ===&lt;br /&gt;
&lt;br /&gt;
edit the following file: /etc/awall/optional/ssh-to-hostname.json&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Forward SSH to hostname&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;filter&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;,&lt;br /&gt;
      &amp;quot;service&amp;quot;: { &amp;quot;proto&amp;quot;: &amp;quot;tcp&amp;quot;, &amp;quot;port&amp;quot;: 22001 },&lt;br /&gt;
      &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot;,&lt;br /&gt;
      &amp;quot;conn-limit&amp;quot;: { &amp;quot;count&amp;quot;: 3, &amp;quot;interval&amp;quot;: 20 }&lt;br /&gt;
    }&lt;br /&gt;
  ],&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;dnat&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;,&lt;br /&gt;
      &amp;quot;dest&amp;quot;: &amp;quot;$SERVER&amp;quot;,&lt;br /&gt;
      &amp;quot;service&amp;quot;: { &amp;quot;proto&amp;quot;: &amp;quot;tcp&amp;quot;, &amp;quot;port&amp;quot;: 22001 },&lt;br /&gt;
      &amp;quot;to-port&amp;quot;: &amp;quot;22&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets discuss the differences between this policy and the previous SSH policy.&lt;br /&gt;
&lt;br /&gt;
==== Filter ====&lt;br /&gt;
&lt;br /&gt;
===== service =====&lt;br /&gt;
&lt;br /&gt;
Because port 22 is already in use by our own firewall, we need to listen on a different port. In this example we listen on port 22001.&lt;br /&gt;
And because we are not using the default port 22 we need to define our own service specification.&lt;br /&gt;
&lt;br /&gt;
==== dnat ====&lt;br /&gt;
&lt;br /&gt;
Also known as destination NAT.&lt;br /&gt;
&lt;br /&gt;
===== dest =====&lt;br /&gt;
&lt;br /&gt;
The destination the packet will be forwarded to. In this case we are using a variable named $HOSTNAME. Anywhere in your policies you can define your own variables and use them.&lt;br /&gt;
In our case we have used a file in /etc/awall/private/aliases.json more on this topic later on.&lt;br /&gt;
&lt;br /&gt;
===== to-port =====&lt;br /&gt;
&lt;br /&gt;
This is the destination target port number. The packet will be forwarded from 22001 to 22 on the $hostname&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN Service ===&lt;br /&gt;
&lt;br /&gt;
This is the most generic config available. It does nothing more then opening port(s) defined for our openvpn service in &amp;lt;code&amp;gt;/etc/awall/private/custom-services.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;description&amp;quot;: &amp;quot;Allow local OpenVPN&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;filter&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;,&lt;br /&gt;
            &amp;quot;out&amp;quot;: &amp;quot;_fw&amp;quot;,&lt;br /&gt;
            &amp;quot;service&amp;quot;: &amp;quot;openvpn&amp;quot;,&lt;br /&gt;
            &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Allow ping on WAN ===&lt;br /&gt;
&lt;br /&gt;
Allow rate-limited ping on WAN. Which has the same kind of flow limit as our previous SSH policy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Allow rate-limited ping on WAN&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;filter&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;in&amp;quot;: &amp;quot;WAN&amp;quot;,&lt;br /&gt;
      &amp;quot;out&amp;quot;: &amp;quot;_fw&amp;quot;,&lt;br /&gt;
      &amp;quot;service&amp;quot;: &amp;quot;ping&amp;quot;,&lt;br /&gt;
      &amp;quot;action&amp;quot;: &amp;quot;accept&amp;quot;,&lt;br /&gt;
      &amp;quot;flow-limit&amp;quot;: { &amp;quot;count&amp;quot;: 10, &amp;quot;interval&amp;quot;: 6 }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using aliases and custom services ==&lt;br /&gt;
&lt;br /&gt;
=== Aliases ===&lt;br /&gt;
&lt;br /&gt;
To make life easier when your firewall rules increase, it can be nice to map specific hosts to names.&lt;br /&gt;
Awall supports something called [https://github.com/alpinelinux/awall#variable-expansion variable expansion] which is a mapping between a value and a variable.&lt;br /&gt;
When you have many devices behind your firewall/router, your policies can be harder to read. Also when one of your devices IP address change you will have to update all of your policies.&lt;br /&gt;
With awalls variables you can assign the ip address of a device to a variable name. Edit the following file: &amp;lt;code&amp;gt;/etc/awall/private/aliases.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Hostname aliases&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;variable&amp;quot;: {&lt;br /&gt;
    &amp;quot;PRINTER&amp;quot;: &amp;quot;192.168.1.1&amp;quot;,&lt;br /&gt;
    &amp;quot;SERVER&amp;quot;: &amp;quot;192.168.1.2&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look in the example above where $SERVER is used to forward port 22001 to port 22.&lt;br /&gt;
&lt;br /&gt;
NOTE: You are not limited to assigning only IP addresses to variables. You can use it however you like. More information can be found in the awall manual.&lt;br /&gt;
&lt;br /&gt;
=== Custom services ===&lt;br /&gt;
&lt;br /&gt;
Awall includes a predefined list of [https://github.com/alpinelinux/awall/blob/master/json/services.json services]. If the service you try to define in your policy does not exist in awalls services list you can define services yourself.&lt;br /&gt;
&lt;br /&gt;
Create the file: &amp;lt;code&amp;gt;/etc/awall/private/custom-services.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;service&amp;quot;: {&lt;br /&gt;
&lt;br /&gt;
        &amp;quot;mqtt&amp;quot;: [&lt;br /&gt;
            { &amp;quot;proto&amp;quot;: &amp;quot;udp&amp;quot;, &amp;quot;port&amp;quot;: 1883 },&lt;br /&gt;
            { &amp;quot;proto&amp;quot;: &amp;quot;tcp&amp;quot;, &amp;quot;port&amp;quot;: 1883 }&lt;br /&gt;
        ],&lt;br /&gt;
&lt;br /&gt;
        &amp;quot;openvpn&amp;quot;: [&lt;br /&gt;
            { &amp;quot;proto&amp;quot;: &amp;quot;udp&amp;quot;, &amp;quot;port&amp;quot;: 1194 },&lt;br /&gt;
            { &amp;quot;proto&amp;quot;: &amp;quot;tcp&amp;quot;, &amp;quot;port&amp;quot;: 1194 }&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: although you are free to name your policy files however you want, you cannot name this file &amp;lt;code&amp;gt;services.json&amp;lt;/code&amp;gt; because this policy name is already in use by the included services.json of awall.&lt;br /&gt;
&lt;br /&gt;
== Using our policies ==&lt;br /&gt;
&lt;br /&gt;
You should now have two directories in your awall config directory named optional and private with multiple json files. The biggest difference between these two directories is the ability to enable and disable policies located in the optional directory. When you enable a policy by using &amp;lt;code&amp;gt;awall enable policy-name&amp;lt;/code&amp;gt; awall will generate a symlink in your awall config directory and will automatically load them when you activate the firewall. To be able to also use the files in the private directory we will need to include them in one of our optional policies. You can name the file however you like as long it doesn&#039;t conflict with existing policies names (including the ones in private directory and awall&#039;s system policies). Example names would be hostname.json main.json firewall.json. For this example we will use main.json.&lt;br /&gt;
&lt;br /&gt;
Create the file: &amp;lt;code&amp;gt;/etc/awall/optional/main.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;Main firewall&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;import&amp;quot;: [ &amp;quot;base&amp;quot;, &amp;quot;aliases&amp;quot;, &amp;quot;custom-services&amp;quot; ]&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Contents of your awall directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awall&lt;br /&gt;
│&lt;br /&gt;
├── optional&lt;br /&gt;
│   ├── main.json&lt;br /&gt;
│   ├── openvpn.json&lt;br /&gt;
│   ├── ssh-to-hostname.json&lt;br /&gt;
│   └── ssh.json&lt;br /&gt;
└── private&lt;br /&gt;
    ├── aliases.json&lt;br /&gt;
    ├── base.json&lt;br /&gt;
    └── custom-services.json&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling optional policies ===&lt;br /&gt;
&lt;br /&gt;
Lets enable our created policies. First we list them by running &amp;lt;code&amp;gt;awall list&amp;lt;/code&amp;gt; which would show something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openvpn         disabled  Allow local OpenVPN&lt;br /&gt;
main            disabled  Main firewall&lt;br /&gt;
ping            disabled  Allow rate-limited ping on WAN&lt;br /&gt;
ssh             disabled  Allow rate-limited SSH on WAN&lt;br /&gt;
ssh-to-hostname disabled  Forward SSH to hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each of these needs to be enabled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awall enable openvpn&lt;br /&gt;
awall enable main&lt;br /&gt;
awall enable ping&lt;br /&gt;
awall enable ssh&lt;br /&gt;
awall enable ssh-to-hostname&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The contents of your awall directory should now look like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awall/&lt;br /&gt;
├── main.json -&amp;gt; ./optional/main.json&lt;br /&gt;
├── openvpn.json -&amp;gt; ./optional/openvpn.json&lt;br /&gt;
├── optional&lt;br /&gt;
│   ├── main.json&lt;br /&gt;
│   ├── openvpn.json&lt;br /&gt;
│   ├── ping.json&lt;br /&gt;
│   ├── ssh-to-hostname.json&lt;br /&gt;
│   └── ssh.json&lt;br /&gt;
├── ping.json -&amp;gt; ./optional/ping.json&lt;br /&gt;
├── private&lt;br /&gt;
│   ├── aliases.json&lt;br /&gt;
│   ├── base.json&lt;br /&gt;
│   └── custom-services.json&lt;br /&gt;
├── ssh-to-hostname.json -&amp;gt; ./optional/ssh-to-hostname.json&lt;br /&gt;
└── ssh.json -&amp;gt; ./optional/ssh.json&lt;br /&gt;
&lt;br /&gt;
2 directories, 13 files&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing policies ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awall translate --verify&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if everything goes well the output should be null.&lt;br /&gt;
&lt;br /&gt;
=== Activating the firewall ===&lt;br /&gt;
&lt;br /&gt;
Now that all our policies are verified for proper json we can activate it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;awall activate&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load the firewall rules and show you a message to confirm. If by accident you made a mistake and lock yourself out you just have to wait for awall to disable itself again.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
=== Activating firewall rules at boot ===&lt;br /&gt;
&lt;br /&gt;
When awall has been properly activated it will generate a file with all iptables rules which iptables will read when its is started via openrc.&lt;br /&gt;
Make sure you have added iptables to an openrc runlevel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add iptables&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Allow IPv4 forwarding ===&lt;br /&gt;
&lt;br /&gt;
To allow iptables to forward packets from one zone to the other we need to enable this at the iptables level.&lt;br /&gt;
&lt;br /&gt;
==== On the fly ====&lt;br /&gt;
&lt;br /&gt;
To enable it on the fly:&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.ip_forward=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Enable within iptables tools (at boot) ====&lt;br /&gt;
&lt;br /&gt;
Add the following to:&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/conf.d/iptables&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Enable/disable IPv4 forwarding with the rules&lt;br /&gt;
IPFORWARD=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[How-To Alpine Wall]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Gray wolf</name></author>
	</entry>
</feed>