<?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=Birchb1024</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=Birchb1024"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Birchb1024"/>
	<updated>2026-04-28T06:37:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_LXC&amp;diff=13767</id>
		<title>Install Alpine on LXC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_LXC&amp;diff=13767"/>
		<updated>2017-09-11T15:28:27Z</updated>

		<summary type="html">&lt;p&gt;Birchb1024: /* Container creation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LXC ==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/LXC LXC] is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.&lt;br /&gt;
&lt;br /&gt;
With LXC you can run Alpine Linux on container and start services in it using native Alpine Linux&#039; init system (openrc).&lt;br /&gt;
&lt;br /&gt;
This is instruction on how to install Alpine Linux on LXC container.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
=== LXC installation ===&lt;br /&gt;
You have to install &amp;quot;lxc&amp;quot; package on your host system. For example, in Arch Linux you can install it by running:&lt;br /&gt;
{{Cmd|sudo pacman -S lxc}}&lt;br /&gt;
&lt;br /&gt;
=== Bridge creation ===&lt;br /&gt;
You also have to create network bridge on your host.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Network_bridge Setting up bridge in Arch Linux or Arch Linux based systems]&lt;br /&gt;
&lt;br /&gt;
[https://help.ubuntu.com/community/NetworkConnectionBridge Setting up bridge in Ubuntu or Ubuntu based systems]&lt;br /&gt;
&lt;br /&gt;
Here is example, how to setup bridge with netctl:&lt;br /&gt;
&lt;br /&gt;
Copy sample file &amp;quot;bridge&amp;quot;&lt;br /&gt;
{{Cmd|sudo cp /etc/netctl/examples/bridge /etc/netctl/myBridge}}&lt;br /&gt;
&lt;br /&gt;
Modify your bridge configuration file as needed (network interfaces: eno1 and tap0 are, of cource, according to your needs)&lt;br /&gt;
{{Cmd|sudo vim /etc/netctl/myBridge}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Description=&amp;quot;Bridge connection&amp;quot;&lt;br /&gt;
Interface=br0&lt;br /&gt;
Connection=bridge&lt;br /&gt;
BindsToInterfaces=(eno1 tap0)&lt;br /&gt;
IP=dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop active connection&lt;br /&gt;
{{Cmd|sudo systemctl stop dhcpcd}}&lt;br /&gt;
&lt;br /&gt;
Start your bridge	&lt;br /&gt;
{{Cmd|sudo netctl start myBridge}}&lt;br /&gt;
&lt;br /&gt;
Perhaps you may wish to setup your system to start your bridge automatically at boot time.&lt;br /&gt;
&lt;br /&gt;
== Container creation ==&lt;br /&gt;
&lt;br /&gt;
To install Alpine Linux edge version run:&lt;br /&gt;
{{Cmd|sudo lxc-create --name alpine-edge -t alpine -- --release edge}}&lt;br /&gt;
&lt;br /&gt;
You can also configure shared directory which will be accessible from both host and container. In this example we make host&#039;s /media/d directory available in container&lt;br /&gt;
{{Cmd|sudo mkdir /var/lib/lxc/alpine-edge/rootfs/media/d}}&lt;br /&gt;
&lt;br /&gt;
Modify container&#039;s configuration file:&lt;br /&gt;
{{Cmd|sudo nano /var/lib/lxc/alpine-edge/config}}&lt;br /&gt;
&lt;br /&gt;
Add folowing lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = br0&lt;br /&gt;
lxc.mount.entry=/media/d media/d none bind 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Booting container:&lt;br /&gt;
{{cmd|sudo lxc-start -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
Shutting down container:&lt;br /&gt;
{{cmd|sudo lxc-stop -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
Going to Alpine Linux console:&lt;br /&gt;
{{cmd|sudo lxc-attach -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
== Container setup ==&lt;br /&gt;
&lt;br /&gt;
Modify your apk/repositories configuration file&lt;br /&gt;
{{cmd|vi /etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
It is recommended to include &amp;quot;main&amp;quot;, &amp;quot;testing&amp;quot; and &amp;quot;community&amp;quot; repositories.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/main&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/testing&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/community&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upgrading your Alpine Linux system:&lt;br /&gt;
{{cmd|apk update &amp;amp;&amp;amp; apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
Starting services:&lt;br /&gt;
{{Cmd|/etc/init.d/service_name start}}&lt;br /&gt;
or&lt;br /&gt;
{{Cmd|rc-service service_name start}}&lt;br /&gt;
&lt;br /&gt;
Adding services to autostart&lt;br /&gt;
{{Cmd|rc-update add service_name}}&lt;br /&gt;
&lt;br /&gt;
Restarting your container:&lt;br /&gt;
{{Cmd|reboot}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Birchb1024</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_LXC&amp;diff=13766</id>
		<title>Install Alpine on LXC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_LXC&amp;diff=13766"/>
		<updated>2017-09-11T15:23:42Z</updated>

		<summary type="html">&lt;p&gt;Birchb1024: Missing slash in mount?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LXC ==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/LXC LXC] is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.&lt;br /&gt;
&lt;br /&gt;
With LXC you can run Alpine Linux on container and start services in it using native Alpine Linux&#039; init system (openrc).&lt;br /&gt;
&lt;br /&gt;
This is instruction on how to install Alpine Linux on LXC container.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
=== LXC installation ===&lt;br /&gt;
You have to install &amp;quot;lxc&amp;quot; package on your host system. For example, in Arch Linux you can install it by running:&lt;br /&gt;
{{Cmd|sudo pacman -S lxc}}&lt;br /&gt;
&lt;br /&gt;
=== Bridge creation ===&lt;br /&gt;
You also have to create network bridge on your host.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.archlinux.org/index.php/Network_bridge Setting up bridge in Arch Linux or Arch Linux based systems]&lt;br /&gt;
&lt;br /&gt;
[https://help.ubuntu.com/community/NetworkConnectionBridge Setting up bridge in Ubuntu or Ubuntu based systems]&lt;br /&gt;
&lt;br /&gt;
Here is example, how to setup bridge with netctl:&lt;br /&gt;
&lt;br /&gt;
Copy sample file &amp;quot;bridge&amp;quot;&lt;br /&gt;
{{Cmd|sudo cp /etc/netctl/examples/bridge /etc/netctl/myBridge}}&lt;br /&gt;
&lt;br /&gt;
Modify your bridge configuration file as needed (network interfaces: eno1 and tap0 are, of cource, according to your needs)&lt;br /&gt;
{{Cmd|sudo vim /etc/netctl/myBridge}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Description=&amp;quot;Bridge connection&amp;quot;&lt;br /&gt;
Interface=br0&lt;br /&gt;
Connection=bridge&lt;br /&gt;
BindsToInterfaces=(eno1 tap0)&lt;br /&gt;
IP=dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop active connection&lt;br /&gt;
{{Cmd|sudo systemctl stop dhcpcd}}&lt;br /&gt;
&lt;br /&gt;
Start your bridge	&lt;br /&gt;
{{Cmd|sudo netctl start myBridge}}&lt;br /&gt;
&lt;br /&gt;
Perhaps you may wish to setup your system to start your bridge automatically at boot time.&lt;br /&gt;
&lt;br /&gt;
== Container creation ==&lt;br /&gt;
&lt;br /&gt;
To install Alpine Linux edge version run:&lt;br /&gt;
{{Cmd|sudo lxc-create --name alpine-edge -t alpine -- --release edge}}&lt;br /&gt;
&lt;br /&gt;
You can also configure shared directory which will be accessible from both host and container. In this example we make host&#039;s /media/d directory available in container&lt;br /&gt;
{{Cmd|sudo mkdir /var/lib/lxc/alpine-edge/rootfs/media/d}}&lt;br /&gt;
&lt;br /&gt;
Modify container&#039;s configuration file:&lt;br /&gt;
{{Cmd|sudo nano /var/lib/lxc/alpine-edge/config}}&lt;br /&gt;
&lt;br /&gt;
Add folowing lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
lxc.network.link = br0&lt;br /&gt;
lxc.mount.entry=/media/d /media/d none bind 0 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Booting container:&lt;br /&gt;
{{cmd|sudo lxc-start -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
Shutting down container:&lt;br /&gt;
{{cmd|sudo lxc-stop -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
Going to Alpine Linux console:&lt;br /&gt;
{{cmd|sudo lxc-attach -n alpine-edge}}&lt;br /&gt;
&lt;br /&gt;
== Container setup ==&lt;br /&gt;
&lt;br /&gt;
Modify your apk/repositories configuration file&lt;br /&gt;
{{cmd|vi /etc/apk/repositories}}&lt;br /&gt;
&lt;br /&gt;
It is recommended to include &amp;quot;main&amp;quot;, &amp;quot;testing&amp;quot; and &amp;quot;community&amp;quot; repositories.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/main&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/testing&lt;br /&gt;
http://nl.alpinelinux.org/alpine/edge/community&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upgrading your Alpine Linux system:&lt;br /&gt;
{{cmd|apk update &amp;amp;&amp;amp; apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
Starting services:&lt;br /&gt;
{{Cmd|/etc/init.d/service_name start}}&lt;br /&gt;
or&lt;br /&gt;
{{Cmd|rc-service service_name start}}&lt;br /&gt;
&lt;br /&gt;
Adding services to autostart&lt;br /&gt;
{{Cmd|rc-update add service_name}}&lt;br /&gt;
&lt;br /&gt;
Restarting your container:&lt;br /&gt;
{{Cmd|reboot}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Birchb1024</name></author>
	</entry>
</feed>