<?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=Starwarsfan</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=Starwarsfan"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Starwarsfan"/>
	<updated>2026-04-26T00:15:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=9396</id>
		<title>LXC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=9396"/>
		<updated>2013-10-15T10:24:01Z</updated>

		<summary type="html">&lt;p&gt;Starwarsfan: Updated static IP description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://lxc.sourceforge.net/ Linux Containers (LXC)] provides containers similar BSD Jails, Linux VServer and Solaris Zones. It gives the impression of virtualization, but shares the kernel and resources with the &amp;quot;host&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Install the required packages:&lt;br /&gt;
{{Cmd|apk add lxc bridge}}&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/lxc.conf&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.link = br0&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create a guest ==&lt;br /&gt;
&lt;br /&gt;
=== Alpine Template ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest1 -f /etc/lxc/lxc.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 that by default 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;
=== Debian template ===&lt;br /&gt;
&lt;br /&gt;
In order to create a debian template container you will need to install some packages:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add debootstrap rsync}}&lt;br /&gt;
&lt;br /&gt;
Also you will 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;
Please remember to turn them back on, or just simply reboot the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can run:&lt;br /&gt;
{{Cmd|SUITE{{=}}wheezy lxc-create -n guest1 -f /etc/lxc/lxc.conf -t debian}}&lt;br /&gt;
&lt;br /&gt;
== Starting/Stopping the guest ==&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 on boot up with:&lt;br /&gt;
{{Cmd| rc-update add lxc.guest1}}&lt;br /&gt;
&lt;br /&gt;
== Connecting to the guest ==&lt;br /&gt;
By default sshd is not installed, so you will have to connect to a virtual console. This is done with:&lt;br /&gt;
{{Cmd|lxc-console -n guest1}}&lt;br /&gt;
&lt;br /&gt;
To disconnect from it, 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 and run:&lt;br /&gt;
{{Cmd|lxc-destroy -n guest1}}&lt;br /&gt;
This will erase eerything, without asking any questions. It is equivalent to: {{Cmd|rm -r /var/lib/lxc/guest1}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced ==&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 guest&#039;s /etc/network/interfaces. To stay on 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 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;/div&gt;</summary>
		<author><name>Starwarsfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=9395</id>
		<title>LXC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LXC&amp;diff=9395"/>
		<updated>2013-10-13T18:00:03Z</updated>

		<summary type="html">&lt;p&gt;Starwarsfan: Added some hints if using static IP on container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://lxc.sourceforge.net/ Linux Containers (LXC)] provides containers similar BSD Jails, Linux VServer and Solaris Zones. It gives the impression of virtualization, but shares the kernel and resources with the &amp;quot;host&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Install the required packages:&lt;br /&gt;
{{Cmd|apk add lxc bridge}}&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/lxc.conf&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lxc.network.type = veth&lt;br /&gt;
lxc.network.link = br0&lt;br /&gt;
lxc.network.flags = up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create a guest ==&lt;br /&gt;
&lt;br /&gt;
=== Alpine Template ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lxc-create -n guest1 -f /etc/lxc/lxc.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 that by default 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;
=== Debian template ===&lt;br /&gt;
&lt;br /&gt;
In order to create a debian template container you will need to install some packages:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add debootstrap rsync}}&lt;br /&gt;
&lt;br /&gt;
Also you will 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;
Please remember to turn them back on, or just simply reboot the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can run:&lt;br /&gt;
{{Cmd|SUITE{{=}}wheezy lxc-create -n guest1 -f /etc/lxc/lxc.conf -t debian}}&lt;br /&gt;
&lt;br /&gt;
== Starting/Stopping the guest ==&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 on boot up with:&lt;br /&gt;
{{Cmd| rc-update add lxc.guest1}}&lt;br /&gt;
&lt;br /&gt;
== Connecting to the guest ==&lt;br /&gt;
By default sshd is not installed, so you will have to connect to a virtual console. This is done with:&lt;br /&gt;
{{Cmd|lxc-console -n guest1}}&lt;br /&gt;
&lt;br /&gt;
To disconnect from it, 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 and run:&lt;br /&gt;
{{Cmd|lxc-destroy -n guest1}}&lt;br /&gt;
This will erase eerything, without asking any questions. It is equivalent to: {{Cmd|rm -r /var/lib/lxc/guest1}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced ==&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. First add these two options to you /var/lib/lxc/guest1/config:&lt;br /&gt;
&lt;br /&gt;
 lxc.network.ipv4 = &amp;lt;IP-to-use&amp;gt;&lt;br /&gt;
 lxc.network.ipv4.gateway = &amp;lt;IP-of-gateway-to-use&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And change /var/lib/lxc/guest1/rootfs/etc/network/interfaces 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;
&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 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;/div&gt;</summary>
		<author><name>Starwarsfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_Amazon_EC2&amp;diff=9139</id>
		<title>Install Alpine on Amazon EC2</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_Amazon_EC2&amp;diff=9139"/>
		<updated>2013-06-11T15:20:47Z</updated>

		<summary type="html">&lt;p&gt;Starwarsfan: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
The goal here is to have a &amp;quot;1GB&amp;quot; (the smallest possible) EBS &#039;virtual usb stick&#039; that can boot and run Alpine Linux.  &lt;br /&gt;
&lt;br /&gt;
= Create an EBS backed Alpine Linux AMI =&lt;br /&gt;
&lt;br /&gt;
{{Note|You need to do this process at least once in each availability region.  EBS can&#039;t be shared between Ireland and California, for instance.}}&lt;br /&gt;
&lt;br /&gt;
* Create an Amazon instance in the desired availability region.  A micro instance is fine - we will need it only long enough to create our EBS usb stick.&lt;br /&gt;
* Create a new 1GB EBS volume &lt;br /&gt;
* Attach the new volume to the running instance&lt;br /&gt;
* The new volume will have a name like /dev/xvdf or such&lt;br /&gt;
* Format the volume as ext4 {{Cmd|mke2fs -t ext4 /dev/xvdf}}  &#039;&#039;Do not partition it - just format the whole volume&#039;&#039;&lt;br /&gt;
* wget a &#039;&#039;&#039;x86_64&#039;&#039;&#039; iso and extract it to the new volume. 32bit will not work. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://dl-4.alpinelinux.org/alpine/v2.4/releases/x86_64/alpine-2.4.5-x86_64.iso&lt;br /&gt;
mkdir target&lt;br /&gt;
mkdir source&lt;br /&gt;
mount /dev/xvdf target&lt;br /&gt;
mount -o loop alpine-2.4.5-x86_64.iso source&lt;br /&gt;
cp -av source/boot target&lt;br /&gt;
cp -av source/apks target&lt;br /&gt;
umount source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a grub.conf on the new partition.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p target/boot/grub&lt;br /&gt;
cat - &amp;gt;target/boot/grub/grub.conf &amp;lt;&amp;lt;EOF &lt;br /&gt;
default=0&lt;br /&gt;
timeout=3&lt;br /&gt;
hiddenmenu&lt;br /&gt;
&lt;br /&gt;
title Alpine Linux&lt;br /&gt;
root (hd0)&lt;br /&gt;
kernel /boot/grsec alpine_dev=xvda1:ext4 modules=loop,squashfs,sd-mod,ext4 console=hvc0 pax_nouderef BOOT_IMAGE=/boot/grsec&lt;br /&gt;
initrd /boot/grsec.gz&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Syslinux automatically adds BOOT_IMAGE to the kernel command line; grub does not, so make sure you specify it in the grub.conf&lt;br /&gt;
:* You do not need any other grub files - just boot.conf&lt;br /&gt;
* symlink the grub.conf to menu.lst&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -sf ./grub.conf target/boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create an amazon.apkovl.tar.gz file to put on the target &lt;br /&gt;
** This is probably easiest on a local alpine linux instance.  Make sure the following are configured:&lt;br /&gt;
*** eth0 uses dhcp&lt;br /&gt;
*** networking is set to autostart&lt;br /&gt;
*** sshd is installed and set to autostart&lt;br /&gt;
*** Your ssh public key is in /root/.ssh/authorized_keys&lt;br /&gt;
*** The root password is set to something&lt;br /&gt;
*** lbu include root/.ssh&lt;br /&gt;
*** (optional) - Delete the /etc/ssh/*key* files, so they are created on the new box&lt;br /&gt;
** {{Cmd|lbu package amazon.apkovl.tar.gz}} {{Warning|If you are packaging on a 32bit box, manually delete etc/apk/arch from the apkovl.tar.gz file}}&lt;br /&gt;
** Copy amazon.apkovl.tar.gz to target/ &lt;br /&gt;
* Unmount target&lt;br /&gt;
* &#039;&#039;&#039;Do the following from the Amazon web interface&#039;&#039;&#039;&lt;br /&gt;
** Detach the new volume&lt;br /&gt;
** Make note of the volume ID&lt;br /&gt;
** Launch NEW instance.  Use defaults, amazon linux, micro; we are going to canibalize it in a bit, so defaults are fine here.&lt;br /&gt;
** Once the instance starts, &#039;&#039;stop&#039;&#039; but &#039;&#039;do not terminate&#039;&#039; the instance.&lt;br /&gt;
** Under EBS, detach the existing volume, and attach the alpine linux volume as /dev/sda1 (note the 1 at the end)&lt;br /&gt;
** Restart the instance&lt;br /&gt;
* Log in and make sure it works&lt;br /&gt;
* Do any final cleanups necessary, and if necessary lbu ci&lt;br /&gt;
** Only make configs that are appropriate for an AMI, we are going to snapshot this instance and create an AMI out of it&lt;br /&gt;
* Again from the Amazon web interface&lt;br /&gt;
** Delete the 8GB volume that is no longer needed&lt;br /&gt;
** &#039;&#039;Stop&#039;&#039; but do not terminate the instance&lt;br /&gt;
** Right click the stopped instance and choose &#039;Create Image (EBS AMI)&#039;&lt;br /&gt;
*** Image name should be unique for the image - example AlpineLinux-2.4.5&lt;br /&gt;
*** Description can be anything - example &#039;Base AlpineLinux Installation - no services&#039;&lt;br /&gt;
* Done. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Starwarsfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_Amazon_EC2&amp;diff=9138</id>
		<title>Install Alpine on Amazon EC2</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_Amazon_EC2&amp;diff=9138"/>
		<updated>2013-06-11T15:16:15Z</updated>

		<summary type="html">&lt;p&gt;Starwarsfan: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
The goal here is to have a &amp;quot;1GB&amp;quot; (the smallest possible) EBS &#039;virtual usb stick&#039; that can boot and run Alpine Linux.  &lt;br /&gt;
&lt;br /&gt;
= Create an EBS backed Alpine Linux AMI =&lt;br /&gt;
&lt;br /&gt;
{{Note|You need to do this process at least once in each availability region.  EBS can&#039;t be shared between Ireland and California, for instance.}}&lt;br /&gt;
&lt;br /&gt;
* Create an Amazon instance in the desired availability region.  A micro instance is fine - we will need it only long enough to create our EBS usb stick.&lt;br /&gt;
* Create a new 1GB EBS volume &lt;br /&gt;
* Attach the new volume to the running instance&lt;br /&gt;
* The new volume will have a name like /dev/xvdf or such&lt;br /&gt;
* Format the volume as ext4 {{Cmd|mke2fs -t ext4 /dev/xvdf}}  &#039;&#039;Do not partition it - just format the whole volume&#039;&#039;&lt;br /&gt;
* wget a &#039;&#039;&#039;x86_64&#039;&#039;&#039; iso and extract it to the new volume. 32bit will not work. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://dl-4.alpinelinux.org/alpine/v2.4/releases/x86_64/alpine-2.4.5-x86_64.iso&lt;br /&gt;
mkdir target&lt;br /&gt;
mkdir source&lt;br /&gt;
mount /dev/xvdf target&lt;br /&gt;
mount -o loop alpine-2.4.5-x86_64.iso source&lt;br /&gt;
cp -av source/boot target&lt;br /&gt;
cp -av source/apks target&lt;br /&gt;
umount source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a grub.conf on the new partition.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p target/boot/grub&lt;br /&gt;
cat - &amp;gt;target/boot/grub/grub.conf &amp;lt;&amp;lt;EOF &lt;br /&gt;
default=0&lt;br /&gt;
timeout=3&lt;br /&gt;
hiddenmenu&lt;br /&gt;
&lt;br /&gt;
title Alpine Linux&lt;br /&gt;
root (hd0)&lt;br /&gt;
kernel /boot/grsec alpine_dev=xvda1:ext4 modules=loop,squashfs,sd-mod,ext4 console=hvc0 pax_nouderef BOOT_IMAGE=/boot/grsec&lt;br /&gt;
initrd /boot/grsec.gz&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:* Syslinux automatically adds BOOT_IMAGE to the kernel command line; grub does not, so make sure you specify it in the grub.conf&lt;br /&gt;
:* You do not need any other grub files - just boot.conf&lt;br /&gt;
* symlink the grub.conf to menu.lst&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -sf ./grub.conf target/boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create an amazon.apkovl.tar.gz file to put on the target &lt;br /&gt;
** This is probably easiest on a local alpine linux instance.  Make sure the following are configured:&lt;br /&gt;
*** eth0 uses dhcp&lt;br /&gt;
*** networking is set to autostart&lt;br /&gt;
*** sshd is installed and set to autostart&lt;br /&gt;
*** your ssh public key is in /root/.ssh/authorized_keys&lt;br /&gt;
*** the root password is set to something&lt;br /&gt;
*** lbu include root/.ssh&lt;br /&gt;
*** (optional) - eldete the /etc/ssh/*key* files, so they are created on the new box&lt;br /&gt;
** {{Cmd|lbu package amazon.apkovl.tar.gz}} {{Warning|If you are packaging on a 32bit box, manually delete etc/apk/arch from the apkovl.tar.gz file}}&lt;br /&gt;
** copy amazon.apkovl.tar.gz to target/ &lt;br /&gt;
* Unmount target&lt;br /&gt;
* &#039;&#039;&#039;Do the following from the Amazon web interface&#039;&#039;&#039;&lt;br /&gt;
** Detach the new volume&lt;br /&gt;
** Make note of the volume ID&lt;br /&gt;
** Launch NEW instance.  Use defaults, amazon linux, micro; we are going to canibalize it in a bit, so defaults are fine here.&lt;br /&gt;
** Once the instance starts, &#039;&#039;stop&#039;&#039; but &#039;&#039;do not terminate&#039;&#039; the instance.&lt;br /&gt;
** Under EBS, detach the existing volume, and attach the alpine linux volume as /dev/sda1 (note the 1 at the end)&lt;br /&gt;
** Restart the instance&lt;br /&gt;
* Log in and make sure it works&lt;br /&gt;
* Do any final cleanups necessary, and if necessary lbu ci&lt;br /&gt;
** Only make configs that are appropriate for an AMI, we are going to snapshot this instance and create an AMI out of it&lt;br /&gt;
* Again from the Amazon web interface&lt;br /&gt;
** Delete the 8GB volume that is no longer needed&lt;br /&gt;
** &#039;&#039;Stop&#039;&#039; but do not terminate the instance&lt;br /&gt;
** right click the stopped instance and choose &#039;Create Image (EBS AMI)&#039;&lt;br /&gt;
*** Image name should be unique for the image - example AlpineLinux-2.4.5&lt;br /&gt;
*** Description can be anything - example &#039;Base AlpineLinux Installation - no services&#039;&lt;br /&gt;
* Done. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Starwarsfan</name></author>
	</entry>
</feed>