Difference between revisions of "Talk:Create Alpine Linux PV DomU"

From Alpine Linux
Jump to: navigation, search
(Replace menu.lst with grub.cfg)
m
Line 3: Line 3:
 
So, I propose changing the content to make it work with pvgrub2. The biggest change would be to swap out the instructions to create menu.lst with instructions to create grub.cfg as follows:
 
So, I propose changing the content to make it work with pvgrub2. The biggest change would be to swap out the instructions to create menu.lst with instructions to create grub.cfg as follows:
  
Before you reboot, mount the boot partition and create a grub/grub.cfg file for pvgrub:
+
Before you reboot, mount the boot partition and create a grub/grub.cfg file for pvgrub:<br/>
 +
<code>mount /dev/xvda1 /mnt</code>
 +
<code>mkdir /mnt/grub</code>
 +
Install a basic text editor like nano or vim:<br/>
 +
<code>apk add nano</code>
  
mount /dev/xvda1 /mnt
+
If using nano, enter:<br/>
 +
<code>nano /mnt/grub/grub.cfg</code>
  
mkdir /mnt/grub
+
Then add the following to create a basic grub2 file:
 
+
menuentry 'alpine-xen' {
If vim or emacs are good with you, create the file below as /boot/grub/grub.cfg. If not, first install nano with:
 
 
 
apk add nano
 
 
 
If using vim or apt, you presumably already know what your doing.
 
 
 
If using nano, the grub.cfg file should at least contain a basic grub2 file. Enter:
 
 
 
nano /mnt/grub/grub.cfg
 
 
 
then add the following to the new file:
 
 
 
menuentry 'alpine-xen' {
 
 
     set root=(xen/xvda,msdos1)
 
     set root=(xen/xvda,msdos1)
 
     linux /boot/vmlinuz-virt root=/dev/xvda3 modules=ext4
 
     linux /boot/vmlinuz-virt root=/dev/xvda3 modules=ext4
     initrd /boot/initramfs
+
     initrd /boot/initramfs  
}
+
}
 +
Finally, Ctrl-S to save, Ctrl-X to exit nano.
  
Ctrl-S to save, Ctrl-X to exit.
 
  
(and then carry on with the instructions).
 
  
 
I would add/change a few other small things: a bit more on pvgrub2, instructions to use LVM if that's set up in the host and a few more details around the initial installation process, etc.  
 
I would add/change a few other small things: a bit more on pvgrub2, instructions to use LVM if that's set up in the host and a few more details around the initial installation process, etc.  

Revision as of 15:16, 3 June 2020

This was recommended as a manual installation by the Xen Beginners Guide. It didn't work because it seems to be based on GRUB1. Because I'm not a regular Alpine user, I thought it might be helpful to post proposed changes here first.

So, I propose changing the content to make it work with pvgrub2. The biggest change would be to swap out the instructions to create menu.lst with instructions to create grub.cfg as follows:

Before you reboot, mount the boot partition and create a grub/grub.cfg file for pvgrub:

mount /dev/xvda1 /mnt
mkdir /mnt/grub

Install a basic text editor like nano or vim:

apk add nano

If using nano, enter:

nano /mnt/grub/grub.cfg

Then add the following to create a basic grub2 file:

menuentry 'alpine-xen' {
   set root=(xen/xvda,msdos1)
   linux /boot/vmlinuz-virt root=/dev/xvda3 modules=ext4
   initrd /boot/initramfs 
}

Finally, Ctrl-S to save, Ctrl-X to exit nano.


I would add/change a few other small things: a bit more on pvgrub2, instructions to use LVM if that's set up in the host and a few more details around the initial installation process, etc.

Comments welcome.



I had problems booting a 32bit Alpine domU on a OracleVM 2.2.2 (64bit) host - most probably since the Alpine kernel uses PVops.

The domU kernel failed to load with the following error:

Error: (2, 'Invalid kernel', 'elf_xen_note_check: ERROR: Will only load images built for the generic loader or Linux images')

Solution is to make sure you have a 64bit ISO.


Changes: I had to ln -s /media/cdrom to /media/xvdc or setup-alpine would not find some information.

The root fs would end up in readonly mount even when it shouldn't. Reason is that the barrier test during mount fails, if some of the underlying layers do not pass barriers (i.e. older LVM/DM in dom0). You have to change the /etc/fstab of the VM *and* run tune2fs -o nobarrier on the filesystem do disable barriers (or update the dom0). The "mounting root filesystem rw" init script prints out OK during all that, I'll be opening a bug about it. Right now the bugtracker does not send out confirmation emails.


One more thing: didnt the local Xen god hack pygrub to be able to boot alpine directly? This howto still assumes we need to save kernel somewhere, maybe we can instead pass them as arguments at first build. More complex but also more powerful.