Xen Dom0: Difference between revisions

From Alpine Linux
mNo edit summary
(update / serial console / more accurate infos / almost working)
Line 5: Line 5:
{{Cmd|apk add xen}}
{{Cmd|apk add xen}}


Modify your extlinux.cfg: http://lists.alpinelinux.org/alpine-devel/1406.html
Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html)
since video card is not working for now, we will use a serial console:


<pre>
<pre>
timeout 20
SERIAL 0 115200
prompt 1
DEFAULT menu.c32
default grsec
PROMPT 0
label grsec
MENU TITLE Alpine/Linux Boot Menu
kernel /boot/vmlinuz-grsec
MENU HIDDEN
append initrd=/boot/initramfs-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4
MENU AUTOBOOT Alpine will be booted automatically in # seconds.
label xen
TIMEOUT 50
kernel mboot.c32
LABEL 0
append /boot/xen-4.gz console=/dev/null dom0_mem=256M vga=mode-0x0311 --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 vga=785 --- /boot/initramfs-grsec
  MENU DEFAULT
</pre>
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17
Of course replace root=UUID= with '''your''' UUID in yours.
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17
Default menu.c32 can mangle with Xen, further investigation needed, so don't use for now.
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet


Use the script found here: http://lists.xensource.com/archives/html/xen-devel/2010-03/msg01605.html
LABEL 1
<pre>
  MENU LABEL Linux 2.6.36.3-scst
#!/bin/sh
  KERNEL vmlinuz-2.6.36.3-scst
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet


test -d /proc/xen      || exit 0
LABEL 2
test -f /proc/xen/capabilities  || mount -t xenfs xen /proc/xen
  MENU LABEL Linux 2.6.38.8-grsec
test -f /proc/xen/capabilities  || exit 0
  KERNEL vmlinuz-2.6.38.8-grsec
grep -q "control_d" /proc/xen/capabilities      || exit 0
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet


for module in xen-evtchn evtchn blkbk netbk; do
LABEL 3
        modprobe ${module}>/dev/null 2>&1
  MENU LABEL XEN
        done
  KERNEL mboot.c32
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec
</pre>
</pre>
Of course replace root=UUID= with '''your''' UUID in yours.
xl info won't work
xl info won't work


Start xecommons:
Start xecommons:
xencommons  use bash, so install it.
<pre>
 
{{Cmd|apk add bash}} (should try sh instead)
 
alpine:/boot# /etc/init.d/xencommons start
alpine:/boot# /etc/init.d/xencommons start
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory
 
</pre>
well this will fail but xl info will work anyway
well this will fail but xl info will work anyway


Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?
Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ?
let's start udev ! ;)
let's start udev ! ;)
{{Cmd|rc-service udev start}}


That's all folks !
That's all folks !


on going debug:
vi /etc/rc.conf
vi /etc/rc.conf
rc_sys="xen0"
rc_sys="xen0"
and xencommons not launching at boot

Revision as of 15:19, 22 August 2011

So before anything else verify that you can reliably log into your Alpine box through SSH, because with some video chipset (intel in my case) xen will blank your screen so you will have to use SSH.

Then upgrade your setup to Edge/testing (as of the date of writing, Xen is only available in Edge). Install Xen:

apk add xen

Modify your extlinux.cfg (credits: http://lists.alpinelinux.org/alpine-devel/1406.html) since video card is not working for now, we will use a serial console:

SERIAL 0 115200 
DEFAULT menu.c32
PROMPT 0
MENU TITLE Alpine/Linux Boot Menu
MENU HIDDEN
MENU AUTOBOOT Alpine will be booted automatically in # seconds.
TIMEOUT 50
LABEL 0
  MENU DEFAULT
  MENU LABEL Linux 2.6.38.8-vs2.3.0.37-rc17
  KERNEL vmlinuz-2.6.38.8-vs2.3.0.37-rc17
  APPEND initrd=initramfs-2.6.38.8-vs2.3.0.37-rc17 root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet

LABEL 1
  MENU LABEL Linux 2.6.36.3-scst
  KERNEL vmlinuz-2.6.36.3-scst
  APPEND initrd=initramfs-2.6.36.3-scst root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet

LABEL 2
  MENU LABEL Linux 2.6.38.8-grsec
  KERNEL vmlinuz-2.6.38.8-grsec
  APPEND initrd=initramfs-2.6.38.8-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 quiet

LABEL 3
  MENU LABEL XEN
  KERNEL mboot.c32
  APPEND /boot/xen-4.gz loglvl=all guest_loglvl=all com1=115200,8n1 console=com1 dom0_mem=256M --- /boot/vmlinuz-grsec root=UUID=f40e340b-ea49-445b-81c0-4d7104b56662 modules=sd-mod,usb-storage,ext4 console=hvc0 earlyprintk=xen nomodeset --- /boot/initramfs-grsec

Of course replace root=UUID= with your UUID in yours.

xl info won't work

Start xecommons:

alpine:/boot# /etc/init.d/xencommons start
Starting xenstored...FATAL: Failed to open evtchn device: No such file or directory

well this will fail but xl info will work anyway

Oh but wait, evtchn device is built in the kernel, so why is there no /dev/xen/evtch file ? let's start udev ! ;)

rc-service udev start

That's all folks !

on going debug: vi /etc/rc.conf rc_sys="xen0"

and xencommons not launching at boot