[SOLVED] Direct Kernel Boot

drjaymz@

Member
Jan 19, 2022
124
5
23
102
We have an unmanageable number of KVM VM's that I'm hoping to migrate. I have set up proxmox and tried a few basics with a few new WM's windows and linux and I'm happy with creating them and even importing a disk image and reattaching, should it be needed.

The part I can't immediately find information on is migrating across the Direct Kernel Booting:

<kernel>/media/seagate/Virtual Machines/vmlinuz-2.6.24-23-server</kernel>
<initrd>/media/seagate/Virtual Machines/initrd.img-2.6.24-23-server</initrd>
<cmdline>root=/dev/vda ro console=tty1 console=ttyS0,115200 2</cmdline>

Can I migrate this type of VM because I really don't want to rebuild everything? I also don't know why it was this way in the first place.

Code:
<domain type="kvm">
  <name>ldapb2</name>
  <uuid>984a54f1-58c4-4164-ac0c-c24a37f2b1fd</uuid>
  <title>ldap server</title>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://opensuse.org/opensuse/unknown"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">2097152</memory>
  <currentMemory unit="KiB">2097152</currentMemory>
  <vcpu placement="static">1</vcpu>
  <os>
    <type arch="x86_64" machine="pc-i440fx-hirsute">hvm</type>
    <kernel>/media/seagate/Virtual Machines/vmlinuz-2.6.24-23-server</kernel>
    <initrd>/media/seagate/Virtual Machines/initrd.img-2.6.24-23-server</initrd>
    <cmdline>root=/dev/vda ro console=tty1 console=ttyS0,115200 2</cmdline>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state="off"/>
  </features>
  <cpu mode="custom" match="exact" check="partial">
    <model fallback="allow">IvyBridge</model>
  </cpu>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/media/seagate/Virtual Machines/ldapb2-disk-root"/>
      <target dev="vda" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/media/seagate/Virtual Machines/ldapb2-swap"/>
      <target dev="vdb" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/media/seagate/Virtual Machines/ldapb2-disk-var"/>
      <target dev="vdc" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
    </disk>
    <controller type="usb" index="0" model="ich9-ehci1">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x7"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci1">
      <master startport="0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci2">
      <master startport="2"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x1"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci3">
      <master startport="4"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pci-root"/>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:03:3d:f9"/>
      <source network="default"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
    </graphics>
    <sound model="ich6">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
    </sound>
    <video>
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    </redirdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
    </memballoon>
  </devices>
</domain>
 
Last edited:
This looks like metadata of the VM, what is the format of disk?? if disk format is qcow2, raw or can be converted to these formats, VM can be ported to Proxmox
 
Yes there is no problem with the disk formats, they are RAW and some are qcow2.

The issue will be that as-is those disks contain no bootloader. Because in their natural habitat [the xml definition] the kvm does a direct kernel boot.

So my question is, since proxmox is using KVM I would have thought it a simple matter to migrate these intact.
 
should be possible to use them via the custom 'args' injection, but I'd still recommend migrating them to the regular setup sooner or later (if only because args is limited to being manually set by root only)
 
I appended this to the config file:

args: -kernel /mnt/pve/network-proxmox/images/102/vmlinuz-2.6.24-23-server -initrd /mnt/pve/network-proxmox/images/102/ -append root=/dev/vda ro console=tty1 console=ttyS0,115200 2

Which I very much doubt is the correct thing to do.
 
I ended up having to put that in quotations:

-kernel "/mnt/pve/network-proxmox/images/102/vmlinuz-2.6.24-23-server" -initrd "/mnt/pve/network-proxmox/images/102/initrd.img-2.6.24-23-server" -append "root=/dev/vda ro console=tty1 console=ttyS0,115200 2"

And whilst it boots the kernel it does not seem to mount the disk images correctly. So can anyone help with the syntax here? My guess is that the information following -append probably incorrect?
I can't find any documentation about the args it just seems to be a magic incantation bodge that we don't talk about?
 
I will mark this as solved because it boots. If I adjust either of the images or the append then it doesn't work so I think its working ok.
 
yeah, 'args' is basically an escape hatch to provide arbitrary arguments to the generated qemu command line - there is no special format to it, it's just passed along so users can do stuff that PVE itself doesn't support/handle/..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!