How to install Windows 10 directly on a phisycal disk using qemu / kvm

Hello.

I would like to install Windows 10 on the phisycal disk /dev/sdh on my Ubuntu 19.04,using qemu like this :

MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"
qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS

-machine pc-q35-2.9 -smp 4,cores=2 -usb -device usb-kbd -device usb-tablet -drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd -drive if=pflash,format=raw,file=OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.1,drive=WinHDD -drive id=WinHDD,if=none,file=/dev/sdh,cache=none,if=virtio,format=raw
-device ide-drive,bus=ide.0,drive=WinDVD -drive id=WinDVD,if=none,snapshot=on,media=cdrom,file=./‘windows10.iso’ -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 -monitor stdio

but that command is wrong,because it says :

"qemu-system-x86_64: -device ide-drive,bus=ide.1,drive=WinHDD: Property ‘ide-drive.drive’ can’t find value ‘WinHDD’
./boot-WinOS.sh: riga 29: -drive: command not found.

how to fix that ?

Use virtio or sata instead of ide

how ?

something like this ?

-device sata-drive,bus=sata.1,drive=WinHDD
-drive id=WinHDD,if=none,file=/dev/sdh,format=raw

Can’t you do a normal windows install and have it boot in a vm?

no. I want to learn a new thing today.

the easy way should be to install virt-manager and edit it there

I found most of the commands already in the qemu format and I’m not able to replicate them with virt-manager.

use virsh to create a new file using sata… to see the syntax/format if you need an example.

but i have something like this in a file of mine:

image