KVM guest // DragonFly

assuming the host is up and running already

as user (assuming you’re a member of the libvirt group)

mkdir -p /data/ISO-IMAGES/dfly/
cd /data/ISO-IMAGES/dfly/
wget http://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-6.2.1_REL.iso.bz2
bunzip2 dfly-x86_64-6.2.1_REL.iso.bz2

guest=dfly621

mkdir -p /data/guests/$guest/
cd /data/guests/$guest/

we do NOT use pre-defined variants as it overrides our virtio settings.

#osinfo-query os | less
#osinfo-query os | grep dragon | tail -1
#variant=dragonflybsd5.6

virt-install \
    --name $guest \
    --vcpus 2 \
    --ram 256 \
    --disk path=/data/guests/$guest/$guest.qcow2,size=8,bus=virtio \
    --cdrom /data/ISO-IMAGES/dfly/dfly-x86_64-6.2.1_REL.iso \
    --network bridge=virbr0,model=virtio \
                --graphics vnc --noautoconsole

            # --os-type generic \
            # --os-variant generic \

    UFS # we get kernel panic with HAMMER2 (or increase RAM?)

    host: dfly621
    domain: example.local

after successful installation, enable serial console and shutdown the machine for further ado

cp -pi /boot/loader.conf /boot/loader.conf.dist
vi /boot/loader.conf

sio0.flags=0x10
sio0.baud=115200
set boot_serial="YES"
console=comconsole
set comconsole_speed=155200

shutdown -p now

note machine type q35 didn’t work here (kernel panic) but pc does.

qemu-system-x86_64 --version
qemu-system-x86_64 -machine help

eventually tune your KVM guest.

virsh dumpxml $guest > $guest.xml.dist
vi $guest.xml

<domain type='kvm'>
  <name>dfly621</name>
  <memory unit='GiB'>1</memory>
  <currentMemory unit='GiB'>1</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/data/guests/dfly621/dfly621.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <source bridge='virbr0'/>
      <model type='virtio'/>
    </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>
  </devices>
</domain>

ready to go

virsh list --all
#virsh destroy $guest
virsh undefine $guest
virsh create $guest.xml --console

Resources

Setup on PC Engines APU2 Boards https://lists.dragonflybsd.org/pipermail/users/2020-June/404407.html

Features/Q35 https://wiki.qemu.org/Features/Q35

How can I change Qemu KVM machine architecture from 440fx to q35 with virsh edit or virt-manager https://serverfault.com/questions/637917/how-can-i-change-qemu-kvm-machine-architecture-from-440fx-to-q35-with-virsh-edit

[Qemu-devel] [PATCH] vfio/pci: Hide device PCIe capability on non-expres https://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05385.html

QEMU Unsupported Machine Type ‘pc-q35-3.1’ https://forum.level1techs.com/t/qemu-unsupported-machine-type-pc-q35-3-1/140084


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun