Config made easy. Thanks to @SSStormy

merge-requests/2/head
Yuri Alek 6 years ago
parent abf1d931ff
commit ce83fa8068

@ -114,7 +114,7 @@ IOMMU group 18
$ qemu-img create -f raw /path/to/image/windows.raw 60G
```
6. Edit the script `windows-install.sh` **and** `windows.sh` to convenience. Variables you may have to edit:
6. Edit the config in `scripts/config.sh` to convenience. If you use systemd to start the VM you have to edit the path of your config file in `qemu@.service`. Variables you may have to edit:
1. PCI devices. `IOMMU_GPU`; `IOMMU_USB`.
2. User.
3. Location of HDD/IMG, ISO, vBIOS and OVMF image.
@ -152,10 +152,11 @@ $ qemu-img create -f raw /path/to/image/windows.raw 60G
### For the sake of convenience
```
# ln -s scripts/qemu@.service /usr/lib/systemd/system/
# ln -s scripts/qemu-mac@.service /usr/lib/systemd/system/
```
```bash
$ alias windows="sudo systemctl start qemu@windows.service"
$ alias macos="sudo systemctl start qemu@macos-hs.service"
$ alias macos="sudo systemctl start qemu-mac@macos-hs.service"
```
To start the Windows VM
```

@ -0,0 +1,41 @@
# User.
USER=yu
# Path to VBIOS, IMG, Windows ISO, Virtio iso, ...
IMAGES=/home/$USER/vm
# IOMMU groups for passed devices.
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
# Virsh devices, only needed if you use virsh.
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
# PCI BUS ID for binding/unbinding devices.
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
# Images needed for QEMU.
VBIOS=$IMAGES/GK104_80.04.C3.00.0F-MODED.rom
IMG=$IMAGES/windows.raw
VIRTIO=$IMAGES/virtio.iso
ISO=$IMAGES/win10.iso
HDD=/dev/sdc
OVMF=/usr/share/ovmf/x64/OVMF_CODE.fd
# QEMU options
RAM=12G
CORES=12
# To run QEMU as user you need to allow more RAM to be locked by an user.
ULIMIT=$(ulimit -a | grep "max locked memory" | awk '{print $6}')
# Variable used to change the Frame Buffer resolution. Not needed.
RES="1920 1080"

@ -0,0 +1,42 @@
# User.
USER=yu
# Path to VBIOS, IMG, Windows ISO, Virtio iso, Clover, OVMF, ...
IMAGES=/home/$USER/vm
# IOMMU groups for passed devices.
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
# Virsh devices, only needed if you use virsh.
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
# PCI BUS ID for binding/unbinding devices.
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
# Images needed for QEMU.
VBIOS=$IMAGES/GK104_80.04.C3.00.0F-MODED.rom
IMG=$IMAGES/mac-hs.raw,id=disk,format=raw,if=none
CLOVER=$IMAGES/Clover-1080.qcow2
ISO=$IMAGES/HighSierra-10.13.6-qemu.iso
OVMF=$IMAGES/OSX-KVM/OVMF_CODE.fd
OVMF_VARS=$IMAGES/vm/OSX-KVM/OVMF_VARS.fd
# QEMU options
MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"
RAM=12G
CORES=4
# To run QEMU as user you need to allow more RAM to be locked by an user.
ULIMIT=$(ulimit -a | grep "max locked memory" | awk '{print $6}')
# Variable used to change the Frame Buffer resolution. Not needed.
RES="1920 1080"

