Last active
November 9, 2022 09:09
-
-
Save hkoba/33b056841d3494ee89a736ba02616d9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
emulate -L zsh | |
installImgFn=/var/lib/libvirt/images/Win11_22H2_Japanese_x64v1.iso | |
vgName=/dev/fedora | |
volName=kvm-win11 | |
fullLvName=$vgName/$volName | |
function checkFile { | |
local fn=$1; shift | |
[[ -e $fn ]] || { echo 1>&2 "Missing file '$fn': $*"; exit 1 } | |
} | |
checkFile /usr/share/virtio-win/virtio-win.iso "Please install virtio-win" | |
checkFile /usr/share/edk2/ovmf/OVMF_CODE.secboot.fd "Please install edk2-ovmf" | |
checkFile /usr/share/edk2/ovmf/OVMF_VARS.secboot.fd "Please install edk2-ovmf" | |
lvcreate --name $volName --size 64G $vgName || exit $? | |
virt-install \ | |
--name Windows_11 \ | |
--ram 8192 \ | |
--cpu host-passthrough \ | |
--vcpus=4 \ | |
--os-variant=win10 \ | |
--network default \ | |
--graphics spice \ | |
--video virtio \ | |
--cdrom $installImgFn \ | |
--disk path=$fullLvName,device=disk,bus=virtio \ | |
--disk path=/usr/share/virtio-win/virtio-win.iso,device=cdrom,bus=sata \ | |
--features kvm_hidden=on,smm=on \ | |
--tpm backend.type=emulator,backend.version=2.0,model=tpm-tis \ | |
--boot loader=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd,loader_ro=yes,loader_type=pflash,nvram_template=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
前提
xhost si:localuser:root
しておけば、多分 virt-viewer のエラーも出ないはず。インストール後にやること