User:CandyAngel/KVM Host Tutorial

From Alpine Linux
Revision as of 20:48, 29 August 2015 by CandyAngel (talk | contribs) (Initial draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This material is work-in-progress ...

Instructions may be unexplained.
(Last edited by CandyAngel on 29 Aug 2015.)

Warning: These instructions are incomplete. The goal setup is not achievable by following them.


Goal setup:

Alpine Linux as KVM host on LVM on RAID1 on GPT disks.
Windows as KVM guest, with VGA passthrough (gaming).
Linux as KVM guest.

Instructions

  • Boot Alpine
  • Log in as root
Note: When prompted for what disk to use, select 'none'.

setup-alpine

Variables

export _DRIVE1=/dev/sdb export _DRIVE2=/dev/sde

Partitioning

apk add gptfdisk gdisk $_DRIVE1

o y n 1 +128M n 2 +930G x a 1 2 w y

sgdisk $_DRIVE1 -R $_DRIVE2 sgdisk -G $_DRIVE2

RAID1

modprobe raid1 echo raid1 >> /etc/modules apk add mdadm mdadm --create --level=1 --raid-devices=2 --metadata=1.0 /dev/md1 ${_DRIVE1}1 ${_DRIVE2}1 mdadm --create --level=1 --raid-devices=2 /dev/md2 ${_DRIVE1}2 ${_DRIVE2}2

y

mdadm --detail --scan > /etc/mdadm.conf rc-update add mdadm-raid boot

LVM

apk add lvm2 e2fsprogs syslinux pvcreate /dev/md2 vgcreate vg0 /dev/md2 lvcreate -n alpine-host -L 8G vg0 vgchange -ay rc-update add lvm

Filesystems

mkfs.ext3 /dev/md1 mkfs.ext3 /dev/vg0/alpine-host mount -t ext3 /dev/vg0/alpine-host /mnt mkdir /mnt/boot mount -t ext3 /dev/md1 /mnt/boot

Install Alpine

setup-disk -m sys /mnt

Install MBR

dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=${_DRIVE1} dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=${_DRIVE2}

Reboot

reboot