Skip to content

Instantly share code, notes, and snippets.

@heppu
Created March 11, 2016 07:33
Show Gist options
  • Save heppu/4031d6807cf3c3e117a0 to your computer and use it in GitHub Desktop.
Save heppu/4031d6807cf3c3e117a0 to your computer and use it in GitHub Desktop.
Arch virtualization and CoreOS

Arch virtualization

Check virtualization support

lscpu

Check KVM modules

zgrep CONFIG_KVM /proc/config.gz
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_MMU_AUDIT=y
CONFIG_KVM_DEVICE_ASSIGNMENT=y

Check VIRTIO modules

zgrep CONFIG_VIRTIO /proc/config.gz
CONFIG_VIRTIO_BLK=m
CONFIG_VIRTIO_NET=m
CONFIG_VIRTIO_CONSOLE=m
CONFIG_VIRTIO=m
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_MMIO=m
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y

Check KVM modules are loaded

lsmod | grep kvm
kvm_intel             163840  0
kvm                   446464  1 kvm_intel

Check VIRTIO modules are loaded

lsmod | grep virtio

Add missing modules

sudo nano /etc/modules-load.d/virtio.conf
virtio
virtio-blk
virtio-pci
virtio-net
virtio-balloon

Install QEMU

sudo pacman -S qemu

Install libvirt and networking packages

sudo pacman -S libvirt ebtables dnsmasq bridge-utils openbsd-netcat

Enable and start libvirt

systemctl enable libvirtd.service
systemctl start libvirtd.service

Get CoreOS

mkdir -p /var/lib/libvirt/images/coreos
cd /var/lib/libvirt/images/coreos
wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2 -O - | bzcat > coreos_production_qemu_image.img

Create a qcow2 image snapshot

cd /var/lib/libvirt/images/coreos
qemu-img create -f qcow2 -b coreos_production_qemu_image.img coreos1.qcow2

Create a config drive file system to configure CoreOS

mkdir -p /var/lib/libvirt/images/coreos/coreos1/openstack/latest
touch /var/lib/libvirt/images/coreos/coreos1/openstack/latest/user_data

GUI for remote management

pacman -S virt-manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment