<?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=EvTheFuture</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=EvTheFuture"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/EvTheFuture"/>
	<updated>2026-05-10T13:04:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=22797</id>
		<title>Xen Dom0 on USB or SD</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=22797"/>
		<updated>2022-12-22T09:04:58Z</updated>

		<summary type="html">&lt;p&gt;EvTheFuture: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a USB device or SD card, so you can have your Dom0 running from tmpfs. This has some benefits, but you will need a place to store your guests (virtual machines) and a syslog server to redirect the logs to.&lt;br /&gt;
&lt;br /&gt;
The first step is to set up a basic usb or SD install. To do that, boot from the Alpine install CD (minimal is fine) and follow one of the following guides:&amp;lt;BR&amp;gt;[[Create a Bootable USB]] or [[Create a Bootable Compact Flash]].&lt;br /&gt;
&lt;br /&gt;
Once you finish installing Alpine Linux on your device, boot from it and configure your newly installed system:&lt;br /&gt;
&lt;br /&gt;
Set up the network interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-interfaces&lt;br /&gt;
# ifup eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| you may need to change &amp;lt;i&amp;gt;eth0&amp;lt;/i&amp;gt; to the name of your interface}}&lt;br /&gt;
&lt;br /&gt;
Continue by setting up the apk repositories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-apkrepos&lt;br /&gt;
[...]&lt;br /&gt;
# apk update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| you may need to edit /etc/apk/repositories and change the first line so it points to /media/usb/apks.}}&lt;br /&gt;
&lt;br /&gt;
Now that you have your system properly configured, it&#039;s time to install Xen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Should this not be apk add xen xen-hypervisor ?&lt;br /&gt;
# apk add xen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have Xen installed, we need to modify the usb [[Bootloaders|bootloader]] in order to load the Xen kernel. The first step is to remount /media/usb with write permissions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount -o remount,rw /media/usb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, copy the Xen kernel and mboot.c32 to the usb boot partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp /boot/xen.gz /media/usb/boot/&lt;br /&gt;
# cp /boot/mboot.c32 /media/usb/boot/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the necessary files to boot Xen from the usb device, it&#039;s time to change the bootloader and add a Xen entry.&amp;lt;BR&amp;gt;&lt;br /&gt;
To do so, open /media/usb/syslinux.cfg with your favorite editor and add one of the following entries:&lt;br /&gt;
&lt;br /&gt;
Normal boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz --- /boot/vmlinuz-hardened alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/modloop-hardened --- /boot/initramfs-hardened&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;you might have to use alpine_dev=UUID=XXXX-XXXX:vfat. UUID can be read using blkid.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;alternatively, to use /media/UUID=XXX-XXXX instead of /media/usb, see /proc/mounts to detect where your usb/cf card is mounted.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Serial console boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz com1=115200,8n1 console=com1 --- /boot/vmlinuz-hardened alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/modloop-hardened --- /boot/initramfs-hardened&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID to the correct one, and add the necessary modules for your system.&amp;lt;BR&amp;gt;It&#039;s also a good idea to check [http://wiki.xen.org/wiki/Xen_Hypervisor_Boot_Options Xen Boot options] and set, dom0_mem, dom0_vcpus_pin and dom0_max_vcpus.&lt;br /&gt;
&lt;br /&gt;
The next step is to load the necessary kernel modules for Xen. We will add them to /etc/modules so they will be loaded automatically at boot time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;xen_netback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;xen_blkback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to configure startup services. We will need udev and xencommons to start at boot time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rc-update add udev sysinit&lt;br /&gt;
# rc-update add udev-postmount&lt;br /&gt;
# rc-update add xenstored&lt;br /&gt;
# rc-update add xenconsoled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a fully functional Xen install. It&#039;s time to save your changes and boot into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lbu commit&lt;br /&gt;
# reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember to configure at least one network bridge. Follow the [[Bridge]] guide.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Xen Dom0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>EvTheFuture</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=22796</id>
		<title>Xen Dom0 on USB or SD</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=22796"/>
		<updated>2022-12-22T09:03:25Z</updated>

		<summary type="html">&lt;p&gt;EvTheFuture: Added information about bringing up the network interface after configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a USB device or SD card, so you can have your Dom0 running from tmpfs. This has some benefits, but you will need a place to store your guests (virtual machines) and a syslog server to redirect the logs to.&lt;br /&gt;