@ -7,31 +7,17 @@ if [ "$EUID" -ne 0 ]
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=/home/$USER/vm/mac-hs.raw,id=disk,format=raw,if=none
CLOVER=/home/$USER/vm/Clover-1080.qcow2
ISO=/home/$USER/vm/HighSierra-10.13.6-qemu.iso
#HDD=file=/dev/sdc,media=disk
HDD=file=/home/$USER/vm/mac-hs.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=4
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
#RES="1920 1080"
# END Variables
source config-macos
# Memory lock limit
if [ $(ulimit -a | grep "max locked memory" | awk '{print $6}') != 12884900 ]; then
ulimit -l 12884900
fi
## Kill X and related
systemctl stop lightdm > /dev/null 2>&1
killall i3 > /dev/null 2>&1
sleep 2
# Kill the console to free the GPU
echo 0 > /sys/class/vtconsole/vtcon0/bind
@ -52,6 +38,10 @@ modprobe -r snd_hda_intel
sleep 2
# Load the kernel module
modprobe vfio
sleep 1
modprobe vfio_iommu_type1
sleep 1
modprobe vfio-pci
sleep 1
@ -85,9 +75,7 @@ echo $usbid > /sys/bus/pci/drivers/vfio-pci/remove_id
sleep 1
# QEMU (VM) command
MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"
qemu-system-x86_64 -enable-kvm \
qemu-system-x86_64 -runas $USER -enable-kvm \
-nographic -vga none -parallel none -serial none \
-m $RAM \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
@ -100,8 +88,8 @@ qemu-system-x86_64 -enable-kvm \
-device nec-usb-xhci,id=xhci \
-netdev user,id=net0 -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=/home/yu/vm/OSX-KVM/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/yu/vm/OSX-KVM/OVMF_VARS.fd \
-drive if=pflash,format=raw,readonly,file=$OVMF \
-drive if=pflash,format=raw,file=$OVMF_VARS \
-smbios type=2 \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=$CLOVER \
@ -113,12 +101,16 @@ qemu-system-x86_64 -enable-kvm \
# Wait for QEMU to finish before continue
wait
sleep 5
# Unload the vfio module. I am lazy, this leaves the GPU without drivers
modprobe -r vfio-pci
sleep 2
modprobe -r vfio_iommu_type1
sleep 2
modprobe -r vfio
sleep 2
# Reload the kernel modules. This loads the drivers for the GPU
modprobe snd_hda_intel
@ -131,12 +123,9 @@ modprobe nvidia
sleep 5
# Bind the usb
#echo $usbid > /sys/bus/pci/drivers/xhci_hcd/new_id
echo $usbbusid > /sys/bus/pci/devices/$usbbusid/driver/unbind
echo $usbbusid > /sys/bus/pci/drivers/xhci_hcd/bind
sleep 10
#echo $usbid > /sys/bus/pci/drivers/xhci_hcd/remove_id
#ls -la /sys/bus/pci/devices/$usbbusid/
# Re-Bind EFI-Framebuffer and Re-bind to virtual consoles
# [Source] [https://github.com/joeknock90/Single-GPU-Passthrough/blob/master/README.md#vm-stop-script]
@ -144,12 +133,14 @@ echo 1 > /sys/class/vtconsole/vtcon0/bind
sleep 1
echo 1 > tee /sys/class/vtconsole/vtcon1/bind
sleep 5
#echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
#sleep 1
# Reload the Display Manager to access X
systemctl start lightdm
sleep 5
# Restore the Frame Buffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
sleep 1
# Restore ulimit
ulimit -l $ULIMIT

@ -7,31 +7,17 @@ if [ "$EUID" -ne 0 ]
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=/home/$USER/vm/mac-hs.raw,id=disk,format=raw,if=none
CLOVER=/home/$USER/vm/Clover-1080.qcow2
ISO=/home/$USER/vm/HighSierra-10.13.6-qemu.iso
#HDD=file=/dev/sdc,media=disk
HDD=file=/home/$USER/vm/mac-hs.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=4
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
#RES="1920 1080"
# END Variables
source config-macos
# Memory lock limit
if [ $(ulimit -a | grep "max locked memory" | awk '{print $6}') != 12884900 ]; then
ulimit -l 12884900
fi
## Kill X and related
systemctl stop lightdm > /dev/null 2>&1
killall i3 > /dev/null 2>&1
sleep 2
# Kill the console to free the GPU
echo 0 > /sys/class/vtconsole/vtcon0/bind
@ -52,6 +38,10 @@ modprobe -r snd_hda_intel
sleep 2
# Load the kernel module
modprobe vfio
sleep 1
modprobe vfio_iommu_type1
sleep 1
modprobe vfio-pci
sleep 1
@ -85,9 +75,7 @@ echo $usbid > /sys/bus/pci/drivers/vfio-pci/remove_id
sleep 1
# QEMU (VM) command
MY_OPTIONS="+aes,+xsave,+avx,+xsaveopt,avx2,+smep"
qemu-system-x86_64 -enable-kvm \
qemu-system-x86_64 -runas $USER -enable-kvm \
-nographic -vga none -parallel none -serial none \
-m $RAM \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
@ -101,8 +89,8 @@ qemu-system-x86_64 -enable-kvm \
-netdev user,id=net0 \
-device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=/home/yu/vm/OSX-KVM/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/yu/vm/OSX-KVM/OVMF_VARS.fd \
-drive if=pflash,format=raw,readonly,file=$OVMF \
-drive if=pflash,format=raw,file=$OVMF_VARS \
-smbios type=2 \
-device ide-drive,bus=ide.2,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=$CLOVER \
@ -112,12 +100,15 @@ qemu-system-x86_64 -enable-kvm \
# Wait for QEMU to finish before continue
wait
sleep 5
# Unload the vfio module. I am lazy, this leaves the GPU without drivers
modprobe -r vfio-pci
sleep 2
modprobe -r vfio_iommu_type1
sleep 2
modprobe -r vfio
sleep 2
# Reload the kernel modules. This loads the drivers for the GPU
modprobe snd_hda_intel
@ -130,12 +121,9 @@ modprobe nvidia
sleep 5
# Bind the usb
#echo $usbid > /sys/bus/pci/drivers/xhci_hcd/new_id
echo $usbbusid > /sys/bus/pci/devices/$usbbusid/driver/unbind
echo $usbbusid > /sys/bus/pci/drivers/xhci_hcd/bind
sleep 10
#echo $usbid > /sys/bus/pci/drivers/xhci_hcd/remove_id
#ls -la /sys/bus/pci/devices/$usbbusid/
# Re-Bind EFI-Framebuffer and Re-bind to virtual consoles
# [Source] [https://github.com/joeknock90/Single-GPU-Passthrough/blob/master/README.md#vm-stop-script]
@ -143,12 +131,14 @@ echo 1 > /sys/class/vtconsole/vtcon0/bind
sleep 1
echo 1 > tee /sys/class/vtconsole/vtcon1/bind
sleep 5
#echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
#sleep 1
# Reload the Display Manager to access X
systemctl start lightdm
sleep 5
# Restore the Frame Buffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
sleep 1
# Restore ulimit
ulimit -l $ULIMIT

