<?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=Richtrabing</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=Richtrabing"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Richtrabing"/>
	<updated>2026-04-28T08:45:40Z</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=14100</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=14100"/>
		<updated>2017-10-23T15:49:01Z</updated>

		<summary type="html">&lt;p&gt;Richtrabing: Updating syslinux configuration with new kernel, initrd and modloop filenames; some changes to setting up apk repos and some of the notes on edge cases.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a USB 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 this boot from the Alpine install CD (minimal is fine) and follow one of the following guides: [[Create a Bootable USB]] or [[Create a Bootable Compact Flash]].&lt;br /&gt;
&lt;br /&gt;
Once you finished installing Alpine Linux on your device, boot from it and configure your newly installed system:&lt;br /&gt;
&lt;br /&gt;
Setup the network interfaces and apk repositories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-interfaces&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 we have Xen installed, but we will 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 we have all the necessary files to boot Xen from the usb, it&#039;s time to change the bootloader and add a Xen entry, 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 might work as well. UUID can be read using blkid.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;alternatively, using /media/UUID=XXX-XXXX instead of /media/usb, see /proc/mounts to detected where is your usb/cf card 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. 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 at least.&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 on boot:&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 at least to be started on boot:&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;
Ok, 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;
Also remember to configure at least one network bridge following 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>Richtrabing</name></author>
	</entry>
</feed>