-1

I have a Ubuntu 14.04 migrated from Virtual Box

Have 3 partitions. I've updated the /etc/fstab for recognize the new partitions and chrooted for update the grub

I'm using the following ubuntu.cfg

bootloader = '/usr/bin/pygrub'
vcpus       = '1'
memory      = '1024'
root        = '/dev/xvda1 ro'
disk        = [
                  'phy:/dev/vms_xen/ubuntu_swp,xvda3,w',
                  'phy:/dev/vms_xen/ubuntu_root,xvda1,w',
                  'phy:/dev/vms_xen/ubuntu_data,xvda2,w'
              ]
name        = 'Ubuntu_1404'
vif         = [ 'ip=192.168.2.1,mac=08:00:27:ea:81:23' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
extra="console=hvc0"

The fstab file is

/dev/xvda1 /               ext4    rw,user_xattr,acl,barrier=1,noatime          0       1    
/dev/xvda3 none            swap    sw                                   0       0
/dev/xvda2 /data           ext4    rw,user_xattr,acl,barrier=1,noatime          0       0

when I try the command

# xl create -d /etc/xen/ubuntu.cfg
Parsing config file /etc/xen/ubuntu.cfg
(domain
        (domid -1)
        (create_info)
        (hvm 0)
        (hap 1)
        (oos 1)
        (ssidref 0)
        (name Ubuntu_1404)
        (uuid <unknown>)
        (cpupool Pool-0)
        (xsdata (null))
        (platformdata (null))
        (build_info)
        (max_vcpus 1)
        (tsc_mode 0)
        (max_memkb 1048576)
        (target_memkb 1048576)
        (nomigrate 0)
        (bootloader /usr/bin/pygrub)
        (image
                (linux 0)
                        (kernel (null))
                        (cmdline root=/dev/xvda1 ro console=hvc0)
                        (ramdisk (null))
                )
        )
        (device
                (tap
                        (backend_domid 0)
                        (frontend_domid 0)
                        (physpath /dev/vms_xen/ubuntu_swp)
                        (phystype 1)
                        (virtpath xvda3)
                        (unpluggable 0)
                        (readwrite 1)
                        (is_cdrom 0)
                )
        )
        (device
                (tap
                        (backend_domid 0)
                        (frontend_domid 0)
                        (physpath /dev/vms_xen/ubuntu_root)
                        (phystype 1)
                        (virtpath xvda1)
                        (unpluggable 0)
                        (readwrite 1)
                        (is_cdrom 0)
                )
        )
        (device
                (tap
                        (backend_domid 0)
                        (frontend_domid 0)
                        (physpath /dev/vms_xen/ubuntu_data)
                        (phystype 1)
                        (virtpath xvda2)
                        (unpluggable 0)
                        (readwrite 1)
                        (is_cdrom 0)
                )
        )
        (device
                (vif
                        (backend_domid 0)
                        (frontend_domid 0)
                        (devid 0)
                        (mtu 1492)
                        (model rtl8139)
                        (mac 080027ea8123)
                )
        )
)
failed to run bootloader: -3

The VM works fine on Virtual Box on my laptop, the VM was migrated using https://superuser.com/questions/892311/convert-vmdk-to-lvm

rkmax
  • 178
  • 8
  • 27

2 Answers2

2

Does /usr/bin/pygrub file really exist on your Dom0?

Have you tried to run it without PyGrub? Remove bootloader and add

kernel = '/vmlinuz'
ramdisk = '/initrd.img'

to use host system's kernel.

If you haven't configured GRUB on the guest system properly, PyGrub will not be able to boot. Also check this http://sygard.no/2012/09/ubuntu-12-04-xen-domu-failed-to-run-bootloader-3/

Dopamine
  • 176
  • 1
  • 8
0

I have no solution for this problem yet. My situation is that I'm running Ubuntu 14.04 Xen/xl on host (not having Bionic kernels in apt sources by default), and Ubuntu 18.04 as virtual machine (having Kernel 4.15.0-101-generic).

When the virtual machine was shut down, I mounted the disk and copied the kernel from within the box to the host machine:

mount /dev/ssd/virtualmachine-disk /mnt
cp /mnt/boot/boot/vmlinuz-4.15.0-101-generic /boot
cp /mnt/boot/boot/initrd.img-4.15.0-101-generic /boot
umount /mnt

Then edit /etc/xen/virtualmachine.cfg and change the kernel

kernel      = '/boot/vmlinuz-4.15.0-101-generic'
ramdisk     = '/boot/initrd.img-4.15.0-101-generic'

I have no idea yet, why pygrub doesn't work for this particular machine. It works ok for half-a-dozen other virtual machines on the same host.