@ -0,0 +1,12 @@
[Unit]
Description=QEMU virtual machine (%i)
[Service]
#Type=forking
#PIDFile=/run/qemu_%i.pid
EnvironmentFile=/home/yu/scripts/config-macos
ExecStart=/home/yu/scripts/%i.sh
#TimeoutStopSec=1m
[Install]
WantedBy=multi-user.target

@ -4,7 +4,7 @@ Description=QEMU virtual machine (%i)
[Service]
#Type=forking
#PIDFile=/run/qemu_%i.pid
EnvironmentFile=/home/yu/scripts/config
ExecStart=/home/yu/scripts/%i.sh
#TimeoutStopSec=1m

@ -7,32 +7,7 @@ if [ "$EUID" -ne 0 ]
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=file=/home/$USER/vm/windows.raw,id=disk,format=raw,if=none
ISO=/home/yu/vm/win10.iso
HDD=file=/dev/sdc,media=disk,format=raw,if=none
# HDD=file=/home/$USER/vm/windows.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=12
RES="1920 1080"
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
ULIMIT=$(ulimit -a | grep "max locked memory" | awk '{print $6}')
# END Variables
source config.sh
_start()
{

@ -1,91 +0,0 @@
#!/bin/bash
# Check if the script is executed as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=file=/home/$USER/vm/windows.raw,id=disk,format=raw,if=none
ISO=/home/yu/vm/win10.iso
HDD=file=/dev/sdc,media=disk
# HDD=file=/home/$USER/vm/windows.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=12
RES="1920 1080"
# END Variables
## Kill X and related
systemctl stop lightdm
killall i3
sleep 2
# Unload the Kernel Modules that use the GPU
modprobe -r nvidia_drm
modprobe -r nvidia_modeset
modprobe -r nvidia
modprobe -r snd_hda_intel
# Kill the console to free the GPU
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Detach the GPU from host
virsh nodedev-detach $VIRSH_GPU > /dev/null 2>&1
virsh nodedev-detach $VIRSH_GPU_AUDIO > /dev/null 2>&1
virsh nodedev-detach $VIRSH_USB > /dev/null 2>&1
# QEMU (VM) command
qemu-system-x86_64 -enable-kvm \
-nographic -vga none -parallel none -serial none \
-enable-kvm \
-m $RAM \
-cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vapic,hv_vendor_id=0xDEADBEEFFF \
-rtc clock=host,base=localtime \
-smp $CORES,sockets=1,cores=$CORES,threads=0 \
-device vfio-pci,host=$IOMMU_GPU,multifunction=on,x-vga=on,romfile=$VBIOS \
-device vfio-pci,host=$IOMMU_GPU_AUDIO \
-device vfio-pci,host=$IOMMU_USB \
-drive if=pflash,format=raw,readonly,file=$OVMF_CODE \
-device virtio-scsi-pci,id=scsi0 \
-device scsi-hd,bus=scsi0.0,drive=rootfs \
-drive id=rootfs,$HDD > /dev/null 2>&1 &
# END QEMU (VM) command
# Wait for QEMU to finish before continue
wait
# Reattach the GPU to the host
virsh nodedev-reattach $VIRSH_USB > /dev/null 2>&1
virsh nodedev-reattach $VIRSH_GPU_AUDIO > /dev/null 2>&1
virsh nodedev-reattach $VIRSH_GPU > /dev/null 2>&1
# Set console resolution
fbset -xres $(echo "$RES" | awk '{print $1}') -yres $(echo "$RES" | awk '{print $2}')
# Re-Bind EFI-Framebuffer and Re-bind to virtual consoles
# [Source] [https://github.com/joeknock90/Single-GPU-Passthrough/blob/master/README.md#vm-stop-script]
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
echo 1 > /sys/class/vtconsole/vtcon0/bind
echo 1 > tee /sys/class/vtconsole/vtcon1/bind
# Reload the kernel modules
modprobe snd_hda_intel
modprobe nvidia_drm
modprobe nvidia_modeset
modprobe nvidia
# Reload the Display Manager to access X
systemctl start lightdm

@ -7,32 +7,7 @@ if [ "$EUID" -ne 0 ]
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=file=/home/$USER/vm/windows.raw,id=disk,format=raw,if=none
WIN10=/home/$USER/vm/win10.iso
VIRTIO=/home/$USER/vm/virtio-Windows-Drivers.iso
HDD=file=/dev/sdc,media=disk,format=raw,if=none
# HDD=file=/home/$USER/vm/windows.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=12
RES="1920 1080"
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
ULIMIT=$(ulimit -a | grep "max locked memory" | awk '{print $6}')
# END Variables
source config
# Memory lock limit
if [ $(ulimit -a | grep "max locked memory" | awk '{print $6}') != 12884900 ]; then
@ -100,7 +75,7 @@ echo $usbid > /sys/bus/pci/drivers/vfio-pci/remove_id
sleep 1
# QEMU (VM) command
qemu-system-x86_64 -runas yu -enable-kvm \
qemu-system-x86_64 -runas $USER -enable-kvm \
-nographic -vga none -parallel none -serial none \
-enable-kvm \
-m $RAM \
@ -112,14 +87,14 @@ qemu-system-x86_64 -runas yu -enable-kvm \
-device vfio-pci,host=$IOMMU_USB \
-device virtio-net-pci,netdev=n1 \
-netdev user,id=n1 \
-drive if=pflash,format=raw,readonly,file=$OVMF_CODE \
-drive media=cdrom,file=$WIN10,id=virtiocd1,if=none \
-drive if=pflash,format=raw,readonly,file=$OVMF \
-drive media=cdrom,file=$ISO,id=virtiocd1,if=none \
-device ide-cd,bus=ide.1,drive=virtiocd1 \
-drive media=cdrom,file=$VIRTIO,id=virtiocd2,if=none \
-device ide-cd,bus=ide.1,drive=virtiocd2 \
-device virtio-scsi-pci,id=scsi0 \
-device scsi-hd,bus=scsi0.0,drive=rootfs \
-drive id=rootfs,$HDD > /dev/null 2>&1 &
-drive id=rootfs,file=$HDD,media=disk,format=raw,if=none > /dev/null 2>&1 &
# END QEMU (VM) command
# Wait for QEMU to finish before continue

@ -7,32 +7,7 @@ if [ "$EUID" -ne 0 ]
fi
# END Check if you are sudo
# Variables
USER=yu
IOMMU_GPU=06:00.0
IOMMU_GPU_AUDIO=06:00.1
IOMMU_USB=07:00.3
VIRSH_GPU=pci_0000_06_00_0
VIRSH_GPU_AUDIO=pci_0000_06_00_1
VIRSH_USB=pci_0000_07_00_3
VBIOS=/home/$USER/vm/GK104_80.04.C3.00.0F-MODED.rom
IMG=file=/home/$USER/vm/windows.raw,id=disk,format=raw,if=none
ISO=/home/yu/vm/win10.iso
HDD=file=/dev/sdc,media=disk,format=raw,if=none
# HDD=file=/home/$USER/vm/windows.raw
OVMF_CODE=/usr/share/ovmf/x64/OVMF_CODE.fd
RAM=12G
CORES=12
RES="1920 1080"
videoid="10de 1184"
audioid="10de 0e0a"
usbid="1022 145f"
videobusid="0000:06:00.0"
audiobusid="0000:06:00.1"
usbbusid="0000:07:00.3"
ULIMIT=$(ulimit -a | grep "max locked memory" | awk '{print $6}')
# END Variables
source /home/yu/scripts/config
# Memory lock limit
if [ $(ulimit -a | grep "max locked memory" | awk '{print $6}') != 12884900 ]; then
@ -112,10 +87,10 @@ qemu-system-x86_64 -runas $USER -enable-kvm \
-device vfio-pci,host=$IOMMU_USB \
-device virtio-net-pci,netdev=n1 \
-netdev user,id=n1 \
-drive if=pflash,format=raw,readonly,file=$OVMF_CODE \
-drive if=pflash,format=raw,readonly,file=$OVMF \
-device virtio-scsi-pci,id=scsi0 \
-device scsi-hd,bus=scsi0.0,drive=rootfs \
-drive id=rootfs,$HDD > /dev/null 2>&1 &
-drive id=rootfs,file=$HDD,media=disk,format=raw,if=none > /dev/null 2>&1 &
# END QEMU (VM) command
# Wait for QEMU to finish before continue

Loading…
Cancel
Save