&lt;br /&gt;
The first step is to set up a basic usb or SD install. To do that, boot from the Alpine install CD (minimal is fine) and follow one of the following guides:&amp;lt;BR&amp;gt;[[Create a Bootable USB]] or [[Create a Bootable Compact Flash]].&lt;br /&gt;
&lt;br /&gt;
Once you finish installing Alpine Linux on your device, boot from it and configure your newly installed system:&lt;br /&gt;
&lt;br /&gt;
Set up the network interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-interfaces&lt;br /&gt;
# ifup eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| you may need to change &amp;lt;i&amp;gt;eth0&amp;lt;/i&amp;gt; to the name of your interfaces}}&lt;br /&gt;
&lt;br /&gt;
Continue by setting up the apk repositories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-apkrepos&lt;br /&gt;
[...]&lt;br /&gt;
# apk update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| you may need to edit /etc/apk/repositories and change the first line so it points to /media/usb/apks.}}&lt;br /&gt;
&lt;br /&gt;
Now that you have your system properly configured, it&#039;s time to install Xen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Should this not be apk add xen xen-hypervisor ?&lt;br /&gt;
# apk add xen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have Xen installed, we need to modify the usb [[Bootloaders|bootloader]] in order to load the Xen kernel. The first step is to remount /media/usb with write permissions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount -o remount,rw /media/usb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, copy the Xen kernel and mboot.c32 to the usb boot partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp /boot/xen.gz /media/usb/boot/&lt;br /&gt;
# cp /boot/mboot.c32 /media/usb/boot/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the necessary files to boot Xen from the usb device, it&#039;s time to change the bootloader and add a Xen entry.&amp;lt;BR&amp;gt;&lt;br /&gt;
To do so, open /media/usb/syslinux.cfg with your favorite editor and add one of the following entries:&lt;br /&gt;
&lt;br /&gt;
Normal boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz --- /boot/vmlinuz-hardened alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/modloop-hardened --- /boot/initramfs-hardened&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;you might have to use alpine_dev=UUID=XXXX-XXXX:vfat. UUID can be read using blkid.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;alternatively, to use /media/UUID=XXX-XXXX instead of /media/usb, see /proc/mounts to detect where your usb/cf card is mounted.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Serial console boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz com1=115200,8n1 console=com1 --- /boot/vmlinuz-hardened alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/modloop-hardened --- /boot/initramfs-hardened&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID to the correct one, and add the necessary modules for your system.&amp;lt;BR&amp;gt;It&#039;s also a good idea to check [http://wiki.xen.org/wiki/Xen_Hypervisor_Boot_Options Xen Boot options] and set, dom0_mem, dom0_vcpus_pin and dom0_max_vcpus.&lt;br /&gt;
&lt;br /&gt;
The next step is to load the necessary kernel modules for Xen. We will add them to /etc/modules so they will be loaded automatically at boot time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;xen_netback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;xen_blkback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to configure startup services. We will need udev and xencommons to start at boot time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rc-update add udev sysinit&lt;br /&gt;
# rc-update add udev-postmount&lt;br /&gt;
# rc-update add xenstored&lt;br /&gt;
# rc-update add xenconsoled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a fully functional Xen install. It&#039;s time to save your changes and boot into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lbu commit&lt;br /&gt;
# reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember to configure at least one network bridge. Follow the [[Bridge]] guide.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Xen Dom0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>EvTheFuture</name></author>
	</entry>
</feed>